@overmap-ai/core 1.0.60-sdk-refactor.20 → 1.0.60

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.
Files changed (147) hide show
  1. package/dist/index.d.ts +0 -4
  2. package/dist/overmap-core.js +1231 -12798
  3. package/dist/overmap-core.js.map +1 -1
  4. package/dist/overmap-core.umd.cjs +1240 -12808
  5. package/dist/overmap-core.umd.cjs.map +1 -1
  6. package/dist/sdk/services/BaseAttachmentService.d.ts +8 -4
  7. package/dist/sdk/services/BaseUploadService.d.ts +8 -0
  8. package/dist/sdk/services/FormService.d.ts +18 -0
  9. package/dist/sdk/services/FormSubmissionService.d.ts +24 -0
  10. package/dist/sdk/services/GeoImageService.d.ts +11 -0
  11. package/dist/sdk/services/IssueService.d.ts +1 -1
  12. package/dist/sdk/services/index.d.ts +3 -2
  13. package/dist/sdk/typings.d.ts +3 -2
  14. package/dist/store/slices/assetTypeSlice.d.ts +2 -8
  15. package/dist/store/slices/categorySlice.d.ts +11 -25
  16. package/dist/store/slices/documentSlice.d.ts +14 -14
  17. package/dist/store/slices/formRevisionAttachmentSlice.d.ts +21 -21
  18. package/dist/store/slices/formRevisionSlice.d.ts +21 -21
  19. package/dist/store/slices/formSlice.d.ts +20 -19
  20. package/dist/store/slices/formSubmissionAttachmentSlice.d.ts +20 -20
  21. package/dist/store/slices/formSubmissionSlice.d.ts +26 -26
  22. package/dist/store/slices/geoImageSlice.d.ts +48 -0
  23. package/dist/store/slices/index.d.ts +1 -0
  24. package/dist/store/slices/issueSlice.d.ts +2 -12
  25. package/dist/store/slices/organizationSlice.d.ts +6 -17
  26. package/dist/store/slices/projectFileSlice.d.ts +5 -17
  27. package/dist/store/slices/projectSlice.d.ts +1 -4
  28. package/dist/store/slices/workspaceSlice.d.ts +5 -10
  29. package/dist/store/store.d.ts +2 -1
  30. package/dist/typings/colors.d.ts +0 -3
  31. package/dist/typings/models/{components.d.ts → assets.d.ts} +3 -4
  32. package/dist/typings/models/forms.d.ts +98 -12
  33. package/dist/typings/models/geo.d.ts +18 -6
  34. package/dist/typings/models/geoImages.d.ts +14 -0
  35. package/dist/typings/models/index.d.ts +2 -1
  36. package/dist/typings/models/issues.d.ts +6 -7
  37. package/dist/typings/models/projects.d.ts +3 -5
  38. package/dist/typings/models/store.d.ts +2 -2
  39. package/dist/utils/colors.d.ts +0 -6
  40. package/dist/utils/coordinates.d.ts +5 -7
  41. package/dist/utils/forms.d.ts +2 -2
  42. package/dist/utils/index.d.ts +1 -0
  43. package/package.json +13 -43
  44. package/dist/components/ColorPicker/ColorPicker.d.ts +0 -10
  45. package/dist/components/ColorPicker/index.d.ts +0 -1
  46. package/dist/components/FileBadge/FileBadge.d.ts +0 -8
  47. package/dist/components/FileBadge/index.d.ts +0 -1
  48. package/dist/components/FileCard/FileCard.d.ts +0 -8
  49. package/dist/components/FileCard/index.d.ts +0 -1
  50. package/dist/components/FileIcon/FileIcon.d.ts +0 -5
  51. package/dist/components/FileIcon/index.d.ts +0 -1
  52. package/dist/components/FileViewer/FileViewerProvider.d.ts +0 -2
  53. package/dist/components/FileViewer/context.d.ts +0 -5
  54. package/dist/components/FileViewer/index.d.ts +0 -3
  55. package/dist/components/FileViewer/typings.d.ts +0 -5
  56. package/dist/components/ImageCard/ImageCard.d.ts +0 -9
  57. package/dist/components/ImageCard/index.d.ts +0 -1
  58. package/dist/components/ImageMarkup/ImageMarkup.d.ts +0 -14
  59. package/dist/components/ImageMarkup/index.d.ts +0 -1
  60. package/dist/components/ImageViewer/ImageViewer.d.ts +0 -8
  61. package/dist/components/ImageViewer/constants.d.ts +0 -1
  62. package/dist/components/ImageViewer/index.d.ts +0 -2
  63. package/dist/components/PDFViewer/PDFViewer.d.ts +0 -8
  64. package/dist/components/PDFViewer/constants.d.ts +0 -1
  65. package/dist/components/PDFViewer/index.d.ts +0 -2
  66. package/dist/components/SpreadsheetViewer/SpreadsheetViewer.d.ts +0 -8
  67. package/dist/components/SpreadsheetViewer/constants.d.ts +0 -1
  68. package/dist/components/SpreadsheetViewer/index.d.ts +0 -2
  69. package/dist/components/index.d.ts +0 -10
  70. package/dist/forms/builder/DropDispatch.d.ts +0 -27
  71. package/dist/forms/builder/FieldActions.d.ts +0 -13
  72. package/dist/forms/builder/FieldBuilder.d.ts +0 -10
  73. package/dist/forms/builder/FieldSectionWithActions.d.ts +0 -11
  74. package/dist/forms/builder/FieldWithActions.d.ts +0 -10
  75. package/dist/forms/builder/FieldsEditor.d.ts +0 -6
  76. package/dist/forms/builder/FormBuilder.d.ts +0 -26
  77. package/dist/forms/builder/constants.d.ts +0 -18
  78. package/dist/forms/builder/hooks.d.ts +0 -7
  79. package/dist/forms/builder/index.d.ts +0 -2
  80. package/dist/forms/builder/typings.d.ts +0 -12
  81. package/dist/forms/builder/utils.d.ts +0 -24
  82. package/dist/forms/constants.d.ts +0 -2
  83. package/dist/forms/constantsJsx.d.ts +0 -9
  84. package/dist/forms/fields/BaseField/BaseField.d.ts +0 -52
  85. package/dist/forms/fields/BaseField/hooks.d.ts +0 -374
  86. package/dist/forms/fields/BaseField/index.d.ts +0 -4
  87. package/dist/forms/fields/BaseField/layouts.d.ts +0 -26
  88. package/dist/forms/fields/BaseField/typings.d.ts +0 -7
  89. package/dist/forms/fields/BooleanField/BooleanField.d.ts +0 -23
  90. package/dist/forms/fields/BooleanField/BooleanInput.d.ts +0 -4
  91. package/dist/forms/fields/BooleanField/index.d.ts +0 -2
  92. package/dist/forms/fields/CustomField/CustomField.d.ts +0 -24
  93. package/dist/forms/fields/CustomField/FieldInputClonerField/FieldInputCloner.d.ts +0 -8
  94. package/dist/forms/fields/CustomField/FieldInputClonerField/FieldInputClonerField.d.ts +0 -18
  95. package/dist/forms/fields/CustomField/FieldInputClonerField/index.d.ts +0 -3
  96. package/dist/forms/fields/CustomField/FieldInputClonerField/typings.d.ts +0 -5
  97. package/dist/forms/fields/CustomField/index.d.ts +0 -1
  98. package/dist/forms/fields/DateField/DateField.d.ts +0 -22
  99. package/dist/forms/fields/DateField/DateInput.d.ts +0 -4
  100. package/dist/forms/fields/DateField/index.d.ts +0 -2
  101. package/dist/forms/fields/FieldSection/FieldSection.d.ts +0 -33
  102. package/dist/forms/fields/FieldSection/FieldSectionLayout.d.ts +0 -7
  103. package/dist/forms/fields/FieldSection/index.d.ts +0 -1
  104. package/dist/forms/fields/MultiStringField/MultiStringField.d.ts +0 -40
  105. package/dist/forms/fields/MultiStringField/MultiStringInput.d.ts +0 -8
  106. package/dist/forms/fields/MultiStringField/index.d.ts +0 -2
  107. package/dist/forms/fields/NumberField/NumberField.d.ts +0 -46
  108. package/dist/forms/fields/NumberField/NumberInput.d.ts +0 -4
  109. package/dist/forms/fields/NumberField/index.d.ts +0 -2
  110. package/dist/forms/fields/QrField/QrField.d.ts +0 -21
  111. package/dist/forms/fields/QrField/QrInput.d.ts +0 -10
  112. package/dist/forms/fields/QrField/index.d.ts +0 -2
  113. package/dist/forms/fields/SelectField/BaseSelectField.d.ts +0 -34
  114. package/dist/forms/fields/SelectField/MultiSelectField.d.ts +0 -27
  115. package/dist/forms/fields/SelectField/MultiSelectInput.d.ts +0 -4
  116. package/dist/forms/fields/SelectField/SelectField.d.ts +0 -26
  117. package/dist/forms/fields/SelectField/SelectInput.d.ts +0 -4
  118. package/dist/forms/fields/SelectField/index.d.ts +0 -4
  119. package/dist/forms/fields/StringOrTextFields/StringField/StringField.d.ts +0 -26
  120. package/dist/forms/fields/StringOrTextFields/StringField/StringInput.d.ts +0 -4
  121. package/dist/forms/fields/StringOrTextFields/StringField/index.d.ts +0 -2
  122. package/dist/forms/fields/StringOrTextFields/StringOrTextField.d.ts +0 -34
  123. package/dist/forms/fields/StringOrTextFields/TextField/TextField.d.ts +0 -22
  124. package/dist/forms/fields/StringOrTextFields/TextField/TextInput.d.ts +0 -4
  125. package/dist/forms/fields/StringOrTextFields/TextField/index.d.ts +0 -2
  126. package/dist/forms/fields/StringOrTextFields/index.d.ts +0 -2
  127. package/dist/forms/fields/UploadField/UploadField.d.ts +0 -44
  128. package/dist/forms/fields/UploadField/UploadInput.d.ts +0 -4
  129. package/dist/forms/fields/UploadField/index.d.ts +0 -2
  130. package/dist/forms/fields/UploadField/utils.d.ts +0 -1
  131. package/dist/forms/fields/constants.d.ts +0 -106
  132. package/dist/forms/fields/hooks.d.ts +0 -6
  133. package/dist/forms/fields/index.d.ts +0 -12
  134. package/dist/forms/fields/typings.d.ts +0 -27
  135. package/dist/forms/fields/utils.d.ts +0 -17
  136. package/dist/forms/index.d.ts +0 -6
  137. package/dist/forms/provider.d.ts +0 -5
  138. package/dist/forms/renderer/FormRenderer/FormRenderer.d.ts +0 -31
  139. package/dist/forms/renderer/PatchForm/Field.d.ts +0 -17
  140. package/dist/forms/renderer/PatchForm/Provider.d.ts +0 -29
  141. package/dist/forms/renderer/PatchForm/index.d.ts +0 -2
  142. package/dist/forms/renderer/index.d.ts +0 -2
  143. package/dist/forms/typings.d.ts +0 -103
  144. package/dist/forms/utils.d.ts +0 -7
  145. package/dist/sdk/services/UserFormService.d.ts +0 -19
  146. package/dist/sdk/services/UserFormSubmissionService.d.ts +0 -26
  147. package/dist/style.css +0 -417
@@ -1,40 +0,0 @@
1
- import { BaseField, ChildFieldOptions } from "../BaseField";
2
- import { GetInputProps, InputFieldLevelValidator } from "../typings";
3
- import { ChangeEvent, ReactNode } from "react";
4
- import { RiListCheck } from "react-icons/ri";
5
- import { ISerializedField, SerializedMultiStringField } from "../../typings";
6
- type MultiStringFieldOptions = ChildFieldOptions<string[]> & {
7
- minimum_length?: number;
8
- maximum_length?: number;
9
- placeholder?: string;
10
- };
11
- export declare const emptyMultiStringField: {
12
- type: string;
13
- minimum_length: number;
14
- maximum_length: null;
15
- label: string;
16
- description: string;
17
- required: boolean;
18
- };
19
- /**
20
- * A field that lets the user input multiple strings. Each string must be unique. Useful for things like:
21
- * - Specifying the options of a SelectField (used in `SelectField.getFieldCreationSchema`
22
- * - Listing serial numbers and similar
23
- */
24
- export declare class MultiStringField extends BaseField<string[], "multi-string"> {
25
- static readonly fieldTypeName = "Multi-string";
26
- static readonly fieldTypeDescription = "Allows the user to provide multiple unique strings.";
27
- readonly minLength: number;
28
- readonly maxLength: number;
29
- readonly onlyValidateAfterTouched = false;
30
- readonly placeholder: string;
31
- static Icon: typeof RiListCheck;
32
- constructor(options: MultiStringFieldOptions);
33
- getValueFromChangeEvent(event: ChangeEvent<HTMLInputElement> | string[]): string[];
34
- getInput(props: GetInputProps<this>): ReactNode;
35
- serialize(): SerializedMultiStringField;
36
- protected isBlank(value: string[]): boolean;
37
- getFieldValidators(): InputFieldLevelValidator<string[]>[];
38
- static deserialize(data: ISerializedField): MultiStringField;
39
- }
40
- export {};
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- import { ComponentProps } from "../typings";
3
- import { MultiStringField } from "./MultiStringField";
4
- /**
5
- * Allows the user to create an array of unique strings and customize the order.
6
- * User to generate options for the Select field.
7
- */
8
- export declare const MultiStringInput: import("react").MemoExoticComponent<(props: ComponentProps<MultiStringField>) => import("react/jsx-runtime").JSX.Element>;
@@ -1,2 +0,0 @@
1
- export * from "./MultiStringField";
2
- export * from "./MultiStringInput";
@@ -1,46 +0,0 @@
1
- import { BooleanField } from "../BooleanField";
2
- import { BaseField, ChildFieldOptions } from "../BaseField";
3
- import { GetInputProps, InputFieldLevelValidator, InputValidator } from "../typings";
4
- import { ChangeEvent, ReactNode } from "react";
5
- import { RiHashtag } from "react-icons/ri";
6
- import { ISerializedField, SerializedNumberField } from "../../typings";
7
- export type NumberFieldValue = number | "";
8
- export declare const emptyNumberField: {
9
- type: string;
10
- minimum: number;
11
- maximum: number;
12
- integers: boolean;
13
- label: string;
14
- description: string;
15
- required: boolean;
16
- };
17
- export interface NumberFieldOptions extends ChildFieldOptions<NumberFieldValue> {
18
- maximum?: number;
19
- minimum?: number;
20
- integers?: boolean;
21
- placeholder?: string;
22
- }
23
- export declare class NumberField extends BaseField<NumberFieldValue, "number"> {
24
- static readonly fieldTypeName = "Number";
25
- static readonly fieldTypeDescription = "Allows specifying a number within a given range.";
26
- readonly minimum: number | undefined;
27
- readonly maximum: number | undefined;
28
- readonly integers: boolean;
29
- readonly placeholder: string;
30
- static Icon: typeof RiHashtag;
31
- constructor(options: NumberFieldOptions);
32
- getValueFromChangeEvent(event: ChangeEvent<HTMLInputElement>): NumberFieldValue;
33
- static _validateMin: (path: string) => InputValidator<NumberFieldValue>;
34
- static _validateMax: (path: string) => InputValidator<NumberFieldValue>;
35
- static getFieldCreationSchema(parentPath?: string): ({
36
- field: NumberField;
37
- showDirectly: boolean;
38
- } | {
39
- field: BooleanField;
40
- showDirectly: boolean;
41
- })[];
42
- getFieldValidators(): InputFieldLevelValidator<NumberFieldValue>[];
43
- serialize(): SerializedNumberField;
44
- static deserialize(data: ISerializedField): NumberField;
45
- getInput(props: GetInputProps<this>): ReactNode;
46
- }
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import { ComponentProps } from "../typings";
3
- import { NumberField } from "./NumberField";
4
- export declare const NumberInput: import("react").MemoExoticComponent<(props: ComponentProps<NumberField>) => import("react/jsx-runtime").JSX.Element>;
@@ -1,2 +0,0 @@
1
- export * from "./NumberField";
2
- export * from "./NumberInput";
@@ -1,21 +0,0 @@
1
- import { ReactNode } from "react";
2
- import { RiQrCodeLine } from "react-icons/ri";
3
- import { BaseField, ChildFieldOptions } from "../BaseField";
4
- import { ISerializedField, SerializedQrField } from "../../typings";
5
- import { ComponentProps } from "../typings";
6
- export declare const emptyQrField: {
7
- type: string;
8
- label: string;
9
- description: string;
10
- required: boolean;
11
- };
12
- export declare class QrField extends BaseField<string, "qr"> {
13
- static readonly fieldTypeName = "QR";
14
- static readonly fieldTypeDescription = "Used for scanning/reading QR codes.";
15
- readonly onlyValidateAfterTouched = false;
16
- static Icon: typeof RiQrCodeLine;
17
- constructor(options: ChildFieldOptions<string>);
18
- serialize(): SerializedQrField;
19
- static deserialize(data: ISerializedField): QrField;
20
- getInput(props: ComponentProps<QrField>): ReactNode;
21
- }
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- import { ComponentProps } from "../typings";
3
- import { QrField } from "./QrField";
4
- export declare const QrInput: import("react").MemoExoticComponent<(props: ComponentProps<QrField>) => import("react/jsx-runtime").JSX.Element>;
5
- interface QrScannerProps {
6
- onQrScan: (data: string) => void;
7
- onClose: () => void;
8
- }
9
- export declare const QrScanner: import("react").MemoExoticComponent<(props: QrScannerProps) => import("react/jsx-runtime").JSX.Element>;
10
- export {};
@@ -1,2 +0,0 @@
1
- export * from "./QrField";
2
- export * from "./QrInput";
@@ -1,34 +0,0 @@
1
- import { BaseField, ChildFieldOptions } from "../BaseField";
2
- import { FieldValue, SelectFieldOption } from "../../typings";
3
- import { MultiStringField } from "../MultiStringField";
4
- /**
5
- * The options passed to the constructor of SelectField.
6
- */
7
- export interface BaseSelectFieldOptions<TValue, TIdentifier extends "select" | "multi-select"> extends ChildFieldOptions<TValue> {
8
- /** When instantiating a SelectField, you can either pass an array of strings or an array of objects. User-created
9
- * forms only support arrays of strings. For more complex internal purposes, you can provide an array of objects
10
- * where the `label` is the text to display to the user and the `value` is the value handled by Formik.*/
11
- options: string[] | SelectFieldOption[];
12
- type: TIdentifier;
13
- placeholder?: string;
14
- }
15
- export declare abstract class BaseSelectField<TValue extends FieldValue, TIdentifier extends "select" | "multi-select"> extends BaseField<TValue, TIdentifier> {
16
- readonly options: SelectFieldOption[];
17
- readonly onlyValidateAfterTouched = false;
18
- readonly placeholder: string;
19
- protected constructor(options: BaseSelectFieldOptions<TValue, TIdentifier>);
20
- protected _serialize(): {
21
- options: SelectFieldOption[];
22
- placeholder: string;
23
- label: string;
24
- required: boolean;
25
- image?: File | Promise<File> | undefined;
26
- description?: string | null | undefined;
27
- identifier: string;
28
- type: TIdentifier;
29
- };
30
- static getFieldCreationSchema(parentPath?: string): {
31
- field: MultiStringField;
32
- showDirectly: boolean;
33
- }[];
34
- }
@@ -1,27 +0,0 @@
1
- import { ReactNode } from "react";
2
- import { GetInputProps } from "../typings";
3
- import { BaseSelectField, BaseSelectFieldOptions } from "./BaseSelectField";
4
- import { RiCheckboxLine } from "react-icons/ri";
5
- import { ISerializedField, SelectFieldOptionValue, SerializedMultiSelectField } from "../../typings";
6
- /**
7
- * The options passed to the constructor of MultiSelectField.
8
- */
9
- export type MultiSelectFieldOptions = Omit<BaseSelectFieldOptions<SelectFieldOptionValue[], "multi-select">, "type">;
10
- export declare const emptyMultiSelectField: {
11
- type: string;
12
- options: never[];
13
- label: string;
14
- description: string;
15
- required: boolean;
16
- };
17
- export declare class MultiSelectField extends BaseSelectField<SelectFieldOptionValue[], "multi-select"> {
18
- static readonly fieldTypeName = "Multi-select";
19
- static readonly fieldTypeDescription = "Allows the user to select a multiple options from a list of options.";
20
- static Icon: typeof RiCheckboxLine;
21
- constructor(options: MultiSelectFieldOptions);
22
- getValueFromChangeEvent(event: React.ChangeEvent<HTMLInputElement> | string[]): string[];
23
- protected isBlank(value: SelectFieldOptionValue[]): boolean;
24
- serialize(): SerializedMultiSelectField;
25
- static deserialize(data: ISerializedField): MultiSelectField;
26
- getInput(props: GetInputProps<this>): ReactNode;
27
- }
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import { ComponentProps } from "../typings";
3
- import { MultiSelectField } from "./MultiSelectField";
4
- export declare const MultiSelectInput: import("react").MemoExoticComponent<(props: ComponentProps<MultiSelectField>) => import("react/jsx-runtime").JSX.Element>;
@@ -1,26 +0,0 @@
1
- import { ChangeEvent, ReactNode } from "react";
2
- import { GetInputProps } from "../typings";
3
- import { BaseSelectField, BaseSelectFieldOptions } from "./BaseSelectField";
4
- import { RiMenuFoldLine } from "react-icons/ri";
5
- import { ISerializedField, SelectFieldOptionValue, SerializedSelectField } from "../../typings";
6
- /**
7
- * The options passed to the constructor of SelectField.
8
- */
9
- export type SelectFieldOptions = Omit<BaseSelectFieldOptions<SelectFieldOptionValue, "select">, "type">;
10
- export declare const emptySelectField: {
11
- type: string;
12
- options: never[];
13
- label: string;
14
- description: string;
15
- required: boolean;
16
- };
17
- export declare class SelectField extends BaseSelectField<SelectFieldOptionValue, "select"> {
18
- static readonly fieldTypeName = "Dropdown";
19
- static readonly fieldTypeDescription = "Allows the user to select a single option from a list of options.";
20
- static Icon: typeof RiMenuFoldLine;
21
- constructor(options: SelectFieldOptions);
22
- getValueFromChangeEvent(event: ChangeEvent<HTMLInputElement> | string): SelectFieldOptionValue;
23
- serialize(): SerializedSelectField;
24
- static deserialize(data: ISerializedField): SelectField;
25
- getInput(props: GetInputProps<this>): ReactNode;
26
- }
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import { ComponentProps } from "../typings";
3
- import { SelectField } from "./SelectField";
4
- export declare const SelectInput: import("react").MemoExoticComponent<(props: ComponentProps<SelectField>) => import("react/jsx-runtime").JSX.Element>;
@@ -1,4 +0,0 @@
1
- export * from "./SelectField";
2
- export * from "./SelectInput";
3
- export * from "./MultiSelectInput";
4
- export * from "./MultiSelectField";
@@ -1,26 +0,0 @@
1
- import { ReactNode } from "react";
2
- import { StringOrTextField, StringOrTextFieldOptions } from "../StringOrTextField";
3
- import { GetInputProps } from "../../typings";
4
- import { RiInputField } from "react-icons/ri";
5
- import { ISerializedField, SerializedStringField, StringInputType } from "../../../typings";
6
- export interface StringFieldOptions extends Omit<StringOrTextFieldOptions, "type"> {
7
- inputType?: StringInputType;
8
- }
9
- export declare const emptyStringField: {
10
- type: string;
11
- maximum_length: number;
12
- input_type: string;
13
- label: string;
14
- description: string;
15
- required: boolean;
16
- };
17
- export declare class StringField extends StringOrTextField<"string"> {
18
- static readonly fieldTypeName = "Short Text";
19
- static readonly fieldTypeDescription = "Short text fields can hold up to 500 characters on a single line.";
20
- readonly inputType: StringInputType;
21
- static Icon: typeof RiInputField;
22
- constructor(options: StringFieldOptions);
23
- serialize(): SerializedStringField;
24
- static deserialize(data: ISerializedField): StringField;
25
- getInput(props: GetInputProps<this>): ReactNode;
26
- }
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import { StringField } from "./StringField";
3
- import { ComponentProps } from "../../typings";
4
- export declare const StringInput: import("react").MemoExoticComponent<(props: ComponentProps<StringField>) => import("react/jsx-runtime").JSX.Element>;
@@ -1,2 +0,0 @@
1
- export * from "./StringField";
2
- export * from "./StringInput";
@@ -1,34 +0,0 @@
1
- import { NumberField, NumberFieldValue } from "../NumberField";
2
- import { BaseField, FieldOptions } from "../BaseField";
3
- import { InputFieldLevelValidator, InputValidator } from "../typings";
4
- import { SerializedStringField } from "../../typings";
5
- export interface StringOrTextFieldOptions extends FieldOptions<string> {
6
- minLength?: NumberFieldValue;
7
- maxLength?: NumberFieldValue;
8
- placeholder?: string;
9
- }
10
- export type SerializedStringOrTextField<TIdentifier extends "string" | "text"> = Omit<SerializedStringField, "type"> & {
11
- type: TIdentifier;
12
- };
13
- export declare abstract class StringOrTextField<TIdentifier extends "string" | "text"> extends BaseField<string, TIdentifier> {
14
- readonly minLength?: number;
15
- readonly maxLength: number;
16
- readonly placeholder: string;
17
- protected constructor(options: StringOrTextFieldOptions);
18
- /**
19
- * This function returns a function that validates that the value given for "minimum length" (when creating a new field) is less than or
20
- * equal to the value given for "maximum length".
21
- */
22
- static _validateMin: (path: string) => InputValidator<NumberFieldValue>;
23
- /**
24
- * This function returns a function that validates that the value given for "maximum length" (when creating a new field) is greater than or
25
- * equal to the value given for "minimum length".
26
- */
27
- static _validateMax: (path: string) => InputValidator<NumberFieldValue>;
28
- static getFieldCreationSchema(parentPath?: string): {
29
- field: NumberField;
30
- showDirectly: boolean;
31
- }[];
32
- getFieldValidators(): InputFieldLevelValidator<string>[];
33
- protected _serialize(): SerializedStringOrTextField<TIdentifier>;
34
- }
@@ -1,22 +0,0 @@
1
- import { ReactNode } from "react";
2
- import { StringOrTextField, StringOrTextFieldOptions } from "../StringOrTextField";
3
- import { GetInputProps } from "../../typings";
4
- import { RiAlignJustify } from "react-icons/ri";
5
- import { ISerializedField, SerializedTextField } from "../../../typings";
6
- export type TextFieldOptions = Omit<StringOrTextFieldOptions, "type">;
7
- export declare const emptyTextField: {
8
- type: string;
9
- maximum_length: number;
10
- label: string;
11
- description: string;
12
- required: boolean;
13
- };
14
- export declare class TextField extends StringOrTextField<"text"> {
15
- static readonly fieldTypeName = "Paragraph";
16
- static readonly fieldTypeDescription = "Paragraph fields can hold up to 10000 characters and can have multiple lines.";
17
- static Icon: typeof RiAlignJustify;
18
- constructor(options: TextFieldOptions);
19
- serialize(): SerializedTextField;
20
- static deserialize(data: ISerializedField): TextField;
21
- getInput(props: GetInputProps<this>): ReactNode;
22
- }
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import { TextField } from "./TextField";
3
- import { ComponentProps } from "../../typings";
4
- export declare const TextInput: import("react").MemoExoticComponent<(props: ComponentProps<TextField>) => import("react/jsx-runtime").JSX.Element>;
@@ -1,2 +0,0 @@
1
- export * from "./TextField";
2
- export * from "./TextInput";
@@ -1,2 +0,0 @@
1
- export * from "./StringField";
2
- export * from "./TextField";
@@ -1,44 +0,0 @@
1
- import { BaseField, ChildFieldOptions } from "../BaseField";
2
- import { GetInputProps, InputFieldLevelValidator } from "../typings";
3
- import { ChangeEvent, ReactNode } from "react";
4
- import { RiUpload2Line } from "react-icons/ri";
5
- import { NumberField } from "../NumberField";
6
- import { MultiSelectField } from "../SelectField";
7
- import { ISerializedField, SerializedUploadField } from "../../typings";
8
- export interface UploadFieldOptions extends ChildFieldOptions<File[]> {
9
- extensions?: string[];
10
- maximum_size?: number | string;
11
- maximum_files?: number | string;
12
- }
13
- export declare const emptyUploadField: {
14
- type: string;
15
- extensions: never[];
16
- maximum_size: undefined;
17
- maximum_files: number;
18
- label: string;
19
- description: string;
20
- required: boolean;
21
- };
22
- export declare class UploadField extends BaseField<File[], "upload"> {
23
- static readonly fieldTypeName = "Upload";
24
- static readonly fieldTypeDescription = "Allows a file to be uploaded.";
25
- readonly extensions?: string[];
26
- readonly maxFileSize: number | undefined;
27
- readonly maxFiles: number;
28
- readonly onlyValidateAfterTouched = false;
29
- static Icon: typeof RiUpload2Line;
30
- constructor(options: UploadFieldOptions);
31
- getValueFromChangeEvent(event: ChangeEvent<HTMLInputElement>): File[];
32
- protected isBlank(value: File[]): boolean;
33
- static getFieldCreationSchema(parentPath?: string): ({
34
- field: NumberField;
35
- showDirectly: boolean;
36
- } | {
37
- field: MultiSelectField;
38
- showDirectly: boolean;
39
- })[];
40
- getFieldValidators(): InputFieldLevelValidator<File[]>[];
41
- serialize(): SerializedUploadField;
42
- static deserialize(data: ISerializedField): UploadField;
43
- getInput(props: GetInputProps<this>): ReactNode;
44
- }
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import { UploadField } from "./UploadField";
3
- import { ComponentProps } from "../typings";
4
- export declare const UploadInput: import("react").MemoExoticComponent<(props: ComponentProps<UploadField>) => import("react/jsx-runtime").JSX.Element>;
@@ -1,2 +0,0 @@
1
- export * from "./UploadField";
2
- export * from "./UploadInput";
@@ -1 +0,0 @@
1
- export declare const convertBytesToLargestUnit: (bytes: number) => string;
@@ -1,106 +0,0 @@
1
- import { StringField, TextField } from "./StringOrTextFields";
2
- import { BooleanField } from "./BooleanField";
3
- import { DateField } from "./DateField";
4
- import { NumberField } from "./NumberField";
5
- import { MultiSelectField, SelectField } from "./SelectField";
6
- import { CustomField } from "./CustomField";
7
- import { MultiStringField } from "./MultiStringField";
8
- import { UploadField } from "./UploadField";
9
- import { QrField } from "./QrField";
10
- export declare const FieldTypeToClsMapping: {
11
- readonly date: typeof DateField;
12
- readonly number: typeof NumberField;
13
- readonly boolean: typeof BooleanField;
14
- readonly select: typeof SelectField;
15
- readonly string: typeof StringField;
16
- readonly text: typeof TextField;
17
- readonly custom: typeof CustomField;
18
- readonly upload: typeof UploadField;
19
- readonly qr: typeof QrField;
20
- readonly "multi-string": typeof MultiStringField;
21
- readonly "multi-select": typeof MultiSelectField;
22
- };
23
- export declare const FieldTypeToEmptyFieldMapping: {
24
- readonly date: {
25
- type: string;
26
- label: string;
27
- description: string;
28
- required: boolean;
29
- };
30
- readonly number: {
31
- type: string;
32
- minimum: number;
33
- maximum: number;
34
- integers: boolean;
35
- label: string;
36
- description: string;
37
- required: boolean;
38
- };
39
- readonly boolean: {
40
- type: string;
41
- label: string;
42
- description: string;
43
- required: boolean;
44
- };
45
- readonly select: {
46
- type: string;
47
- options: never[];
48
- label: string;
49
- description: string;
50
- required: boolean;
51
- };
52
- readonly string: {
53
- type: string;
54
- maximum_length: number;
55
- input_type: string;
56
- label: string;
57
- description: string;
58
- required: boolean;
59
- };
60
- readonly text: {
61
- type: string;
62
- maximum_length: number;
63
- label: string;
64
- description: string;
65
- required: boolean;
66
- };
67
- readonly custom: {
68
- type: string;
69
- label: string;
70
- description: string;
71
- required: boolean;
72
- };
73
- readonly upload: {
74
- type: string;
75
- extensions: never[];
76
- maximum_size: undefined;
77
- maximum_files: number;
78
- label: string;
79
- description: string;
80
- required: boolean;
81
- };
82
- readonly qr: {
83
- type: string;
84
- label: string;
85
- description: string;
86
- required: boolean;
87
- };
88
- readonly "multi-string": {
89
- type: string;
90
- minimum_length: number;
91
- maximum_length: null;
92
- label: string;
93
- description: string;
94
- required: boolean;
95
- };
96
- readonly "multi-select": {
97
- type: string;
98
- options: never[];
99
- label: string;
100
- description: string;
101
- required: boolean;
102
- };
103
- };
104
- export declare const maxFileSizeMB = 50;
105
- export declare const maxFileSizeKB: number;
106
- export declare const maxFileSizeB: number;
@@ -1,6 +0,0 @@
1
- import { GetInputProps } from "./typings";
2
- import { ReactNode } from "react";
3
- import { BaseField, BaseFormElement } from "./BaseField";
4
- import { FieldValue } from "../typings";
5
- export declare const useFieldInput: <TField extends BaseFormElement<import("../typings").FieldTypeIdentifier> | null>(field: TField, props: TField extends BaseFormElement ? GetInputProps<TField> : null) => ReactNode;
6
- export declare const useFieldInputs: (fields: BaseFormElement[], props: GetInputProps<BaseField<FieldValue>>) => ReactNode;
@@ -1,12 +0,0 @@
1
- export * from "./BaseField";
2
- export * from "./NumberField";
3
- export * from "./DateField";
4
- export * from "./StringOrTextFields";
5
- export * from "./BooleanField";
6
- export * from "./SelectField";
7
- export * from "./MultiStringField";
8
- export * from "./QrField";
9
- export * from "./FieldSection";
10
- export * from "./utils";
11
- export * from "./hooks";
12
- export * from "./typings";
@@ -1,27 +0,0 @@
1
- import { HTMLProps, ReactNode, ComponentProps as ReactComponentProps } from "react";
2
- import { Text } from "@radix-ui/themes";
3
- import { BaseField, BaseFormElement } from "./BaseField";
4
- import { Form, ISerializedField, SerializedFieldSection } from "../typings";
5
- import { FormikUserFormRevision } from "../builder";
6
- export interface SchemaMeta {
7
- readonly: boolean;
8
- }
9
- export interface ISchema {
10
- id?: string;
11
- fields: BaseFormElement[];
12
- meta: SchemaMeta;
13
- title: ReactNode;
14
- description?: ReactNode;
15
- }
16
- export type InputFieldLevelValidator<TValue> = (value: TValue | undefined) => string | null | undefined;
17
- export type InputFormLevelValidator<TValue> = (value: TValue | undefined, allValues: Form | FormikUserFormRevision) => string | null | undefined;
18
- export type InputValidator<TValue> = InputFieldLevelValidator<TValue> | InputFormLevelValidator<TValue>;
19
- export interface ComponentProps<TField extends BaseFormElement> extends Omit<HTMLProps<HTMLElement>, "color" | "size" | "ref" | "type" | "onChange" | "onBlur" | "value" | "defaultValue" | "name" | "dir"> {
20
- field: TField;
21
- formId: string;
22
- size?: ReactComponentProps<typeof Text>["size"];
23
- showInputOnly?: boolean;
24
- }
25
- export type GetInputProps<TField extends BaseFormElement> = Omit<ComponentProps<TField>, "field">;
26
- export type AnyField = BaseField<any, any>;
27
- export type ISerializedOnlyField = Exclude<ISerializedField, SerializedFieldSection>;
@@ -1,17 +0,0 @@
1
- import { AnyField, ISchema, ISerializedOnlyField, SchemaMeta } from "./typings";
2
- import { FieldSection } from "./FieldSection";
3
- import { FieldValue, ISerializedField, SerializedCondition } from "../typings";
4
- import { UserFormRevision } from "../../typings";
5
- /** Deserializes anything but a FieldSection.
6
- * @see `deserialize` for most use cases
7
- */
8
- export declare const deserializeField: (serializedField: ISerializedOnlyField) => AnyField;
9
- /** Deserializes anything */
10
- export declare const deserialize: (serialized: ISerializedField) => AnyField | FieldSection;
11
- export type PartialFormRevision = Pick<UserFormRevision, "title" | "fields" | "description"> & Partial<UserFormRevision>;
12
- export declare function formRevisionToSchema(formRevision: PartialFormRevision, meta?: Partial<SchemaMeta>): ISchema;
13
- export declare function flattenFields(schema: ISchema): AnyField[];
14
- export declare function decodeFormValues(schema: ISchema, values: Record<string, string>): Record<string, FieldValue>;
15
- export declare function encodeFormValues(schema: ISchema, values: Record<string, FieldValue>): Record<string, string>;
16
- export declare function valueIsFile(v: FieldValue | Promise<File>[] | undefined): v is File[] | Promise<File>[];
17
- export declare function isConditionMet<TValue extends FieldValue | Promise<File>[]>(condition: TValue extends FieldValue ? SerializedCondition<TValue> | null : null, value: TValue): boolean;
@@ -1,6 +0,0 @@
1
- export * from "./typings";
2
- export * from "./builder";
3
- export * from "./fields";
4
- export * from "./renderer";
5
- export * from "./provider";
6
- export { validateForm, initialFormValues } from "./utils";
@@ -1,5 +0,0 @@
1
- import { ComponentProps, PropsWithoutRef, FC } from "react";
2
- import { Theme } from "@radix-ui/themes";
3
- type OvermapFormsProviderProps = PropsWithoutRef<ComponentProps<typeof Theme>>;
4
- export declare const OvermapFormsProvider: FC<OvermapFormsProviderProps>;
5
- export {};