@overmap-ai/core 1.0.35 → 1.0.36-add-image-to-forms.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/forms/builder/FieldActions.d.ts +4 -1
- package/dist/forms/constants.d.ts +9 -0
- package/dist/forms/fields/BaseField/BaseField.d.ts +1 -0
- package/dist/forms/fields/BaseField/layouts.d.ts +1 -0
- package/dist/forms/fields/SelectField/BaseSelectField.d.ts +1 -0
- package/dist/forms/fields/constants.d.ts +3 -0
- package/dist/forms/typings.d.ts +1 -0
- package/dist/forms/utils.d.ts +2 -0
- package/dist/overmap-core.js +795 -354
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +788 -347
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/services/UserFormService.d.ts +4 -3
- package/dist/store/slices/userFormSlice.d.ts +11 -2
- package/dist/style.css +164 -48
- package/dist/typings/models/forms.d.ts +5 -0
- package/package.json +1 -1
- package/dist/forms/builder/componentConstants.d.ts +0 -8
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import { ChangeEvent } from "react";
|
|
2
|
+
import { FieldTypeIdentifier } from "../typings.ts";
|
|
2
3
|
interface FieldActionsProps {
|
|
3
4
|
index: number;
|
|
5
|
+
type: FieldTypeIdentifier;
|
|
4
6
|
sectionIndex?: number;
|
|
5
7
|
remove: () => void;
|
|
6
8
|
duplicate: () => void;
|
|
7
9
|
move: (direction: "up" | "down") => void;
|
|
10
|
+
upload?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
8
11
|
}
|
|
9
12
|
export declare const FieldActions: import("react").MemoExoticComponent<(props: FieldActionsProps) => import("react/jsx-runtime").JSX.Element>;
|
|
10
13
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from "react";
|
|
2
|
+
interface FullScreenImagePreviewProps {
|
|
3
|
+
file: File;
|
|
4
|
+
url: string;
|
|
5
|
+
name: string;
|
|
6
|
+
setShowPreview: Dispatch<SetStateAction<boolean>>;
|
|
7
|
+
}
|
|
8
|
+
export declare const FullScreenImagePreview: import("react").MemoExoticComponent<(props: FullScreenImagePreviewProps) => import("react/jsx-runtime").JSX.Element>;
|
|
9
|
+
export {};
|
|
@@ -30,6 +30,7 @@ export declare abstract class BaseField<TValue extends FieldValue, TIdentifier e
|
|
|
30
30
|
private readonly formValidators;
|
|
31
31
|
private readonly fieldValidators;
|
|
32
32
|
readonly label: string;
|
|
33
|
+
readonly image: File | Promise<File> | undefined;
|
|
33
34
|
/**
|
|
34
35
|
* By default, validation doesn't execute on `onChange` events when editing fields
|
|
35
36
|
* until the field has been `touched`. This can be overridden by setting this to `false`
|
|
@@ -19,6 +19,7 @@ export declare abstract class BaseSelectField<TValue extends FieldValue, TIdenti
|
|
|
19
19
|
options: SelectFieldOption[];
|
|
20
20
|
label: string;
|
|
21
21
|
required: boolean;
|
|
22
|
+
image?: File | Promise<File> | undefined;
|
|
22
23
|
description?: string | null | undefined;
|
|
23
24
|
identifier: string;
|
|
24
25
|
type: TIdentifier;
|
package/dist/forms/typings.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export interface BaseSerializedObject<TIdentifier extends FieldTypeIdentifier =
|
|
|
25
25
|
export interface BaseSerializedField<TIdentifier extends FieldTypeIdentifier = FieldTypeIdentifier> extends BaseSerializedObject<TIdentifier> {
|
|
26
26
|
label: string;
|
|
27
27
|
required: boolean;
|
|
28
|
+
image?: File | Promise<File>;
|
|
28
29
|
}
|
|
29
30
|
/** All the possible field values */
|
|
30
31
|
export type FieldValue = string | number | boolean | string[] | SelectFieldOption[] | File[] | Date | Marker | null;
|
package/dist/forms/utils.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { FormikErrors } from "formik";
|
|
|
2
2
|
import { BaseFormElement, ISchema } from "./fields";
|
|
3
3
|
import { Form } from "./typings";
|
|
4
4
|
import { FormikUserFormRevision } from "./builder";
|
|
5
|
+
import { UserFormRevision } from "../typings";
|
|
5
6
|
export declare const hasKeys: (errors: object) => boolean;
|
|
6
7
|
export declare const validateForm: (schema: ISchema, form: Form | FormikUserFormRevision) => FormikErrors<Form> | FormikErrors<import('./builder/typings').NewForm> | undefined;
|
|
7
8
|
export declare const initialFormValues: (fields: BaseFormElement[], values: Form) => Form;
|
|
9
|
+
export declare const useAttachImagesToFormRevisionFields: (revision: UserFormRevision) => UserFormRevision;
|