@overmap-ai/forms 1.0.30 → 1.0.32-react-flow-david.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.
- package/dist/form/builder/FieldBuilder.d.ts +2 -3
- package/dist/form/builder/FieldSectionBuilder.d.ts +9 -0
- package/dist/form/builder/FieldSectionConditionEdge.d.ts +4 -0
- package/dist/form/builder/FieldSectionConditionMenu.d.ts +10 -0
- package/dist/form/builder/FieldSectionConditionalItem.d.ts +11 -0
- package/dist/form/builder/FieldSectionNode.d.ts +16 -0
- package/dist/form/builder/FieldSectionWithActions.d.ts +2 -3
- package/dist/form/builder/FieldWithActions.d.ts +2 -2
- package/dist/form/builder/constants.d.ts +0 -1
- package/dist/form/builder/flow/CustomNode.d.ts +1 -0
- package/dist/form/builder/flow/FlowEditor.d.ts +1 -0
- package/dist/form/builder/flow/NodeSectionEditor.d.ts +5 -0
- package/dist/form/builder/flow/SectionSidePanel.d.ts +5 -0
- package/dist/form/builder/utils.d.ts +1 -0
- package/dist/form/conditions/components/BooleanFieldConditionCell.d.ts +5 -0
- package/dist/form/conditions/components/CheckboxListFieldConditionCell.d.ts +5 -0
- package/dist/form/conditions/components/ConditionModifierDropdown.d.ts +13 -0
- package/dist/form/conditions/components/DateFieldConditionCell.d.ts +5 -0
- package/dist/form/conditions/components/DayPickerPopover.d.ts +4 -0
- package/dist/form/conditions/components/MultiSelectFieldConditionCell.d.ts +5 -0
- package/dist/form/conditions/components/MultiStringFieldConditionCell.d.ts +5 -0
- package/dist/form/conditions/components/NumberFieldConditionCell.d.ts +5 -0
- package/dist/form/conditions/components/RadioFieldConditionCell.d.ts +5 -0
- package/dist/form/conditions/components/RemoveConditionButton.d.ts +9 -0
- package/dist/form/conditions/components/ScanFieldConditionCell.d.ts +5 -0
- package/dist/form/conditions/components/SelectFieldConditionCell.d.ts +5 -0
- package/dist/form/conditions/components/SelectFieldOptionMultiSelectGroup.d.ts +6 -0
- package/dist/form/conditions/components/SelectFieldOptionSelectGroup.d.ts +6 -0
- package/dist/form/conditions/components/StringFieldConditionCell.d.ts +5 -0
- package/dist/form/conditions/components/TextFieldConditionCell.d.ts +5 -0
- package/dist/form/conditions/components/TextInputPopover.d.ts +9 -0
- package/dist/form/conditions/components/UploadFieldConditionCell.d.ts +5 -0
- package/dist/form/conditions/components/constants.d.ts +4 -0
- package/dist/form/conditions/condition/condition.d.ts +26 -0
- package/dist/form/conditions/condition/index.d.ts +1 -0
- package/dist/form/conditions/condition/typings.d.ts +16 -0
- package/dist/form/conditions/hooks.d.ts +10 -0
- package/dist/form/conditions/index.d.ts +1 -0
- package/dist/form/conditions/manager/conditionManager.d.ts +24 -0
- package/dist/form/conditions/manager/index.d.ts +2 -0
- package/dist/form/conditions/manager/typings.d.ts +1 -0
- package/dist/form/conditions/modifier/conditionModifier.d.ts +17 -0
- package/dist/form/conditions/modifiers/boolean.d.ts +3 -0
- package/dist/form/conditions/modifiers/date.d.ts +5 -0
- package/dist/form/conditions/modifiers/file.d.ts +3 -0
- package/dist/form/conditions/modifiers/index.d.ts +4 -0
- package/dist/form/conditions/modifiers/number.d.ts +7 -0
- package/dist/form/conditions/modifiers/string.d.ts +12 -0
- package/dist/form/conditions/typings.d.ts +14 -0
- package/dist/form/conditions/utils.d.ts +2 -0
- package/dist/form/fields/BaseField/BaseField.d.ts +14 -2
- package/dist/form/fields/BaseField/hooks.d.ts +13 -13
- package/dist/form/fields/BaseField/typings.d.ts +8 -1
- package/dist/form/fields/BaseSelectField/BaseSelectField.d.ts +1 -1
- package/dist/form/fields/BaseSelectField/typings.d.ts +1 -2
- package/dist/form/fields/BooleanField/BooleanField.d.ts +9 -2
- package/dist/form/fields/CheckboxListField/CheckboxListField.d.ts +12 -2
- package/dist/form/fields/DateField/DateField.d.ts +13 -4
- package/dist/form/fields/FieldSection/FieldSection.d.ts +8 -13
- package/dist/form/fields/FieldSection/typings.d.ts +3 -7
- package/dist/form/fields/MultiSelectField/MultiSelectField.d.ts +16 -5
- package/dist/form/fields/MultiStringField/MultiStringField.d.ts +12 -2
- package/dist/form/fields/NumberField/NumberField.d.ts +13 -2
- package/dist/form/fields/RadioField/RadioField.d.ts +13 -3
- package/dist/form/fields/ScanField/ScanField.d.ts +11 -2
- package/dist/form/fields/SelectField/SelectField.d.ts +13 -3
- package/dist/form/fields/StringField/StringField.d.ts +2 -0
- package/dist/form/fields/StringOrTextField/StringOrTextField.d.ts +9 -1
- package/dist/form/fields/TextField/TextField.d.ts +2 -0
- package/dist/form/fields/UploadField/UploadField.d.ts +9 -2
- package/dist/form/fields/constants.d.ts +0 -8
- package/dist/form/fields/hooks.d.ts +3 -3
- package/dist/form/fields/typings.d.ts +5 -3
- package/dist/form/fields/utils.d.ts +2 -2
- package/dist/form/renderer/context.d.ts +7 -0
- package/dist/forms.css +1 -0
- package/dist/forms.js +8857 -7060
- package/dist/forms.umd.cjs +24 -24
- package/package.json +5 -3
- package/dist/form/fields/CustomField/CustomField.d.ts +0 -23
- package/dist/form/fields/CustomField/FieldInputClonerField/FieldInputCloner.d.ts +0 -7
- package/dist/form/fields/CustomField/FieldInputClonerField/FieldInputClonerField.d.ts +0 -18
- package/dist/form/fields/CustomField/FieldInputClonerField/index.d.ts +0 -3
- package/dist/form/fields/CustomField/FieldInputClonerField/typings.d.ts +0 -4
- package/dist/form/fields/CustomField/index.d.ts +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { RiCheckboxCircleLine } from 'react-icons/ri';
|
|
3
|
-
import { BaseField, ChildFieldOptions } from '../BaseField';
|
|
3
|
+
import { BaseField, ChildFieldOptions, ConditionRenderProps } from '../BaseField';
|
|
4
4
|
import { ComponentProps, ISerializedField } from '../typings';
|
|
5
5
|
import { SerializedBooleanField } from './typings';
|
|
6
6
|
export declare const emptyBooleanField: {
|
|
@@ -9,14 +9,21 @@ export declare const emptyBooleanField: {
|
|
|
9
9
|
description: string;
|
|
10
10
|
required: boolean;
|
|
11
11
|
};
|
|
12
|
-
export declare class BooleanField extends BaseField<boolean,
|
|
12
|
+
export declare class BooleanField extends BaseField<"boolean", boolean, boolean, boolean> {
|
|
13
13
|
static readonly fieldTypeName = "Checkbox";
|
|
14
14
|
static readonly fieldTypeDescription = "Perfect for both optional and required yes/no questions.";
|
|
15
15
|
readonly onlyValidateAfterTouched = false;
|
|
16
16
|
static Icon: typeof RiCheckboxCircleLine;
|
|
17
|
+
readonly defaultConditionValue: boolean | undefined;
|
|
18
|
+
readonly defaultConditionModifier: keyof typeof this.modifiers;
|
|
19
|
+
readonly modifiers: {
|
|
20
|
+
equals: import('../../conditions/typings').FieldConditionModifierConfig<boolean, boolean, unknown, boolean, boolean, boolean>;
|
|
21
|
+
notEquals: import('../../conditions/typings').FieldConditionModifierConfig<boolean, boolean, unknown, boolean, boolean, boolean>;
|
|
22
|
+
};
|
|
17
23
|
constructor(options: ChildFieldOptions<boolean>);
|
|
18
24
|
protected isBlank(value: boolean | undefined): boolean;
|
|
19
25
|
serialize(): SerializedBooleanField;
|
|
20
26
|
static deserialize(data: ISerializedField): BooleanField;
|
|
21
27
|
getInput(props: ComponentProps<BooleanField>): ReactNode;
|
|
28
|
+
renderCondition(props: ConditionRenderProps<BooleanField>): ReactNode;
|
|
22
29
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { BaseField, ChildFieldOptions } from '../BaseField';
|
|
2
|
+
import { BaseField, ChildFieldOptions, ConditionRenderProps } from '../BaseField';
|
|
3
3
|
import { SelectFieldOption } from '../BaseSelectField';
|
|
4
4
|
import { MultiStringField } from '../MultiStringField';
|
|
5
5
|
import { GetInputProps, ISerializedField } from '../typings';
|
|
@@ -14,12 +14,21 @@ export declare const emptyCheckboxListField: {
|
|
|
14
14
|
export interface CheckboxListFieldConfig extends ChildFieldOptions<string[]> {
|
|
15
15
|
options: SelectFieldOption[];
|
|
16
16
|
}
|
|
17
|
-
export declare class CheckboxListField extends BaseField<string[],
|
|
17
|
+
export declare class CheckboxListField extends BaseField<"checkbox-list", string[], string[], string[]> {
|
|
18
18
|
readonly options: SelectFieldOption[];
|
|
19
19
|
readonly onlyValidateAfterTouched = false;
|
|
20
20
|
static readonly fieldTypeName = "Checkbox list";
|
|
21
21
|
static readonly fieldTypeDescription = "Allows the user to select a multiple options from a list.";
|
|
22
22
|
static Icon: import('react-icons').IconType;
|
|
23
|
+
readonly defaultConditionValue: string[] | undefined;
|
|
24
|
+
readonly defaultConditionModifier: keyof typeof this.modifiers;
|
|
25
|
+
readonly modifiers: {
|
|
26
|
+
equals: import('../../conditions/typings').FieldConditionModifierConfig<string[], string[], unknown, string[], string[], string[]>;
|
|
27
|
+
notEquals: import('../../conditions/typings').FieldConditionModifierConfig<string[], string[], unknown, string[], string[], string[]>;
|
|
28
|
+
every: import('../../conditions/typings').FieldConditionModifierConfig<string[], string[], unknown, string[], string[], string[]>;
|
|
29
|
+
some: import('../../conditions/typings').FieldConditionModifierConfig<string[], string[], unknown, string[], string[], string[]>;
|
|
30
|
+
none: import('../../conditions/typings').FieldConditionModifierConfig<string[], string[], unknown, string[], string[], string[]>;
|
|
31
|
+
};
|
|
23
32
|
constructor(config: CheckboxListFieldConfig);
|
|
24
33
|
serialize(): SerializedCheckboxListField;
|
|
25
34
|
static deserialize(data: ISerializedField): CheckboxListField;
|
|
@@ -28,4 +37,5 @@ export declare class CheckboxListField extends BaseField<string[], "checkbox-lis
|
|
|
28
37
|
showDirectly: boolean;
|
|
29
38
|
}[];
|
|
30
39
|
getInput(props: GetInputProps<this>): ReactNode;
|
|
40
|
+
renderCondition(props: ConditionRenderProps<CheckboxListField>): ReactNode;
|
|
31
41
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { RiCalendarLine } from 'react-icons/ri';
|
|
3
|
-
import { BaseField, ChildFieldOptions } from '../BaseField';
|
|
3
|
+
import { BaseField, ChildFieldOptions, ConditionRenderProps } from '../BaseField';
|
|
4
4
|
import { GetInputProps, ISerializedField } from '../typings';
|
|
5
5
|
import { SerializedDateField } from './typings';
|
|
6
6
|
export declare const emptyDateField: {
|
|
@@ -9,13 +9,22 @@ export declare const emptyDateField: {
|
|
|
9
9
|
description: string;
|
|
10
10
|
required: boolean;
|
|
11
11
|
};
|
|
12
|
-
export declare class DateField extends BaseField<
|
|
12
|
+
export declare class DateField extends BaseField<"date", Date, Date, string> {
|
|
13
13
|
static readonly fieldTypeName = "Date";
|
|
14
14
|
static readonly fieldTypeDescription = "Allows specifying a date.";
|
|
15
|
-
static Icon: typeof RiCalendarLine;
|
|
16
15
|
readonly onlyValidateAfterTouched = false;
|
|
17
|
-
|
|
16
|
+
static Icon: typeof RiCalendarLine;
|
|
17
|
+
readonly defaultConditionValue: Date | undefined;
|
|
18
|
+
readonly defaultConditionModifier: keyof typeof this.modifiers;
|
|
19
|
+
readonly modifiers: {
|
|
20
|
+
equals: import('../../conditions/typings').FieldConditionModifierConfig<Date, Date, unknown, Date, Date, string>;
|
|
21
|
+
notEquals: import('../../conditions/typings').FieldConditionModifierConfig<Date, Date, unknown, Date, Date, string>;
|
|
22
|
+
before: import('../../conditions/typings').FieldConditionModifierConfig<Date, Date, unknown, Date, Date, string>;
|
|
23
|
+
after: import('../../conditions/typings').FieldConditionModifierConfig<Date, Date, unknown, Date, Date, string>;
|
|
24
|
+
};
|
|
25
|
+
constructor(options: ChildFieldOptions<Date>);
|
|
18
26
|
serialize(): SerializedDateField;
|
|
19
27
|
static deserialize(data: ISerializedField): DateField;
|
|
20
28
|
getInput(props: GetInputProps<this>): ReactNode;
|
|
29
|
+
renderCondition(props: ConditionRenderProps<DateField>): ReactNode;
|
|
21
30
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { FormBuilderValues } from '../../builder';
|
|
3
|
+
import { AnyCondition, AnySerializedCondition } from '../../conditions/condition/typings';
|
|
3
4
|
import { FormValues } from '../../typings';
|
|
4
5
|
import { BaseFormElement, BaseSerializedObject } from '../BaseField';
|
|
5
|
-
import { BooleanField } from '../BooleanField';
|
|
6
6
|
import { AnyField, GetInputProps, ISerializedField } from '../typings';
|
|
7
|
-
import {
|
|
7
|
+
import { SerializedFieldSection } from './typings';
|
|
8
|
+
export type FieldSectionConditions = Record<string, AnySerializedCondition[]>;
|
|
8
9
|
interface FieldSectionOptions extends Omit<BaseSerializedObject, "type"> {
|
|
9
10
|
label?: string | null;
|
|
10
|
-
|
|
11
|
-
condition?: SerializedCondition | null;
|
|
11
|
+
conditions?: FieldSectionConditions;
|
|
12
12
|
fields: AnyField[];
|
|
13
13
|
}
|
|
14
14
|
export declare class FieldSection extends BaseFormElement<"section"> {
|
|
@@ -16,21 +16,16 @@ export declare class FieldSection extends BaseFormElement<"section"> {
|
|
|
16
16
|
static readonly fieldTypeDescription = "Sections can be useful for grouping fields together. They can also be conditionally shown or hidden.";
|
|
17
17
|
readonly label: string | null;
|
|
18
18
|
readonly fields: AnyField[];
|
|
19
|
-
readonly
|
|
19
|
+
readonly conditions: FieldSectionConditions;
|
|
20
20
|
constructor(options: FieldSectionOptions);
|
|
21
|
-
static getFieldCreationSchema(options: ISerializedField[], parentPath?: string): ({
|
|
22
|
-
field: BooleanField;
|
|
23
|
-
showDirectly: boolean;
|
|
24
|
-
} | {
|
|
25
|
-
field: FieldSection;
|
|
26
|
-
showDirectly: boolean;
|
|
27
|
-
})[];
|
|
28
21
|
static deserialize(data: ISerializedField): FieldSection;
|
|
29
22
|
conditional(): this is {
|
|
30
|
-
|
|
23
|
+
conditions: FieldSectionConditions;
|
|
31
24
|
};
|
|
32
25
|
serialize(): SerializedFieldSection;
|
|
33
26
|
getErrors(allValues: FormValues | FormBuilderValues): Record<string, string>;
|
|
34
27
|
getInput(props: GetInputProps<this>): ReactNode;
|
|
28
|
+
serializeConditions: (conditions: AnyCondition[]) => AnySerializedCondition[];
|
|
29
|
+
deserializeConditions: (conditions: AnySerializedCondition[]) => AnyCondition[];
|
|
35
30
|
}
|
|
36
31
|
export {};
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { BaseSerializedObject } from '../BaseField';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
identifier: string;
|
|
5
|
-
value: TValue;
|
|
6
|
-
}
|
|
2
|
+
import { ISerializedField } from '../typings';
|
|
3
|
+
import { FieldSectionConditions } from './FieldSection';
|
|
7
4
|
export interface SerializedFieldSection extends BaseSerializedObject {
|
|
8
5
|
label: string | null;
|
|
9
6
|
type: "section";
|
|
10
|
-
|
|
11
|
-
condition: SerializedCondition | null;
|
|
7
|
+
conditions: FieldSectionConditions;
|
|
12
8
|
fields: Exclude<ISerializedField, SerializedFieldSection>[];
|
|
13
9
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { RiCheckboxLine } from 'react-icons/ri';
|
|
3
|
-
import {
|
|
3
|
+
import { ConditionRenderProps } from '../BaseField';
|
|
4
|
+
import { BaseSelectField, BaseSelectFieldOptions } from '../BaseSelectField';
|
|
4
5
|
import { GetInputProps, ISerializedField } from '../typings';
|
|
5
6
|
import { SerializedMultiSelectField } from './typings';
|
|
6
7
|
/**
|
|
7
8
|
* The options passed to the constructor of MultiSelectField.
|
|
8
9
|
*/
|
|
9
|
-
export type MultiSelectFieldOptions = Omit<BaseSelectFieldOptions<
|
|
10
|
+
export type MultiSelectFieldOptions = Omit<BaseSelectFieldOptions<string[], "multi-select">, "type">;
|
|
10
11
|
export declare const emptyMultiSelectField: {
|
|
11
12
|
type: string;
|
|
12
13
|
options: never[];
|
|
@@ -14,14 +15,24 @@ export declare const emptyMultiSelectField: {
|
|
|
14
15
|
description: string;
|
|
15
16
|
required: boolean;
|
|
16
17
|
};
|
|
17
|
-
export declare class MultiSelectField extends BaseSelectField<
|
|
18
|
+
export declare class MultiSelectField extends BaseSelectField<"multi-select", string[], string[], string[]> {
|
|
18
19
|
static readonly fieldTypeName = "Multi-select";
|
|
19
20
|
static readonly fieldTypeDescription = "Allows the user to select a multiple options from a list of options.";
|
|
20
21
|
static Icon: typeof RiCheckboxLine;
|
|
22
|
+
readonly defaultConditionValue: string[] | undefined;
|
|
23
|
+
readonly defaultConditionModifier: keyof typeof this.modifiers;
|
|
24
|
+
readonly modifiers: {
|
|
25
|
+
equals: import('../../conditions/typings').FieldConditionModifierConfig<string[], string[], unknown, string[], string[], string[]>;
|
|
26
|
+
notEquals: import('../../conditions/typings').FieldConditionModifierConfig<string[], string[], unknown, string[], string[], string[]>;
|
|
27
|
+
every: import('../../conditions/typings').FieldConditionModifierConfig<string[], string[], unknown, string[], string[], string[]>;
|
|
28
|
+
some: import('../../conditions/typings').FieldConditionModifierConfig<string[], string[], unknown, string[], string[], string[]>;
|
|
29
|
+
none: import('../../conditions/typings').FieldConditionModifierConfig<string[], string[], unknown, string[], string[], string[]>;
|
|
30
|
+
};
|
|
21
31
|
constructor(options: MultiSelectFieldOptions);
|
|
22
|
-
protected isBlank(value:
|
|
23
|
-
isEqual(value1:
|
|
32
|
+
protected isBlank(value: string[] | undefined): boolean;
|
|
33
|
+
isEqual(value1: string[] | undefined, value2: string[] | undefined): boolean;
|
|
24
34
|
serialize(): SerializedMultiSelectField;
|
|
25
35
|
static deserialize(data: ISerializedField): MultiSelectField;
|
|
26
36
|
getInput(props: GetInputProps<this>): ReactNode;
|
|
37
|
+
renderCondition(props: ConditionRenderProps<MultiSelectField>): ReactNode;
|
|
27
38
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { RiListCheck } from 'react-icons/ri';
|
|
3
|
-
import { BaseField, ChildFieldOptions } from '../BaseField';
|
|
3
|
+
import { BaseField, ChildFieldOptions, ConditionRenderProps } from '../BaseField';
|
|
4
4
|
import { GetInputProps, InputFieldLevelValidator, ISerializedField } from '../typings';
|
|
5
5
|
import { SerializedMultiStringField } from './typings';
|
|
6
6
|
type MultiStringFieldOptions = ChildFieldOptions<string[]> & {
|
|
@@ -21,7 +21,7 @@ export declare const emptyMultiStringField: {
|
|
|
21
21
|
* - Specifying the options of a SelectField (used in `SelectField.getFieldCreationSchema`
|
|
22
22
|
* - Listing serial numbers and similar
|
|
23
23
|
*/
|
|
24
|
-
export declare class MultiStringField extends BaseField<string[],
|
|
24
|
+
export declare class MultiStringField extends BaseField<"multi-string", string[], string[], string[]> {
|
|
25
25
|
static readonly fieldTypeName = "Multi-string";
|
|
26
26
|
static readonly fieldTypeDescription = "Allows the user to provide multiple unique strings.";
|
|
27
27
|
readonly minLength: number;
|
|
@@ -29,6 +29,15 @@ export declare class MultiStringField extends BaseField<string[], "multi-string"
|
|
|
29
29
|
readonly onlyValidateAfterTouched = false;
|
|
30
30
|
readonly placeholder: string;
|
|
31
31
|
static Icon: typeof RiListCheck;
|
|
32
|
+
readonly defaultConditionValue: string[] | undefined;
|
|
33
|
+
readonly defaultConditionModifier: keyof typeof this.modifiers;
|
|
34
|
+
readonly modifiers: {
|
|
35
|
+
equals: import('../../conditions/typings').FieldConditionModifierConfig<string[], string[], unknown, string[], string[], string[]>;
|
|
36
|
+
notEquals: import('../../conditions/typings').FieldConditionModifierConfig<string[], string[], unknown, string[], string[], string[]>;
|
|
37
|
+
every: import('../../conditions/typings').FieldConditionModifierConfig<string[], string[], unknown, string[], string[], string[]>;
|
|
38
|
+
some: import('../../conditions/typings').FieldConditionModifierConfig<string[], string[], unknown, string[], string[], string[]>;
|
|
39
|
+
none: import('../../conditions/typings').FieldConditionModifierConfig<string[], string[], unknown, string[], string[], string[]>;
|
|
40
|
+
};
|
|
32
41
|
constructor(options: MultiStringFieldOptions);
|
|
33
42
|
getInput(props: GetInputProps<this>): ReactNode;
|
|
34
43
|
serialize(): SerializedMultiStringField;
|
|
@@ -36,5 +45,6 @@ export declare class MultiStringField extends BaseField<string[], "multi-string"
|
|
|
36
45
|
isEqual(value1: string[] | undefined, value2: string[] | undefined): boolean;
|
|
37
46
|
getFieldValidators(): InputFieldLevelValidator<string[]>[];
|
|
38
47
|
static deserialize(data: ISerializedField): MultiStringField;
|
|
48
|
+
renderCondition(props: ConditionRenderProps<MultiStringField>): ReactNode;
|
|
39
49
|
}
|
|
40
50
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { RiHashtag } from 'react-icons/ri';
|
|
3
|
-
import { BaseField, ChildFieldOptions } from '../BaseField';
|
|
3
|
+
import { BaseField, ChildFieldOptions, ConditionRenderProps } from '../BaseField';
|
|
4
4
|
import { BooleanField } from '../BooleanField';
|
|
5
5
|
import { GetInputProps, InputFieldLevelValidator, InputValidator, ISerializedField } from '../typings';
|
|
6
6
|
import { SerializedNumberField } from './typings';
|
|
@@ -19,7 +19,7 @@ export interface NumberFieldOptions extends ChildFieldOptions<number> {
|
|
|
19
19
|
integers?: boolean;
|
|
20
20
|
placeholder?: string;
|
|
21
21
|
}
|
|
22
|
-
export declare class NumberField extends BaseField<number,
|
|
22
|
+
export declare class NumberField extends BaseField<"number", number, number, number> {
|
|
23
23
|
static readonly fieldTypeName = "Number";
|
|
24
24
|
static readonly fieldTypeDescription = "Allows specifying a number within a given range.";
|
|
25
25
|
readonly minimum: number | undefined;
|
|
@@ -27,6 +27,16 @@ export declare class NumberField extends BaseField<number, "number"> {
|
|
|
27
27
|
readonly integers: boolean;
|
|
28
28
|
readonly placeholder: string;
|
|
29
29
|
static Icon: typeof RiHashtag;
|
|
30
|
+
readonly defaultConditionValue: number | undefined;
|
|
31
|
+
readonly defaultConditionModifier: keyof typeof this.modifiers;
|
|
32
|
+
readonly modifiers: {
|
|
33
|
+
equals: import('../../conditions/typings').FieldConditionModifierConfig<number, number, unknown, number, number, number>;
|
|
34
|
+
notEquals: import('../../conditions/typings').FieldConditionModifierConfig<number, number, unknown, number, number, number>;
|
|
35
|
+
lessThan: import('../../conditions/typings').FieldConditionModifierConfig<number, number, unknown, number, number, number>;
|
|
36
|
+
lessThanOrEquals: import('../../conditions/typings').FieldConditionModifierConfig<number, number, unknown, number, number, number>;
|
|
37
|
+
greaterThan: import('../../conditions/typings').FieldConditionModifierConfig<number, number, unknown, number, number, number>;
|
|
38
|
+
greaterThanOrEquals: import('../../conditions/typings').FieldConditionModifierConfig<number, number, unknown, number, number, number>;
|
|
39
|
+
};
|
|
30
40
|
constructor(options: NumberFieldOptions);
|
|
31
41
|
static _validateMin: (path: string) => InputValidator<number>;
|
|
32
42
|
static _validateMax: (path: string) => InputValidator<number>;
|
|
@@ -41,4 +51,5 @@ export declare class NumberField extends BaseField<number, "number"> {
|
|
|
41
51
|
serialize(): SerializedNumberField;
|
|
42
52
|
static deserialize(data: ISerializedField): NumberField;
|
|
43
53
|
getInput(props: GetInputProps<this>): ReactNode;
|
|
54
|
+
renderCondition(props: ConditionRenderProps<NumberField>): ReactNode;
|
|
44
55
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { RiRadioButtonFill } from 'react-icons/ri';
|
|
2
|
-
import { BaseField, ChildFieldOptions } from '../BaseField';
|
|
3
|
+
import { BaseField, ChildFieldOptions, ConditionRenderProps } from '../BaseField';
|
|
3
4
|
import { SelectFieldOption } from '../BaseSelectField';
|
|
4
5
|
import { MultiStringField } from '../MultiStringField';
|
|
5
6
|
import { GetInputProps, ISerializedField } from '../typings';
|
|
@@ -14,12 +15,20 @@ export declare const emptyRadioField: {
|
|
|
14
15
|
export interface RadioFieldConfig extends ChildFieldOptions<string> {
|
|
15
16
|
options: SelectFieldOption[];
|
|
16
17
|
}
|
|
17
|
-
export declare class RadioField extends BaseField<string,
|
|
18
|
+
export declare class RadioField extends BaseField<"radio", string, string | string[], string | string[]> {
|
|
18
19
|
readonly options: SelectFieldOption[];
|
|
19
20
|
readonly onlyValidateAfterTouched = false;
|
|
20
21
|
static readonly fieldTypeName = "Option list";
|
|
21
22
|
static readonly fieldTypeDescription = "Allows the user to select a single option from a list of options.";
|
|
22
23
|
static Icon: typeof RiRadioButtonFill;
|
|
24
|
+
readonly defaultConditionValue: string[] | undefined;
|
|
25
|
+
readonly defaultConditionModifier: keyof typeof this.modifiers;
|
|
26
|
+
readonly modifiers: {
|
|
27
|
+
equals: import('../../conditions/typings').FieldConditionModifierConfig<string, string | string[], unknown, string, string, string>;
|
|
28
|
+
notEquals: import('../../conditions/typings').FieldConditionModifierConfig<string, string | string[], unknown, string, string, string>;
|
|
29
|
+
includes: import('../../conditions/typings').FieldConditionModifierConfig<string, string | string[], unknown, string, string[], string[]>;
|
|
30
|
+
excludes: import('../../conditions/typings').FieldConditionModifierConfig<string, string | string[], unknown, string, string[], string[]>;
|
|
31
|
+
};
|
|
23
32
|
constructor(config: RadioFieldConfig);
|
|
24
33
|
serialize(): SerializedRadioField;
|
|
25
34
|
static deserialize(data: ISerializedField): RadioField;
|
|
@@ -27,5 +36,6 @@ export declare class RadioField extends BaseField<string, "radio"> {
|
|
|
27
36
|
field: MultiStringField;
|
|
28
37
|
showDirectly: boolean;
|
|
29
38
|
}[];
|
|
30
|
-
getInput(props: GetInputProps<this>):
|
|
39
|
+
getInput(props: GetInputProps<this>): ReactNode;
|
|
40
|
+
renderCondition(props: ConditionRenderProps<RadioField>): ReactNode;
|
|
31
41
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { RiFullscreenLine } from 'react-icons/ri';
|
|
3
|
-
import { BaseField, ChildFieldOptions } from '../BaseField';
|
|
3
|
+
import { BaseField, ChildFieldOptions, ConditionRenderProps } from '../BaseField';
|
|
4
4
|
import { ComponentProps, ISerializedField } from '../typings';
|
|
5
5
|
import { SerializedScanField } from './typings';
|
|
6
6
|
export declare const emptyScanField: {
|
|
@@ -9,13 +9,22 @@ export declare const emptyScanField: {
|
|
|
9
9
|
description: string;
|
|
10
10
|
required: boolean;
|
|
11
11
|
};
|
|
12
|
-
export declare class ScanField extends BaseField<string,
|
|
12
|
+
export declare class ScanField extends BaseField<"qr", string, string, string> {
|
|
13
13
|
static readonly fieldTypeName = "Scan";
|
|
14
14
|
static readonly fieldTypeDescription = "Used for scanning/reading QR and barcodes.";
|
|
15
15
|
readonly onlyValidateAfterTouched = false;
|
|
16
16
|
static Icon: typeof RiFullscreenLine;
|
|
17
|
+
readonly defaultConditionValue: string | undefined;
|
|
18
|
+
readonly defaultConditionModifier: keyof typeof this.modifiers;
|
|
19
|
+
readonly modifiers: {
|
|
20
|
+
equals: import('../../conditions/typings').FieldConditionModifierConfig<string, string, unknown, string, string, string>;
|
|
21
|
+
notEquals: import('../../conditions/typings').FieldConditionModifierConfig<string, string, unknown, string, string, string>;
|
|
22
|
+
includes: import('../../conditions/typings').FieldConditionModifierConfig<string, string, unknown, string, string, string>;
|
|
23
|
+
excludes: import('../../conditions/typings').FieldConditionModifierConfig<string, string, unknown, string, string, string>;
|
|
24
|
+
};
|
|
17
25
|
constructor(options: ChildFieldOptions<string>);
|
|
18
26
|
serialize(): SerializedScanField;
|
|
19
27
|
static deserialize(data: ISerializedField): ScanField;
|
|
20
28
|
getInput(props: ComponentProps<ScanField>): ReactNode;
|
|
29
|
+
renderCondition(props: ConditionRenderProps<ScanField>): ReactNode;
|
|
21
30
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { RiMenuFoldLine } from 'react-icons/ri';
|
|
3
|
-
import {
|
|
3
|
+
import { ConditionRenderProps } from '../BaseField';
|
|
4
|
+
import { BaseSelectField, BaseSelectFieldOptions } from '../BaseSelectField';
|
|
4
5
|
import { GetInputProps, ISerializedField } from '../typings';
|
|
5
6
|
import { SerializedSelectField } from './typings';
|
|
6
7
|
/**
|
|
7
8
|
* The options passed to the constructor of SelectField.
|
|
8
9
|
*/
|
|
9
|
-
export type SelectFieldOptions = Omit<BaseSelectFieldOptions<
|
|
10
|
+
export type SelectFieldOptions = Omit<BaseSelectFieldOptions<string, "select">, "type">;
|
|
10
11
|
export declare const emptySelectField: {
|
|
11
12
|
type: string;
|
|
12
13
|
options: never[];
|
|
@@ -14,12 +15,21 @@ export declare const emptySelectField: {
|
|
|
14
15
|
description: string;
|
|
15
16
|
required: boolean;
|
|
16
17
|
};
|
|
17
|
-
export declare class SelectField extends BaseSelectField<
|
|
18
|
+
export declare class SelectField extends BaseSelectField<"select", string, string | string[], string | string[]> {
|
|
18
19
|
static readonly fieldTypeName = "Dropdown";
|
|
19
20
|
static readonly fieldTypeDescription = "Allows the user to select a single option from a list of options.";
|
|
20
21
|
static Icon: typeof RiMenuFoldLine;
|
|
22
|
+
readonly defaultConditionValue: string | string[] | undefined;
|
|
23
|
+
readonly defaultConditionModifier: keyof typeof this.modifiers;
|
|
24
|
+
readonly modifiers: {
|
|
25
|
+
equals: import('../../conditions/typings').FieldConditionModifierConfig<string, string | string[], unknown, string, string, string>;
|
|
26
|
+
notEquals: import('../../conditions/typings').FieldConditionModifierConfig<string, string | string[], unknown, string, string, string>;
|
|
27
|
+
includes: import('../../conditions/typings').FieldConditionModifierConfig<string, string | string[], unknown, string, string[], string[]>;
|
|
28
|
+
excludes: import('../../conditions/typings').FieldConditionModifierConfig<string, string | string[], unknown, string, string[], string[]>;
|
|
29
|
+
};
|
|
21
30
|
constructor(options: SelectFieldOptions);
|
|
22
31
|
serialize(): SerializedSelectField;
|
|
23
32
|
static deserialize(data: ISerializedField): SelectField;
|
|
24
33
|
getInput(props: GetInputProps<this>): ReactNode;
|
|
34
|
+
renderCondition(props: ConditionRenderProps<SelectField>): ReactNode;
|
|
25
35
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { RiInputField } from 'react-icons/ri';
|
|
3
|
+
import { ConditionRenderProps } from '../BaseField';
|
|
3
4
|
import { StringOrTextField, StringOrTextFieldOptions } from '../StringOrTextField';
|
|
4
5
|
import { GetInputProps, ISerializedField } from '../typings';
|
|
5
6
|
import { SerializedStringField, StringInputType } from './typings';
|
|
@@ -23,4 +24,5 @@ export declare class StringField extends StringOrTextField<"string"> {
|
|
|
23
24
|
serialize(): SerializedStringField;
|
|
24
25
|
static deserialize(data: ISerializedField): StringField;
|
|
25
26
|
getInput(props: GetInputProps<this>): ReactNode;
|
|
27
|
+
renderCondition(props: ConditionRenderProps<StringField>): ReactNode;
|
|
26
28
|
}
|
|
@@ -10,10 +10,18 @@ export interface StringOrTextFieldOptions extends FieldOptions<string> {
|
|
|
10
10
|
export type SerializedStringOrTextField<TIdentifier extends "string" | "text"> = Omit<BaseSerializedStringField, "type"> & {
|
|
11
11
|
type: TIdentifier;
|
|
12
12
|
};
|
|
13
|
-
export declare abstract class StringOrTextField<TIdentifier extends "string" | "text"> extends BaseField<string,
|
|
13
|
+
export declare abstract class StringOrTextField<TIdentifier extends "string" | "text"> extends BaseField<TIdentifier, string, string, string> {
|
|
14
14
|
readonly minLength?: number;
|
|
15
15
|
readonly maxLength: number;
|
|
16
16
|
readonly placeholder: string;
|
|
17
|
+
readonly defaultConditionValue: string | undefined;
|
|
18
|
+
readonly defaultConditionModifier: keyof typeof this.modifiers;
|
|
19
|
+
readonly modifiers: {
|
|
20
|
+
equals: import('../../conditions/typings').FieldConditionModifierConfig<string, string, unknown, string, string, string>;
|
|
21
|
+
notEquals: import('../../conditions/typings').FieldConditionModifierConfig<string, string, unknown, string, string, string>;
|
|
22
|
+
includes: import('../../conditions/typings').FieldConditionModifierConfig<string, string, unknown, string, string, string>;
|
|
23
|
+
excludes: import('../../conditions/typings').FieldConditionModifierConfig<string, string, unknown, string, string, string>;
|
|
24
|
+
};
|
|
17
25
|
protected constructor(options: StringOrTextFieldOptions);
|
|
18
26
|
/**
|
|
19
27
|
* This function returns a function that validates that the value given for "minimum length" (when creating a new field) is less than or
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { RiAlignJustify } from 'react-icons/ri';
|
|
3
|
+
import { ConditionRenderProps } from '../BaseField';
|
|
3
4
|
import { StringOrTextField, StringOrTextFieldOptions } from '../StringOrTextField';
|
|
4
5
|
import { GetInputProps, ISerializedField } from '../typings';
|
|
5
6
|
import { SerializedTextField } from './typings';
|
|
@@ -19,4 +20,5 @@ export declare class TextField extends StringOrTextField<"text"> {
|
|
|
19
20
|
serialize(): SerializedTextField;
|
|
20
21
|
static deserialize(data: ISerializedField): TextField;
|
|
21
22
|
getInput(props: GetInputProps<this>): ReactNode;
|
|
23
|
+
renderCondition(props: ConditionRenderProps<TextField>): ReactNode;
|
|
22
24
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { RiUpload2Line } from 'react-icons/ri';
|
|
3
|
-
import { BaseField, ChildFieldOptions } from '../BaseField';
|
|
3
|
+
import { BaseField, ChildFieldOptions, ConditionRenderProps } from '../BaseField';
|
|
4
4
|
import { MultiSelectField } from '../MultiSelectField';
|
|
5
5
|
import { NumberField } from '../NumberField';
|
|
6
6
|
import { GetInputProps, InputFieldLevelValidator, ISerializedField } from '../typings';
|
|
@@ -19,7 +19,7 @@ export declare const emptyUploadField: {
|
|
|
19
19
|
description: string;
|
|
20
20
|
required: boolean;
|
|
21
21
|
};
|
|
22
|
-
export declare class UploadField extends BaseField<File[],
|
|
22
|
+
export declare class UploadField extends BaseField<"upload", File[], boolean, boolean> {
|
|
23
23
|
static readonly fieldTypeName = "Upload";
|
|
24
24
|
static readonly fieldTypeDescription = "Allows a file to be uploaded.";
|
|
25
25
|
readonly extensions?: string[];
|
|
@@ -27,6 +27,12 @@ export declare class UploadField extends BaseField<File[], "upload"> {
|
|
|
27
27
|
readonly maxFiles: number;
|
|
28
28
|
readonly onlyValidateAfterTouched = false;
|
|
29
29
|
static Icon: typeof RiUpload2Line;
|
|
30
|
+
readonly defaultConditionValue: boolean | undefined;
|
|
31
|
+
readonly defaultConditionModifier: keyof typeof this.modifiers;
|
|
32
|
+
readonly modifiers: {
|
|
33
|
+
equals: import('../../conditions/typings').FieldConditionModifierConfig<File[], boolean, unknown, File[], boolean, boolean>;
|
|
34
|
+
notEquals: import('../../conditions/typings').FieldConditionModifierConfig<File[], boolean, unknown, File[], boolean, boolean>;
|
|
35
|
+
};
|
|
30
36
|
constructor(options: UploadFieldOptions);
|
|
31
37
|
protected isBlank(value: File[] | undefined): boolean;
|
|
32
38
|
isEqual(value1: File[] | undefined, value2: File[] | undefined): boolean;
|
|
@@ -41,4 +47,5 @@ export declare class UploadField extends BaseField<File[], "upload"> {
|
|
|
41
47
|
serialize(): SerializedUploadField;
|
|
42
48
|
static deserialize(data: ISerializedField): UploadField;
|
|
43
49
|
getInput(props: GetInputProps<this>): ReactNode;
|
|
50
|
+
renderCondition(props: ConditionRenderProps<UploadField>): ReactNode;
|
|
44
51
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { BooleanField } from './BooleanField';
|
|
2
2
|
import { CheckboxListField } from './CheckboxListField';
|
|
3
|
-
import { CustomField } from './CustomField';
|
|
4
3
|
import { DateField } from './DateField';
|
|
5
4
|
import { MultiSelectField } from './MultiSelectField';
|
|
6
5
|
import { MultiStringField } from './MultiStringField';
|
|
@@ -19,7 +18,6 @@ export declare const FieldTypeToClsMapping: {
|
|
|
19
18
|
readonly select: typeof SelectField;
|
|
20
19
|
readonly string: typeof StringField;
|
|
21
20
|
readonly text: typeof TextField;
|
|
22
|
-
readonly custom: typeof CustomField;
|
|
23
21
|
readonly upload: typeof UploadField;
|
|
24
22
|
readonly qr: typeof ScanField;
|
|
25
23
|
readonly "multi-string": typeof MultiStringField;
|
|
@@ -71,12 +69,6 @@ export declare const FieldTypeToEmptyFieldMapping: {
|
|
|
71
69
|
description: string;
|
|
72
70
|
required: boolean;
|
|
73
71
|
};
|
|
74
|
-
readonly custom: {
|
|
75
|
-
type: string;
|
|
76
|
-
label: string;
|
|
77
|
-
description: string;
|
|
78
|
-
required: boolean;
|
|
79
|
-
};
|
|
80
72
|
readonly upload: {
|
|
81
73
|
type: string;
|
|
82
74
|
extensions: never[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { BaseFormElement } from './BaseField';
|
|
3
|
+
import { AnyField, GetInputProps } from './typings';
|
|
4
4
|
export declare const useFieldInput: <TField extends BaseFormElement | null>(field: TField, props: TField extends BaseFormElement ? GetInputProps<TField> : null) => ReactNode;
|
|
5
|
-
export declare const useFieldInputs: (fields: BaseFormElement[], props: GetInputProps<
|
|
5
|
+
export declare const useFieldInputs: (fields: BaseFormElement[], props: GetInputProps<AnyField>) => ReactNode;
|
|
@@ -16,9 +16,11 @@ import { SerializedSelectField } from './SelectField';
|
|
|
16
16
|
import { SerializedStringField } from './StringField';
|
|
17
17
|
import { SerializedTextField } from './TextField';
|
|
18
18
|
import { SerializedUploadField } from './UploadField';
|
|
19
|
-
export type FieldTypeIdentifier = "string" | "text" | "boolean" | "number" | "date" | "select" | "
|
|
19
|
+
export type FieldTypeIdentifier = "string" | "text" | "boolean" | "number" | "date" | "select" | "section" | "multi-string" | "multi-select" | "upload" | "qr" | "radio" | "checkbox-list";
|
|
20
20
|
export type FieldValue = string | number | boolean | string[] | File[] | Date | null;
|
|
21
|
-
export type ValueOfField<
|
|
21
|
+
export type ValueOfField<TField extends AnyField> = TField extends BaseField<infer _TIdentifier, infer TValue, infer _TConditionValue, infer _TSerializedConditionValue> ? TValue : never;
|
|
22
|
+
export type ConditionValueOfField<TField extends AnyField> = TField extends BaseField<infer _TIdentifier, infer _TValue, infer TConditionValue, infer _TSerializedConditionValue> ? TConditionValue : never;
|
|
23
|
+
export type SerializedConditionValueOfField<TField extends AnyField> = TField extends BaseField<infer _TIdentifier, infer _TValue, infer _TConditionValue, infer TSerializedConditionValue> ? TSerializedConditionValue : never;
|
|
22
24
|
export type InputFieldLevelValidator<TValue> = (value: TValue | undefined) => string | null | undefined;
|
|
23
25
|
export type InputFormLevelValidator<TValue> = (value: TValue | undefined, allValues: FormValues | FormBuilderValues) => string | null | undefined;
|
|
24
26
|
export type InputValidator<TValue> = InputFieldLevelValidator<TValue> | InputFormLevelValidator<TValue>;
|
|
@@ -30,6 +32,6 @@ export interface ComponentProps<TField extends BaseFormElement> extends Omit<HTM
|
|
|
30
32
|
showInputOnly?: boolean;
|
|
31
33
|
}
|
|
32
34
|
export type GetInputProps<TField extends BaseFormElement> = Omit<ComponentProps<TField>, "field">;
|
|
33
|
-
export type AnyField = BaseField<any, any>;
|
|
35
|
+
export type AnyField = BaseField<any, any, any, any>;
|
|
34
36
|
export type ISerializedField = SerializedTextField | SerializedBooleanField | SerializedNumberField | SerializedDateField | SerializedStringField | SerializedSelectField | SerializedFieldSection | SerializedMultiStringField | SerializedMultiSelectField | SerializedUploadField | SerializedScanField | SerializedRadioField | SerializedCheckboxListField;
|
|
35
37
|
export type ISerializedOnlyField = Exclude<ISerializedField, SerializedFieldSection>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseFormElement } from './BaseField';
|
|
2
|
-
import { FieldSection
|
|
2
|
+
import { FieldSection } from './FieldSection';
|
|
3
3
|
import { AnyField, FieldValue, ISerializedField, ISerializedOnlyField } from './typings';
|
|
4
4
|
/** Deserializes anything but a FieldSection.
|
|
5
5
|
* @see `deserialize` for most use cases
|
|
@@ -8,9 +8,9 @@ export declare const deserializeField: (serializedField: ISerializedOnlyField) =
|
|
|
8
8
|
/** Deserializes anything */
|
|
9
9
|
export declare const deserialize: (serialized: ISerializedField) => AnyField | FieldSection;
|
|
10
10
|
export declare function deserializeFields(fields: ISerializedField[]): (AnyField | FieldSection)[];
|
|
11
|
+
export declare function deserializeOnlyFields(fields: ISerializedOnlyField[]): AnyField[];
|
|
11
12
|
export declare function flattenFields(fields: BaseFormElement[]): AnyField[];
|
|
12
13
|
export declare function getFieldsMapping(fields: BaseFormElement[]): Record<string, AnyField>;
|
|
13
14
|
export declare function decodeFieldValues(fields: BaseFormElement[], values: Record<string, string>): Record<string, FieldValue>;
|
|
14
15
|
export declare function encodeFieldValues(fields: BaseFormElement[], values: Record<string, FieldValue>): Record<string, string>;
|
|
15
16
|
export declare function valueIsFile(v: FieldValue | Promise<File>[] | undefined): v is File[] | Promise<File>[];
|
|
16
|
-
export declare function isConditionMet<TValue extends FieldValue | Promise<File>[]>(condition: TValue extends FieldValue ? SerializedCondition<TValue> | null : null, value: TValue | undefined): boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseFormElement } from '../fields';
|
|
2
|
+
interface RendererContextValue {
|
|
3
|
+
fields: BaseFormElement[];
|
|
4
|
+
}
|
|
5
|
+
export declare const RendererProvider: import('react').Provider<RendererContextValue | null>;
|
|
6
|
+
export declare const useRendererContext: () => RendererContextValue | null;
|
|
7
|
+
export {};
|
package/dist/forms.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[data-floating-content]{z-index:3500!important}.react-flow__controls{background-color:var(--color-panel);border:1px solid var(--base-a6);box-shadow:0 1px 2px #0000000d}.react-flow__controls button{background:transparent;color:var(--base-a11);border:1px solid var(--base-a6)}.react-flow__controls button:hover,.react-flow__controls button:focus-visible{background-color:var(--base-a3);color:var(--base-a12);border-color:var(--base-a8)}.react-flow__minimap{background-color:var(--color-panel);border:1px solid var(--base-a6)}.react-flow__attribution{display:none}.react-flow__handle{background-color:var(--base-a8);border:1px solid var(--base-a6);width:10px;height:10px}.react-flow__handle:hover,.react-flow__handle:focus-visible{background-color:var(--base-a10);border-color:var(--base-a8)}.react-flow__handle-connecting{background-color:var(--base-a11);border-color:var(--base-a10)}.react-flow__handle-valid{background-color:var(--base-a9);border-color:var(--base-a9)}.react-flow__edge-path{stroke:var(--base-a8)}.react-flow__edge.selected .react-flow__edge-path{stroke:var(--base-a11);stroke-width:2.5}.react-flow__edge.animated .react-flow__edge-path{stroke:var(--base-a10)}.react-flow__selection,.react-flow__selection-rect,.react-flow__nodesselection-rect{fill:var(--base-a3)!important;stroke:var(--base-a8)!important}[data-selected=true]{box-shadow:0 0 0 2px var(--base-a8)}
|