@overmap-ai/forms 1.0.32-condition-manager.3 → 1.0.32-icon-fix.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/hooks.d.ts +1 -1
- package/dist/form/builder/utils.d.ts +2 -2
- package/dist/form/conditions/BaseCondition/BaseCondition.d.ts +2 -4
- package/dist/form/conditions/BaseCondition/typings.d.ts +2 -2
- package/dist/form/conditions/BooleanFieldCondition/BooleanFieldCondition.d.ts +2 -4
- package/dist/form/conditions/CheckboxListFieldCondition/CheckboxListFieldCondition.d.ts +2 -4
- package/dist/form/conditions/DateFieldCondition/DateFieldCondition.d.ts +2 -4
- package/dist/form/conditions/MultiSelectFieldCondition/MultiSelectFieldCondition.d.ts +2 -12
- package/dist/form/conditions/MultiStringFieldCondition/MultiStringFieldCondition.d.ts +2 -4
- package/dist/form/conditions/NumberFieldCondition/NumberFieldCondition.d.ts +2 -15
- package/dist/form/conditions/OTPFieldCondition/OTPFieldCondition.d.ts +2 -4
- package/dist/form/conditions/PassFailFieldCondition/PassFailFieldCondition.d.ts +2 -4
- package/dist/form/conditions/RadioFieldCondition/RadioFieldCondition.d.ts +2 -4
- package/dist/form/conditions/RatingFieldCondition/RatingFieldCondition.d.ts +21 -0
- package/dist/form/conditions/RatingFieldCondition/RatingFieldConditionCell.d.ts +6 -0
- package/dist/form/conditions/RatingFieldCondition/index.d.ts +3 -0
- package/dist/form/conditions/RatingFieldCondition/typings.d.ts +4 -0
- package/dist/form/conditions/ScanFieldCondition/ScanFieldCondition.d.ts +2 -4
- package/dist/form/conditions/SelectFieldCondition/SelectFieldCondition.d.ts +2 -4
- package/dist/form/conditions/StringFieldCondition/StringFieldCondition.d.ts +2 -4
- package/dist/form/conditions/TextFieldCondition/TextFieldCondition.d.ts +2 -4
- package/dist/form/conditions/UploadFieldCondition/UploadFieldCondition.d.ts +2 -4
- package/dist/form/conditions/constants.d.ts +32 -0
- package/dist/form/conditions/index.d.ts +1 -0
- package/dist/form/conditions/typings.d.ts +4 -2
- package/dist/form/fields/BaseField/BaseField.d.ts +5 -6
- package/dist/form/fields/BaseField/typings.d.ts +3 -4
- package/dist/form/fields/BaseFormElement/BaseFormElement.d.ts +9 -9
- package/dist/form/fields/BaseFormElement/typings.d.ts +3 -3
- package/dist/form/fields/BaseOptionsField/BaseOptionsField.d.ts +6 -6
- package/dist/form/fields/BaseOptionsField/typings.d.ts +2 -2
- package/dist/form/fields/BaseStringField/BaseStringField.d.ts +3 -3
- package/dist/form/fields/BaseStringField/typings.d.ts +1 -1
- package/dist/form/fields/BooleanField/BooleanField.d.ts +2 -3
- package/dist/form/fields/CheckboxListField/CheckboxListField.d.ts +1 -1
- package/dist/form/fields/DateField/DateField.d.ts +1 -1
- package/dist/form/fields/FieldSection/FieldSection.d.ts +2 -2
- package/dist/form/fields/FieldSection/typings.d.ts +2 -2
- package/dist/form/fields/MultiSelectField/MultiSelectField.d.ts +1 -1
- package/dist/form/fields/MultiStringField/MultiStringField.d.ts +1 -1
- package/dist/form/fields/NumberField/NumberField.d.ts +1 -1
- package/dist/form/fields/OneTimePasswordField/OTPField.d.ts +1 -1
- package/dist/form/fields/PassFailField/PassFailField.d.ts +1 -1
- package/dist/form/fields/PassFailField/constants.d.ts +2 -2
- package/dist/form/fields/RadioField/RadioField.d.ts +1 -1
- package/dist/form/fields/RatingField/RatingField.d.ts +32 -0
- package/dist/form/fields/RatingField/RatingInput.d.ts +7 -0
- package/dist/form/fields/RatingField/index.d.ts +3 -0
- package/dist/form/fields/RatingField/typings.d.ts +4 -0
- package/dist/form/fields/ScanField/ScanField.d.ts +1 -1
- package/dist/form/fields/SelectField/SelectField.d.ts +1 -1
- package/dist/form/fields/UploadField/UploadField.d.ts +1 -1
- package/dist/form/fields/constants.d.ts +4 -2
- package/dist/form/fields/index.d.ts +1 -0
- package/dist/form/fields/typings.d.ts +10 -9
- package/dist/forms.js +1042 -234
- package/dist/forms.umd.cjs +1040 -232
- package/package.json +3 -5
|
@@ -2,6 +2,6 @@ import { FieldType } from '../fields';
|
|
|
2
2
|
export declare const useFieldTypeItems: (onSelect?: (type: Exclude<FieldType, "section">) => void) => {
|
|
3
3
|
children: string;
|
|
4
4
|
icon: import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
value: "string" | "number" | "boolean" | "select" | "text" | "radio" | "date" | "
|
|
5
|
+
value: "string" | "number" | "boolean" | "select" | "text" | "radio" | "date" | "checkbox-list" | "pass-fail" | "multi-select" | "multi-string" | "rating" | "qr" | "upload" | "otp";
|
|
6
6
|
onSelect: () => void;
|
|
7
7
|
}[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BooleanFieldCondition, CheckboxListFieldCondition, DateFieldCondition, MultiSelectFieldCondition, MultiStringFieldCondition, NumberFieldCondition, OTPFieldCondition, PassFailFieldCondition, RadioFieldCondition, ScanFieldCondition, SelectFieldCondition, StringFieldCondition, TextFieldCondition, UploadFieldCondition } from '../conditions';
|
|
1
|
+
import { BooleanFieldCondition, CheckboxListFieldCondition, DateFieldCondition, MultiSelectFieldCondition, MultiStringFieldCondition, NumberFieldCondition, OTPFieldCondition, PassFailFieldCondition, RadioFieldCondition, RatingFieldCondition, ScanFieldCondition, SelectFieldCondition, StringFieldCondition, TextFieldCondition, UploadFieldCondition } from '../conditions';
|
|
2
2
|
import { Field, FieldCreationSchemaObject, FieldType } from '../fields';
|
|
3
3
|
export declare const createField: (type: Exclude<FieldType, "section">) => Field;
|
|
4
|
-
export declare const createCondition: (field: Field) => BooleanFieldCondition | CheckboxListFieldCondition | DateFieldCondition | MultiSelectFieldCondition | MultiStringFieldCondition | NumberFieldCondition | OTPFieldCondition | PassFailFieldCondition | RadioFieldCondition | ScanFieldCondition | SelectFieldCondition | StringFieldCondition | TextFieldCondition | UploadFieldCondition;
|
|
4
|
+
export declare const createCondition: (field: Field) => BooleanFieldCondition | CheckboxListFieldCondition | DateFieldCondition | MultiSelectFieldCondition | MultiStringFieldCondition | NumberFieldCondition | OTPFieldCondition | PassFailFieldCondition | RadioFieldCondition | RatingFieldCondition | ScanFieldCondition | SelectFieldCondition | StringFieldCondition | TextFieldCondition | UploadFieldCondition;
|
|
5
5
|
export declare const getFieldCreationSchema: (type: FieldType, path: string) => FieldCreationSchemaObject[] | undefined;
|
|
@@ -3,7 +3,7 @@ import { AnyField, TypeOfField, ValueOfField } from '../../fields';
|
|
|
3
3
|
import { AnyConditionModifierConfig } from '../../modifiers';
|
|
4
4
|
import { Observable } from '../../Observable';
|
|
5
5
|
import { BaseSerializedCondition, ConditionRenderProps } from './typings';
|
|
6
|
-
export interface
|
|
6
|
+
export interface BaseConditionOptions<TField, TConditionValue, TModifiers extends string> {
|
|
7
7
|
id: string;
|
|
8
8
|
field: TField;
|
|
9
9
|
conditionValue: TConditionValue | undefined;
|
|
@@ -14,10 +14,8 @@ export declare abstract class BaseCondition<TField extends AnyField, TValue, TCo
|
|
|
14
14
|
conditionValue: TConditionValue | undefined;
|
|
15
15
|
conditionModifier: TModifiers;
|
|
16
16
|
field: TField;
|
|
17
|
-
abstract readonly defaultConditionValue: TConditionValue | undefined;
|
|
18
|
-
abstract readonly defaultConditionModifier: TModifiers;
|
|
19
17
|
abstract readonly modifiers: Record<TModifiers, AnyConditionModifierConfig<TValue, TConditionValue, TSerializedConditionValue>>;
|
|
20
|
-
protected constructor(config:
|
|
18
|
+
protected constructor(config: BaseConditionOptions<TField, TConditionValue, TModifiers>);
|
|
21
19
|
serialize(): BaseSerializedCondition<TypeOfField<TField>, TSerializedConditionValue, TModifiers>;
|
|
22
20
|
getConditionValue: () => TConditionValue | undefined;
|
|
23
21
|
transformValue(value: ValueOfField<TField>): TValue;
|
|
@@ -8,9 +8,9 @@ export interface ConditionRenderProps<TCondition> {
|
|
|
8
8
|
export interface BaseConditionCellProps<TCondition> extends ConditionRenderProps<TCondition> {
|
|
9
9
|
condition: TCondition;
|
|
10
10
|
}
|
|
11
|
-
export interface BaseSerializedCondition<
|
|
11
|
+
export interface BaseSerializedCondition<TType extends string, TSerializedConditionValue, TModifier extends string> {
|
|
12
12
|
id: string;
|
|
13
|
-
type:
|
|
13
|
+
type: TType;
|
|
14
14
|
fieldId: string;
|
|
15
15
|
conditionValue: TSerializedConditionValue;
|
|
16
16
|
conditionModifier: TModifier;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { BooleanField, ValueOfField } from '../../fields';
|
|
3
|
-
import { BaseCondition,
|
|
3
|
+
import { BaseCondition, BaseConditionOptions, ConditionRenderProps } from '../BaseCondition';
|
|
4
4
|
import { BooleanConditionModifiers, SerializedBooleanCondition } from './typings';
|
|
5
|
-
export interface BooleanFieldConditionOptions extends
|
|
5
|
+
export interface BooleanFieldConditionOptions extends BaseConditionOptions<BooleanField, boolean, BooleanConditionModifiers> {
|
|
6
6
|
}
|
|
7
7
|
export declare class BooleanFieldCondition extends BaseCondition<BooleanField, ValueOfField<BooleanField>, boolean, boolean, BooleanConditionModifiers, BooleanFieldCondition> {
|
|
8
|
-
readonly defaultConditionModifier = "equals";
|
|
9
|
-
readonly defaultConditionValue: undefined;
|
|
10
8
|
readonly modifiers: {
|
|
11
9
|
equals: import('../..').FieldConditionModifierConfig<boolean, boolean, boolean, boolean, boolean, boolean>;
|
|
12
10
|
notEquals: import('../..').FieldConditionModifierConfig<boolean, boolean, boolean, boolean, boolean, boolean>;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { CheckboxListField, ValueOfField } from '../../fields';
|
|
3
|
-
import { BaseCondition,
|
|
3
|
+
import { BaseCondition, BaseConditionOptions, ConditionRenderProps } from '../BaseCondition';
|
|
4
4
|
import { CheckboxListConditionModifiers, SerializedCheckboxListCondition } from './typings';
|
|
5
|
-
export interface CheckboxListFieldConditionOptions extends
|
|
5
|
+
export interface CheckboxListFieldConditionOptions extends BaseConditionOptions<CheckboxListField, string[], CheckboxListConditionModifiers> {
|
|
6
6
|
}
|
|
7
7
|
export declare class CheckboxListFieldCondition extends BaseCondition<CheckboxListField, ValueOfField<CheckboxListField>, string[], string[], CheckboxListConditionModifiers, CheckboxListFieldCondition> {
|
|
8
|
-
readonly defaultConditionModifier = "equals";
|
|
9
|
-
readonly defaultConditionValue: string[] | undefined;
|
|
10
8
|
readonly modifiers: {
|
|
11
9
|
equals: import('../..').FieldConditionModifierConfig<string[], string[], string[], string[], string[], string[]>;
|
|
12
10
|
notEquals: import('../..').FieldConditionModifierConfig<string[], string[], string[], string[], string[], string[]>;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { DateRange } from 'react-day-picker';
|
|
3
3
|
import { DateField, SerializedDateRange, ValueOfField } from '../../fields';
|
|
4
|
-
import { BaseCondition,
|
|
4
|
+
import { BaseCondition, BaseConditionOptions, ConditionRenderProps } from '../BaseCondition';
|
|
5
5
|
import { DateConditionModifiers, SerializedDateCondition } from './typings';
|
|
6
|
-
export interface DateFieldConditionOptions extends
|
|
6
|
+
export interface DateFieldConditionOptions extends BaseConditionOptions<DateField, Date | DateRange, DateConditionModifiers> {
|
|
7
7
|
}
|
|
8
8
|
export declare class DateFieldCondition extends BaseCondition<DateField, ValueOfField<DateField>, Date | DateRange, string | SerializedDateRange, DateConditionModifiers, DateFieldCondition> {
|
|
9
|
-
readonly defaultConditionModifier = "equals";
|
|
10
|
-
readonly defaultConditionValue: undefined;
|
|
11
9
|
readonly modifiers: {
|
|
12
10
|
equals: import('../..').FieldConditionModifierConfig<Date | null, Date | DateRange, string | SerializedDateRange, Date, Date, string>;
|
|
13
11
|
notEquals: import('../..').FieldConditionModifierConfig<Date | null, Date | DateRange, string | SerializedDateRange, Date, Date, string>;
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { MultiSelectField, ValueOfField } from '../../fields';
|
|
3
|
-
import { BaseCondition,
|
|
3
|
+
import { BaseCondition, BaseConditionOptions, ConditionRenderProps } from '../BaseCondition';
|
|
4
4
|
import { MultiSelectConditionModifiers, SerializedMultiSelectCondition } from './typings';
|
|
5
|
-
|
|
6
|
-
equals: import('../..').FieldConditionModifierConfig<string[], string[], string[], string[], string[], string[]>;
|
|
7
|
-
notEquals: import('../..').FieldConditionModifierConfig<string[], string[], string[], string[], string[], string[]>;
|
|
8
|
-
every: import('../..').FieldConditionModifierConfig<string[], string[], string[], string[], string[], string[]>;
|
|
9
|
-
some: import('../..').FieldConditionModifierConfig<string[], string[], string[], string[], string[], string[]>;
|
|
10
|
-
none: import('../..').FieldConditionModifierConfig<string[], string[], string[], string[], string[], string[]>;
|
|
11
|
-
};
|
|
12
|
-
export interface MultiSelectFieldConditionOptions extends ConditionOptions<MultiSelectField, string[], MultiSelectConditionModifiers> {
|
|
5
|
+
export interface MultiSelectFieldConditionOptions extends BaseConditionOptions<MultiSelectField, string[], MultiSelectConditionModifiers> {
|
|
13
6
|
}
|
|
14
7
|
export declare class MultiSelectFieldCondition extends BaseCondition<MultiSelectField, ValueOfField<MultiSelectField>, string[], string[], MultiSelectConditionModifiers, MultiSelectFieldCondition> {
|
|
15
|
-
readonly defaultConditionValue: string[] | undefined;
|
|
16
|
-
readonly defaultConditionModifier: keyof typeof modifiers;
|
|
17
8
|
readonly modifiers: {
|
|
18
9
|
equals: import('../..').FieldConditionModifierConfig<string[], string[], string[], string[], string[], string[]>;
|
|
19
10
|
notEquals: import('../..').FieldConditionModifierConfig<string[], string[], string[], string[], string[], string[]>;
|
|
@@ -25,4 +16,3 @@ export declare class MultiSelectFieldCondition extends BaseCondition<MultiSelect
|
|
|
25
16
|
static deserialize(serializedCondition: SerializedMultiSelectCondition, field: MultiSelectField): MultiSelectFieldCondition;
|
|
26
17
|
render(props: ConditionRenderProps<MultiSelectFieldCondition>): ReactNode;
|
|
27
18
|
}
|
|
28
|
-
export {};
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { MultiStringField, ValueOfField } from '../../fields';
|
|
3
|
-
import { BaseCondition,
|
|
3
|
+
import { BaseCondition, BaseConditionOptions, ConditionRenderProps } from '../BaseCondition';
|
|
4
4
|
import { MultiStringConditionModifiers, SerializedMultiStringCondition } from './typings';
|
|
5
|
-
export interface MultiStringFieldConditionOptions extends
|
|
5
|
+
export interface MultiStringFieldConditionOptions extends BaseConditionOptions<MultiStringField, string[], MultiStringConditionModifiers> {
|
|
6
6
|
}
|
|
7
7
|
export declare class MultiStringFieldCondition extends BaseCondition<MultiStringField, ValueOfField<MultiStringField>, string[], string[], MultiStringConditionModifiers, MultiStringFieldCondition> {
|
|
8
|
-
readonly defaultConditionValue: undefined;
|
|
9
|
-
readonly defaultConditionModifier = "equals";
|
|
10
8
|
readonly modifiers: {
|
|
11
9
|
equals: import('../..').FieldConditionModifierConfig<string[], string[], string[], string[], string[], string[]>;
|
|
12
10
|
notEquals: import('../..').FieldConditionModifierConfig<string[], string[], string[], string[], string[], string[]>;
|
|
@@ -1,22 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { NumberField, NumberRange, ValueOfField } from '../../fields';
|
|
3
|
-
import { BaseCondition,
|
|
3
|
+
import { BaseCondition, BaseConditionOptions, ConditionRenderProps } from '../BaseCondition';
|
|
4
4
|
import { NumberConditionModifiers, SerializedNumberCondition } from './typings';
|
|
5
|
-
|
|
6
|
-
equals: import('../..').FieldConditionModifierConfig<number | null, number | NumberRange, number | NumberRange, number, number, number>;
|
|
7
|
-
notEquals: import('../..').FieldConditionModifierConfig<number | null, number | NumberRange, number | NumberRange, number, number, number>;
|
|
8
|
-
lessThan: import('../..').FieldConditionModifierConfig<number | null, number | NumberRange, number | NumberRange, number, number, number>;
|
|
9
|
-
lessThanOrEquals: import('../..').FieldConditionModifierConfig<number | null, number | NumberRange, number | NumberRange, number, number, number>;
|
|
10
|
-
greaterThan: import('../..').FieldConditionModifierConfig<number | null, number | NumberRange, number | NumberRange, number, number, number>;
|
|
11
|
-
greaterThanOrEquals: import('../..').FieldConditionModifierConfig<number | null, number | NumberRange, number | NumberRange, number, number, number>;
|
|
12
|
-
inRange: import('../..').FieldConditionModifierConfig<number | null, number | NumberRange, number | NumberRange, number, NumberRange, NumberRange>;
|
|
13
|
-
notInRange: import('../..').FieldConditionModifierConfig<number | null, number | NumberRange, number | NumberRange, number, NumberRange, NumberRange>;
|
|
14
|
-
};
|
|
15
|
-
export interface NumberFieldConditionOptions extends ConditionOptions<NumberField, number | NumberRange, NumberConditionModifiers> {
|
|
5
|
+
export interface NumberFieldConditionOptions extends BaseConditionOptions<NumberField, number | NumberRange, NumberConditionModifiers> {
|
|
16
6
|
}
|
|
17
7
|
export declare class NumberFieldCondition extends BaseCondition<NumberField, ValueOfField<NumberField>, number | NumberRange, number | NumberRange, NumberConditionModifiers, NumberFieldCondition> {
|
|
18
|
-
readonly defaultConditionValue: number | undefined;
|
|
19
|
-
readonly defaultConditionModifier: keyof typeof modifiers;
|
|
20
8
|
readonly modifiers: {
|
|
21
9
|
equals: import('../..').FieldConditionModifierConfig<number | null, number | NumberRange, number | NumberRange, number, number, number>;
|
|
22
10
|
notEquals: import('../..').FieldConditionModifierConfig<number | null, number | NumberRange, number | NumberRange, number, number, number>;
|
|
@@ -31,4 +19,3 @@ export declare class NumberFieldCondition extends BaseCondition<NumberField, Val
|
|
|
31
19
|
static deserialize(serializedCondition: SerializedNumberCondition, field: NumberField): NumberFieldCondition;
|
|
32
20
|
render(props: ConditionRenderProps<NumberFieldCondition>): ReactNode;
|
|
33
21
|
}
|
|
34
|
-
export {};
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { OTPField, ValueOfField } from '../../fields';
|
|
3
|
-
import { BaseCondition,
|
|
3
|
+
import { BaseCondition, BaseConditionOptions, ConditionRenderProps } from '../BaseCondition';
|
|
4
4
|
import { OTPConditionModifiers, SerializedOTPCondition } from './typings';
|
|
5
|
-
export interface OTPFieldConditionOptions extends
|
|
5
|
+
export interface OTPFieldConditionOptions extends BaseConditionOptions<OTPField, string, OTPConditionModifiers> {
|
|
6
6
|
}
|
|
7
7
|
export declare class OTPFieldCondition extends BaseCondition<OTPField, ValueOfField<OTPField>, string, string, OTPConditionModifiers, OTPFieldCondition> {
|
|
8
|
-
readonly defaultConditionValue: undefined;
|
|
9
|
-
readonly defaultConditionModifier = "equals";
|
|
10
8
|
readonly modifiers: {
|
|
11
9
|
equals: import('../..').FieldConditionModifierConfig<string, string, string, string, string, string>;
|
|
12
10
|
notEquals: import('../..').FieldConditionModifierConfig<string, string, string, string, string, string>;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { PassFailField, PassFailFieldStatus, ValueOfField } from '../../fields';
|
|
3
|
-
import { BaseCondition,
|
|
3
|
+
import { BaseCondition, BaseConditionOptions, ConditionRenderProps } from '../BaseCondition';
|
|
4
4
|
import { PassFailFieldConditionModifiers, SerializedPassFailFieldCondition } from './typings';
|
|
5
|
-
export interface PassFailFieldConditionOptions extends
|
|
5
|
+
export interface PassFailFieldConditionOptions extends BaseConditionOptions<PassFailField, PassFailFieldStatus | PassFailFieldStatus[], PassFailFieldConditionModifiers> {
|
|
6
6
|
}
|
|
7
7
|
export declare class PassFailFieldCondition extends BaseCondition<PassFailField, ValueOfField<PassFailField>["status"], PassFailFieldStatus | PassFailFieldStatus[], PassFailFieldStatus | PassFailFieldStatus[], PassFailFieldConditionModifiers, PassFailFieldCondition> {
|
|
8
|
-
readonly defaultConditionValue: undefined;
|
|
9
|
-
readonly defaultConditionModifier = "equals";
|
|
10
8
|
readonly modifiers: {
|
|
11
9
|
readonly equals: import('../..').FieldConditionModifierConfig<PassFailFieldStatus | null, PassFailFieldStatus | PassFailFieldStatus[], PassFailFieldStatus | PassFailFieldStatus[], PassFailFieldStatus, PassFailFieldStatus, PassFailFieldStatus>;
|
|
12
10
|
readonly notEquals: import('../..').FieldConditionModifierConfig<PassFailFieldStatus | null, PassFailFieldStatus | PassFailFieldStatus[], PassFailFieldStatus | PassFailFieldStatus[], PassFailFieldStatus, PassFailFieldStatus, PassFailFieldStatus>;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { RadioField, ValueOfField } from '../../fields';
|
|
3
|
-
import { BaseCondition,
|
|
3
|
+
import { BaseCondition, BaseConditionOptions, ConditionRenderProps } from '../BaseCondition';
|
|
4
4
|
import { RadioConditionModifiers, SerializedRadioCondition } from './typings';
|
|
5
|
-
export interface RadioFieldConditionOptions extends
|
|
5
|
+
export interface RadioFieldConditionOptions extends BaseConditionOptions<RadioField, string | string[], RadioConditionModifiers> {
|
|
6
6
|
}
|
|
7
7
|
export declare class RadioFieldCondition extends BaseCondition<RadioField, ValueOfField<RadioField>, string | string[], string | string[], RadioConditionModifiers, RadioFieldCondition> {
|
|
8
|
-
readonly defaultConditionValue: undefined;
|
|
9
|
-
readonly defaultConditionModifier = "equals";
|
|
10
8
|
readonly modifiers: {
|
|
11
9
|
equals: import('../..').FieldConditionModifierConfig<string | null, string | string[], string | string[], string, string, string>;
|
|
12
10
|
notEquals: import('../..').FieldConditionModifierConfig<string | null, string | string[], string | string[], string, string, string>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { NumberRange, RatingField, ValueOfField } from '../../fields';
|
|
3
|
+
import { BaseCondition, BaseConditionOptions, ConditionRenderProps } from '../BaseCondition';
|
|
4
|
+
import { RatingConditionModifiers, SerializedRatingCondition } from './typings';
|
|
5
|
+
export interface RatingFieldConditionOptions extends BaseConditionOptions<RatingField, number | NumberRange, RatingConditionModifiers> {
|
|
6
|
+
}
|
|
7
|
+
export declare class RatingFieldCondition extends BaseCondition<RatingField, ValueOfField<RatingField>, number | NumberRange, number | NumberRange, RatingConditionModifiers, RatingFieldCondition> {
|
|
8
|
+
readonly modifiers: {
|
|
9
|
+
equals: import('../..').FieldConditionModifierConfig<number | null, number | NumberRange, number | NumberRange, number, number, number>;
|
|
10
|
+
notEquals: import('../..').FieldConditionModifierConfig<number | null, number | NumberRange, number | NumberRange, number, number, number>;
|
|
11
|
+
lessThan: import('../..').FieldConditionModifierConfig<number | null, number | NumberRange, number | NumberRange, number, number, number>;
|
|
12
|
+
lessThanOrEquals: import('../..').FieldConditionModifierConfig<number | null, number | NumberRange, number | NumberRange, number, number, number>;
|
|
13
|
+
greaterThan: import('../..').FieldConditionModifierConfig<number | null, number | NumberRange, number | NumberRange, number, number, number>;
|
|
14
|
+
greaterThanOrEquals: import('../..').FieldConditionModifierConfig<number | null, number | NumberRange, number | NumberRange, number, number, number>;
|
|
15
|
+
inRange: import('../..').FieldConditionModifierConfig<number | null, number | NumberRange, number | NumberRange, number, NumberRange, NumberRange>;
|
|
16
|
+
notInRange: import('../..').FieldConditionModifierConfig<number | null, number | NumberRange, number | NumberRange, number, NumberRange, NumberRange>;
|
|
17
|
+
};
|
|
18
|
+
constructor(options: RatingFieldConditionOptions);
|
|
19
|
+
static deserialize(serializedCondition: SerializedRatingCondition, field: RatingField): RatingFieldCondition;
|
|
20
|
+
render(props: ConditionRenderProps<RatingFieldCondition>): ReactNode;
|
|
21
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BaseConditionCellProps } from '../BaseCondition';
|
|
2
|
+
import { RatingFieldCondition } from './RatingFieldCondition';
|
|
3
|
+
interface RatingFieldConditionCellProps extends BaseConditionCellProps<RatingFieldCondition> {
|
|
4
|
+
}
|
|
5
|
+
export declare const RatingFieldConditionCell: (props: RatingFieldConditionCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { NumberRange, RatingField, TypeOfField } from '../../fields';
|
|
2
|
+
import { BaseSerializedCondition } from '../BaseCondition';
|
|
3
|
+
export type RatingConditionModifiers = "equals" | "notEquals" | "lessThan" | "lessThanOrEquals" | "greaterThan" | "greaterThanOrEquals" | "inRange" | "notInRange";
|
|
4
|
+
export type SerializedRatingCondition = BaseSerializedCondition<TypeOfField<RatingField>, number | NumberRange, RatingConditionModifiers>;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ScanField, ValueOfField } from '../../fields';
|
|
3
|
-
import { BaseCondition,
|
|
3
|
+
import { BaseCondition, BaseConditionOptions, ConditionRenderProps } from '../BaseCondition';
|
|
4
4
|
import { ScanConditionModifiers, SerializedScanCondition } from './typings';
|
|
5
|
-
export interface ScanFieldConditionOptions extends
|
|
5
|
+
export interface ScanFieldConditionOptions extends BaseConditionOptions<ScanField, string, ScanConditionModifiers> {
|
|
6
6
|
}
|
|
7
7
|
export declare class ScanFieldCondition extends BaseCondition<ScanField, ValueOfField<ScanField>, string, string, ScanConditionModifiers, ScanFieldCondition> {
|
|
8
|
-
readonly defaultConditionValue: undefined;
|
|
9
|
-
readonly defaultConditionModifier = "equals";
|
|
10
8
|
readonly modifiers: {
|
|
11
9
|
equals: import('../..').FieldConditionModifierConfig<string, string, string, string, string, string>;
|
|
12
10
|
notEquals: import('../..').FieldConditionModifierConfig<string, string, string, string, string, string>;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { SelectField, ValueOfField } from '../../fields';
|
|
3
|
-
import { BaseCondition,
|
|
3
|
+
import { BaseCondition, BaseConditionOptions, ConditionRenderProps } from '../BaseCondition';
|
|
4
4
|
import { SelectConditionModifiers, SerializedSelectCondition } from './typings';
|
|
5
|
-
export interface SelectFieldConditionOptions extends
|
|
5
|
+
export interface SelectFieldConditionOptions extends BaseConditionOptions<SelectField, string | string[], SelectConditionModifiers> {
|
|
6
6
|
}
|
|
7
7
|
export declare class SelectFieldCondition extends BaseCondition<SelectField, ValueOfField<SelectField>, string | string[], string | string[], SelectConditionModifiers, SelectFieldCondition> {
|
|
8
|
-
readonly defaultConditionValue: undefined;
|
|
9
|
-
readonly defaultConditionModifier = "equals";
|
|
10
8
|
readonly modifiers: {
|
|
11
9
|
equals: import('../..').FieldConditionModifierConfig<string | null, string | string[], string | string[], string, string, string>;
|
|
12
10
|
notEquals: import('../..').FieldConditionModifierConfig<string | null, string | string[], string | string[], string, string, string>;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { StringField, ValueOfField } from '../../fields';
|
|
3
|
-
import { BaseCondition,
|
|
3
|
+
import { BaseCondition, BaseConditionOptions, ConditionRenderProps } from '../BaseCondition';
|
|
4
4
|
import { SerializedStringCondition, StringConditionModifiers } from './typings';
|
|
5
|
-
export interface StringFieldConditionOptions extends
|
|
5
|
+
export interface StringFieldConditionOptions extends BaseConditionOptions<StringField, string, StringConditionModifiers> {
|
|
6
6
|
}
|
|
7
7
|
export declare class StringFieldCondition extends BaseCondition<StringField, ValueOfField<StringField>, string, string, StringConditionModifiers, StringFieldCondition> {
|
|
8
|
-
readonly defaultConditionValue: undefined;
|
|
9
|
-
readonly defaultConditionModifier = "equals";
|
|
10
8
|
readonly modifiers: {
|
|
11
9
|
equals: import('../..').FieldConditionModifierConfig<string, string, string, string, string, string>;
|
|
12
10
|
notEquals: import('../..').FieldConditionModifierConfig<string, string, string, string, string, string>;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { TextField, ValueOfField } from '../../fields';
|
|
3
|
-
import { BaseCondition,
|
|
3
|
+
import { BaseCondition, BaseConditionOptions, ConditionRenderProps } from '../BaseCondition';
|
|
4
4
|
import { SerializedTextCondition, TextConditionModifiers } from './typings';
|
|
5
|
-
export interface TextFieldConditionOptions extends
|
|
5
|
+
export interface TextFieldConditionOptions extends BaseConditionOptions<TextField, string, TextConditionModifiers> {
|
|
6
6
|
field: TextField;
|
|
7
7
|
}
|
|
8
8
|
export declare class TextFieldCondition extends BaseCondition<TextField, ValueOfField<TextField>, string, string, TextConditionModifiers, TextFieldCondition> {
|
|
9
|
-
readonly defaultConditionValue: undefined;
|
|
10
|
-
readonly defaultConditionModifier = "equals";
|
|
11
9
|
readonly modifiers: {
|
|
12
10
|
equals: import('../..').FieldConditionModifierConfig<string, string, string, string, string, string>;
|
|
13
11
|
notEquals: import('../..').FieldConditionModifierConfig<string, string, string, string, string, string>;
|
|
@@ -2,13 +2,11 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { UploadField, ValueOfField } from '../../fields';
|
|
3
3
|
import { UUIDFile } from '../../UUIDFile';
|
|
4
4
|
import { UUIDPromise } from '../../UUIDPromise';
|
|
5
|
-
import { BaseCondition,
|
|
5
|
+
import { BaseCondition, BaseConditionOptions, ConditionRenderProps } from '../BaseCondition';
|
|
6
6
|
import { SerializedUploadCondition, UploadConditionModifiers } from './typings';
|
|
7
|
-
export interface UploadFieldConditionOptions extends
|
|
7
|
+
export interface UploadFieldConditionOptions extends BaseConditionOptions<UploadField, boolean, UploadConditionModifiers> {
|
|
8
8
|
}
|
|
9
9
|
export declare class UploadFieldCondition extends BaseCondition<UploadField, ValueOfField<UploadField>, boolean, boolean, UploadConditionModifiers, UploadFieldCondition> {
|
|
10
|
-
readonly defaultConditionValue: undefined;
|
|
11
|
-
readonly defaultConditionModifier = "equals";
|
|
12
10
|
readonly modifiers: {
|
|
13
11
|
equals: import('../..').FieldConditionModifierConfig<(UUIDFile | UUIDPromise<UUIDFile>)[], boolean, boolean, UUIDFile[], boolean, boolean>;
|
|
14
12
|
notEquals: import('../..').FieldConditionModifierConfig<(UUIDFile | UUIDPromise<UUIDFile>)[], boolean, boolean, UUIDFile[], boolean, boolean>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { BooleanFieldCondition } from './BooleanFieldCondition';
|
|
2
|
+
import { CheckboxListFieldCondition } from './CheckboxListFieldCondition';
|
|
3
|
+
import { DateFieldCondition } from './DateFieldCondition';
|
|
4
|
+
import { MultiSelectFieldCondition } from './MultiSelectFieldCondition';
|
|
5
|
+
import { MultiStringFieldCondition } from './MultiStringFieldCondition';
|
|
6
|
+
import { NumberFieldCondition } from './NumberFieldCondition';
|
|
7
|
+
import { OTPFieldCondition } from './OTPFieldCondition';
|
|
8
|
+
import { PassFailFieldCondition } from './PassFailFieldCondition';
|
|
9
|
+
import { RadioFieldCondition } from './RadioFieldCondition';
|
|
10
|
+
import { RatingFieldCondition } from './RatingFieldCondition';
|
|
11
|
+
import { ScanFieldCondition } from './ScanFieldCondition';
|
|
12
|
+
import { SelectFieldCondition } from './SelectFieldCondition';
|
|
13
|
+
import { StringFieldCondition } from './StringFieldCondition';
|
|
14
|
+
import { TextFieldCondition } from './TextFieldCondition';
|
|
15
|
+
import { UploadFieldCondition } from './UploadFieldCondition';
|
|
16
|
+
export declare const ConditionTypeToClsMapping: {
|
|
17
|
+
date: typeof DateFieldCondition;
|
|
18
|
+
number: typeof NumberFieldCondition;
|
|
19
|
+
boolean: typeof BooleanFieldCondition;
|
|
20
|
+
select: typeof SelectFieldCondition;
|
|
21
|
+
string: typeof StringFieldCondition;
|
|
22
|
+
text: typeof TextFieldCondition;
|
|
23
|
+
upload: typeof UploadFieldCondition;
|
|
24
|
+
qr: typeof ScanFieldCondition;
|
|
25
|
+
"multi-string": typeof MultiStringFieldCondition;
|
|
26
|
+
"multi-select": typeof MultiSelectFieldCondition;
|
|
27
|
+
radio: typeof RadioFieldCondition;
|
|
28
|
+
"checkbox-list": typeof CheckboxListFieldCondition;
|
|
29
|
+
"pass-fail": typeof PassFailFieldCondition;
|
|
30
|
+
otp: typeof OTPFieldCondition;
|
|
31
|
+
rating: typeof RatingFieldCondition;
|
|
32
|
+
};
|
|
@@ -9,6 +9,7 @@ export * from './NumberFieldCondition';
|
|
|
9
9
|
export * from './OTPFieldCondition';
|
|
10
10
|
export * from './PassFailFieldCondition';
|
|
11
11
|
export * from './RadioFieldCondition';
|
|
12
|
+
export * from './RatingFieldCondition';
|
|
12
13
|
export * from './ScanFieldCondition';
|
|
13
14
|
export * from './SelectFieldCondition';
|
|
14
15
|
export * from './StringFieldCondition';
|
|
@@ -8,13 +8,15 @@ import { NumberFieldCondition, SerializedNumberCondition } from './NumberFieldCo
|
|
|
8
8
|
import { OTPFieldCondition, SerializedOTPCondition } from './OTPFieldCondition';
|
|
9
9
|
import { PassFailFieldCondition, SerializedPassFailFieldCondition } from './PassFailFieldCondition';
|
|
10
10
|
import { RadioFieldCondition, SerializedRadioCondition } from './RadioFieldCondition';
|
|
11
|
+
import { RatingFieldCondition, SerializedRatingCondition } from './RatingFieldCondition';
|
|
11
12
|
import { ScanFieldCondition, SerializedScanCondition } from './ScanFieldCondition';
|
|
12
13
|
import { SelectFieldCondition, SerializedSelectCondition } from './SelectFieldCondition';
|
|
13
14
|
import { SerializedStringCondition, StringFieldCondition } from './StringFieldCondition';
|
|
14
15
|
import { SerializedTextCondition, TextFieldCondition } from './TextFieldCondition';
|
|
15
16
|
import { SerializedUploadCondition, UploadFieldCondition } from './UploadFieldCondition';
|
|
16
|
-
export type Condition = BooleanFieldCondition | CheckboxListFieldCondition | PassFailFieldCondition | DateFieldCondition | MultiSelectFieldCondition | MultiStringFieldCondition | NumberFieldCondition | RadioFieldCondition | ScanFieldCondition | SelectFieldCondition | StringFieldCondition | TextFieldCondition | UploadFieldCondition | OTPFieldCondition;
|
|
17
|
-
export type SerializedCondition = SerializedTextCondition | SerializedBooleanCondition | SerializedNumberCondition | SerializedDateCondition | SerializedStringCondition | SerializedSelectCondition | SerializedMultiStringCondition | SerializedMultiSelectCondition | SerializedUploadCondition | SerializedScanCondition | SerializedRadioCondition | SerializedCheckboxListCondition | SerializedPassFailFieldCondition | SerializedOTPCondition;
|
|
17
|
+
export type Condition = BooleanFieldCondition | CheckboxListFieldCondition | PassFailFieldCondition | DateFieldCondition | MultiSelectFieldCondition | MultiStringFieldCondition | NumberFieldCondition | RadioFieldCondition | RatingFieldCondition | ScanFieldCondition | SelectFieldCondition | StringFieldCondition | TextFieldCondition | UploadFieldCondition | OTPFieldCondition;
|
|
18
|
+
export type SerializedCondition = SerializedTextCondition | SerializedBooleanCondition | SerializedNumberCondition | SerializedDateCondition | SerializedStringCondition | SerializedSelectCondition | SerializedMultiStringCondition | SerializedMultiSelectCondition | SerializedUploadCondition | SerializedScanCondition | SerializedRadioCondition | SerializedRatingCondition | SerializedCheckboxListCondition | SerializedPassFailFieldCondition | SerializedOTPCondition;
|
|
19
|
+
export type ConditionClass = typeof BooleanFieldCondition | typeof CheckboxListFieldCondition | typeof PassFailFieldCondition | typeof DateFieldCondition | typeof MultiSelectFieldCondition | typeof MultiStringFieldCondition | typeof NumberFieldCondition | typeof RadioFieldCondition | typeof RatingFieldCondition | typeof ScanFieldCondition | typeof SelectFieldCondition | typeof StringFieldCondition | typeof TextFieldCondition | typeof UploadFieldCondition | typeof OTPFieldCondition;
|
|
18
20
|
export interface FieldConditionManager<TCondition extends AnyCondition> {
|
|
19
21
|
readonly conditions: Record<string, TCondition[]>;
|
|
20
22
|
getConditions(identifier: string): TCondition[];
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { BaseFormElement } from '../BaseFormElement';
|
|
2
2
|
import { BaseSerializedField, FieldOptions, FieldValidator } from './typings';
|
|
3
|
-
export declare abstract class BaseField<
|
|
3
|
+
export declare abstract class BaseField<TType extends string, TValue, TSerializedValue, This extends BaseField<TType, TValue, TSerializedValue, This>> extends BaseFormElement<TType, This> {
|
|
4
4
|
static readonly fieldTypeName: string;
|
|
5
5
|
static readonly fieldTypeDescription: string;
|
|
6
6
|
label: string;
|
|
7
7
|
description: string | null;
|
|
8
8
|
required: boolean;
|
|
9
|
-
private fieldValidators;
|
|
10
9
|
image: File | Promise<File> | undefined;
|
|
11
10
|
/**
|
|
12
11
|
* By default, validation doesn't execute on `onChange` events when editing fields
|
|
@@ -15,11 +14,11 @@ export declare abstract class BaseField<TIdentifier extends string, TValue, TSer
|
|
|
15
14
|
* which don't have a `onBlur` event (which is used to set the `touched` state).
|
|
16
15
|
*/
|
|
17
16
|
readonly onlyValidateAfterTouched: boolean;
|
|
18
|
-
protected constructor(options: FieldOptions
|
|
17
|
+
protected constructor(options: FieldOptions);
|
|
19
18
|
getError(value: TValue): string | undefined;
|
|
20
|
-
serialize(): BaseSerializedField<
|
|
21
|
-
getOptions(): FieldOptions
|
|
22
|
-
setOptions(options: Partial<FieldOptions
|
|
19
|
+
serialize(): BaseSerializedField<TType>;
|
|
20
|
+
getOptions(): FieldOptions;
|
|
21
|
+
setOptions(options: Partial<FieldOptions>): void;
|
|
23
22
|
abstract isSerializedValueValid(value: unknown): value is TSerializedValue;
|
|
24
23
|
abstract serializeValue(value: TValue): TSerializedValue;
|
|
25
24
|
abstract isValueValid(value: unknown): value is TValue;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseFormElementOptions, BaseSerializedFormElement } from '../BaseFormElement';
|
|
2
2
|
import { AnyField } from '../typings';
|
|
3
|
-
export interface BaseSerializedField<
|
|
3
|
+
export interface BaseSerializedField<TType extends string> extends BaseSerializedFormElement<TType> {
|
|
4
4
|
label: string;
|
|
5
5
|
description?: string | null;
|
|
6
6
|
required: boolean;
|
|
7
7
|
image?: File | Promise<File>;
|
|
8
8
|
}
|
|
9
|
-
export interface FieldOptions
|
|
9
|
+
export interface FieldOptions extends BaseFormElementOptions {
|
|
10
10
|
label: string;
|
|
11
11
|
description?: string | null;
|
|
12
12
|
required: boolean;
|
|
13
13
|
image?: File | Promise<File>;
|
|
14
|
-
fieldValidators?: FieldValidator<TValue>[];
|
|
15
14
|
}
|
|
16
15
|
export interface FieldCreationSchemaObject {
|
|
17
16
|
field: AnyField;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { Observable } from '../../Observable
|
|
3
|
-
import {
|
|
4
|
-
export declare abstract class BaseFormElement<
|
|
5
|
-
abstract readonly type:
|
|
2
|
+
import { Observable } from '../../Observable';
|
|
3
|
+
import { BaseFormElementOptions, BaseSerializedFormElement, FieldRenderProps } from './typings';
|
|
4
|
+
export declare abstract class BaseFormElement<TType extends string, This extends BaseFormElement<TType, This>> extends Observable<This> {
|
|
5
|
+
abstract readonly type: TType;
|
|
6
6
|
identifier: string;
|
|
7
|
-
protected constructor(options:
|
|
8
|
-
getOptions():
|
|
9
|
-
setOptions(options: Partial<
|
|
10
|
-
abstract duplicate(identifier: string): BaseFormElement<
|
|
11
|
-
serialize():
|
|
7
|
+
protected constructor(options: BaseFormElementOptions);
|
|
8
|
+
getOptions(): BaseFormElementOptions;
|
|
9
|
+
setOptions(options: Partial<BaseFormElementOptions>): void;
|
|
10
|
+
abstract duplicate(identifier: string): BaseFormElement<TType, This>;
|
|
11
|
+
serialize(): BaseSerializedFormElement<TType>;
|
|
12
12
|
abstract render(props: FieldRenderProps): ReactNode;
|
|
13
13
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { TextSize } from '@overmap-ai/blocks';
|
|
2
|
-
export interface
|
|
2
|
+
export interface BaseFormElementOptions {
|
|
3
3
|
identifier: string;
|
|
4
4
|
}
|
|
5
|
-
export interface
|
|
5
|
+
export interface BaseSerializedFormElement<TType extends string> {
|
|
6
6
|
identifier: string;
|
|
7
|
-
type:
|
|
7
|
+
type: TType;
|
|
8
8
|
}
|
|
9
9
|
export interface FieldRenderProps {
|
|
10
10
|
formId: string;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { BaseField, FieldCreationSchemaObject, FieldOptions } from '../BaseField';
|
|
2
2
|
import { BaseSerializedSelectField, SelectFieldOption } from './typings';
|
|
3
|
-
export interface BaseOptionsFieldOptions
|
|
3
|
+
export interface BaseOptionsFieldOptions extends FieldOptions {
|
|
4
4
|
options: string[] | SelectFieldOption[];
|
|
5
5
|
}
|
|
6
|
-
export declare abstract class BaseOptionsField<
|
|
6
|
+
export declare abstract class BaseOptionsField<TType extends string, TValue, TSerializedValue, This extends BaseOptionsField<TType, TValue, TSerializedValue, This>> extends BaseField<TType, TValue, TSerializedValue, This> {
|
|
7
7
|
options: SelectFieldOption[];
|
|
8
8
|
readonly onlyValidateAfterTouched = false;
|
|
9
|
-
protected constructor(options: BaseOptionsFieldOptions
|
|
10
|
-
serialize(): BaseSerializedSelectField<
|
|
11
|
-
getOptions(): BaseOptionsFieldOptions
|
|
12
|
-
setOptions(options: Partial<BaseOptionsFieldOptions
|
|
9
|
+
protected constructor(options: BaseOptionsFieldOptions);
|
|
10
|
+
serialize(): BaseSerializedSelectField<TType>;
|
|
11
|
+
getOptions(): BaseOptionsFieldOptions;
|
|
12
|
+
setOptions(options: Partial<BaseOptionsFieldOptions>): void;
|
|
13
13
|
static getFieldCreationSchema(parentPath?: string): FieldCreationSchemaObject[];
|
|
14
14
|
}
|
|
@@ -3,7 +3,7 @@ export interface SelectFieldOption {
|
|
|
3
3
|
value: string;
|
|
4
4
|
label: string;
|
|
5
5
|
}
|
|
6
|
-
export interface BaseSerializedSelectField<
|
|
7
|
-
type:
|
|
6
|
+
export interface BaseSerializedSelectField<TType extends string> extends BaseSerializedField<TType> {
|
|
7
|
+
type: TType;
|
|
8
8
|
options: SelectFieldOption[];
|
|
9
9
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { BaseField, FieldOptions, FieldValidator } from '../BaseField';
|
|
2
2
|
import { NumberField } from '../NumberField';
|
|
3
3
|
import { BaseSerializedStringField } from './typings';
|
|
4
|
-
export interface BaseStringFieldOptions extends FieldOptions
|
|
4
|
+
export interface BaseStringFieldOptions extends FieldOptions {
|
|
5
5
|
minLength?: number;
|
|
6
6
|
maxLength?: number;
|
|
7
7
|
placeholder?: string;
|
|
8
8
|
}
|
|
9
|
-
export declare abstract class BaseStringField<
|
|
9
|
+
export declare abstract class BaseStringField<TType extends string, This extends BaseStringField<TType, This>> extends BaseField<TType, string, string, This> {
|
|
10
10
|
minLength?: number;
|
|
11
11
|
maxLength: number;
|
|
12
12
|
placeholder?: string;
|
|
@@ -16,7 +16,7 @@ export declare abstract class BaseStringField<TIdentifier extends string, This e
|
|
|
16
16
|
showDirectly: boolean;
|
|
17
17
|
}[];
|
|
18
18
|
getFieldValidators(): FieldValidator<string>[];
|
|
19
|
-
serialize(): BaseSerializedStringField<
|
|
19
|
+
serialize(): BaseSerializedStringField<TType>;
|
|
20
20
|
getOptions(): BaseStringFieldOptions;
|
|
21
21
|
setOptions(options: Partial<BaseStringFieldOptions>): void;
|
|
22
22
|
serializeValue(value: string): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseSerializedField } from '../BaseField';
|
|
2
|
-
export interface BaseSerializedStringField<
|
|
2
|
+
export interface BaseSerializedStringField<TType extends string> extends BaseSerializedField<TType> {
|
|
3
3
|
minimum_length?: number;
|
|
4
4
|
maximum_length: number;
|
|
5
5
|
placeholder?: string;
|