@overmap-ai/forms 1.0.33-toast-migration.1 → 1.0.34
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/form/conditions/BaseCondition/BaseCondition.d.ts +3 -1
- package/dist/form/conditions/utils.d.ts +0 -2
- package/dist/form/modifiers/conditionModifier.d.ts +3 -3
- package/dist/form/modifiers/typings.d.ts +2 -0
- package/dist/form/utils.d.ts +0 -1
- package/dist/forms.js +14919 -24088
- package/dist/forms.umd.cjs +240 -36119
- package/package.json +3 -3
- package/dist/forms.js.map +0 -1
- package/dist/forms.umd.cjs.map +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { FieldValues } from '../../typings';
|
|
2
3
|
import { BaseSerializedCondition, ConditionRenderProps } from './typings';
|
|
3
4
|
import { AnyField, TypeOfField, ValueOfField } from '../../fields';
|
|
4
5
|
import { AnyConditionModifierConfig } from '../../modifiers';
|
|
@@ -24,5 +25,6 @@ export declare abstract class BaseCondition<TField extends AnyField, TValue, TCo
|
|
|
24
25
|
setConditionModifier: (modifier: TModifiers) => void;
|
|
25
26
|
getConditionModifiers: () => [keyof typeof this.modifiers, AnyConditionModifierConfig<ValueOfField<TField>, TConditionValue, TSerializedConditionValue>][];
|
|
26
27
|
abstract render(props: ConditionRenderProps<this>): ReactNode;
|
|
27
|
-
|
|
28
|
+
accessorFn: (values: FieldValues) => ValueOfField<TField>;
|
|
29
|
+
getApplyFn: () => (value: ValueOfField<TField>) => boolean;
|
|
28
30
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { FieldValues } from '../typings';
|
|
2
1
|
import { Condition, SerializedCondition } from './typings';
|
|
3
2
|
import { Field } from '../fields';
|
|
4
3
|
export declare const deserializeCondition: (field: Field, serializedCondition: SerializedCondition) => Condition;
|
|
5
4
|
export declare const deserializeConditions: (fields: Field[], serializedConditions: SerializedCondition[]) => Condition[];
|
|
6
|
-
export declare const applyConditions: (conditions: Condition[], values: FieldValues) => boolean;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ConditionApplyFnGetter } from './typings';
|
|
2
2
|
export interface ConditionModifierConfig<TModifierValue, TModifierConditionValue, TSerializedModifierConditionValue = TModifierConditionValue> {
|
|
3
3
|
id: string;
|
|
4
4
|
label: string;
|
|
5
|
-
|
|
5
|
+
getApplyFn: ConditionApplyFnGetter<TModifierValue, TModifierConditionValue>;
|
|
6
6
|
serialize: (conditionValue: TModifierConditionValue) => TSerializedModifierConditionValue;
|
|
7
7
|
deserialize: (serializedConditionValue: TSerializedModifierConditionValue) => TModifierConditionValue | undefined;
|
|
8
8
|
}
|
|
9
9
|
export declare class ConditionModifier<TModifierValue, TConditionValue, TSerializedConditionValue = TConditionValue> {
|
|
10
10
|
readonly id: string;
|
|
11
11
|
readonly label: string;
|
|
12
|
-
readonly
|
|
12
|
+
readonly getApplyFn: ConditionApplyFnGetter<TModifierValue, TConditionValue>;
|
|
13
13
|
readonly serialize: (conditionValue: TConditionValue) => TSerializedConditionValue;
|
|
14
14
|
readonly deserialize: (serializedConditionValue: TSerializedConditionValue) => TConditionValue | undefined;
|
|
15
15
|
private constructor();
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ConditionModifier } from './conditionModifier';
|
|
2
2
|
export type ConditionModifierFn<TValue, TConditionValue> = (value: TValue, conditionValue: TConditionValue) => boolean;
|
|
3
|
+
export type ConditionApplyFn<TValue> = (value: TValue) => boolean;
|
|
4
|
+
export type ConditionApplyFnGetter<TValue, TConditionValue> = (conditionValue: TConditionValue) => ConditionApplyFn<TValue>;
|
|
3
5
|
export interface FieldConditionModifierConfig<TValue, TConditionValue, TSerializedConditionValue, TModifierValue extends TValue, TModifierConditionValue extends TConditionValue, TSerializedModifierConditionValue extends TSerializedConditionValue> {
|
|
4
6
|
modifier: ConditionModifier<TModifierValue, TModifierConditionValue, TSerializedModifierConditionValue>;
|
|
5
7
|
isValueValid: (value: TValue) => value is TModifierValue;
|
package/dist/form/utils.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { FormikErrors } from 'formik';
|
|
|
2
2
|
import { FieldFiles, FieldFilesAndPromises, FieldValues } from './typings';
|
|
3
3
|
import { AnyFormElement, SerializedFieldSection } from './fields';
|
|
4
4
|
export declare const validateFields: (fields: AnyFormElement[], values: FieldValues) => FormikErrors<FieldValues> | undefined;
|
|
5
|
-
export declare const cleanFields: (fields: AnyFormElement[], values: FieldValues) => FormikErrors<FieldValues> | undefined;
|
|
6
5
|
export declare const separateImagesFromFields: (fields: SerializedFieldSection[]) => Promise<{
|
|
7
6
|
fields: SerializedFieldSection[];
|
|
8
7
|
images: Record<string, File>;
|