import * as React from "react"; import * as PropTypes from "prop-types"; import { FailedBackgroundJobsPanel } from "./components"; import { ReactUtilsType } from "../utils"; import { Theme } from "../themes/theme"; import { ContextProps } from "../ReactContext"; import Form from "@rjsf/core"; import { Field, Widget, TemplatesType, ErrorSchema } from "@rjsf/utils"; import ApiClient, { ApiClientImplementation } from "../ApiClient"; import KeyHandlerService, { ShortcutKeys } from "../services/key-handler-service"; import SettingsService, { Settings } from "../services/settings-service"; import FocusService from "../services/focus-service"; import BlockerService from "../services/blocker-service"; import CustomEventService from "../services/custom-event-service"; import SubmitHookService, { SubmitHook } from "../services/submit-hook-service"; import DOMIdService from "../services/dom-id-service"; import IdService from "../services/id-service"; import RootInstanceService from "../services/root-instance-service"; import SingletonMapService from "../services/singleton-map-service"; import { FieldProps, HasMaybeChildren, JSONSchema, Lang } from "../types"; import MultiActiveArrayService from "../services/multi-active-array-service"; import * as fields from "./fields"; import * as widgets from "./widgets"; import * as templates from "./templates"; export interface LajiFormProps extends HasMaybeChildren { apiClient?: ApiClientImplementation; lang?: Lang; formData?: any; schema?: any; uiSchema?: any; topOffset?: number; bottomOffset?: number; formContext?: any; uiSchemaContext?: UiSchemaContext; settings?: any; id?: string; googleApiKey?: string; notifier?: Notifier; fields?: { [name: string]: Field; }; widgets?: { [name: string]: Widget; }; templates?: { [name: string]: TemplatesType; }; autoFocus?: boolean; componentDidMount?: () => void; onError?: (e: Error, i: React.ErrorInfo) => void; onChange?: (formData: any) => void; optimizeOnChange?: boolean; showShortcutButton?: boolean; renderSubmit?: boolean; submitText?: string; onSubmit?: (data: { formData: any; }) => void; onValidationError?: (extraErrors: ErrorSchema) => void; validators?: any; warnings?: any; onSettingsChange?: (settings: any) => void; mediaMetadata?: MediaMetadata; theme?: Theme; lajiGeoServerAddress?: string; extraErrors?: ErrorSchema; } export interface LajiFormState { submitHooks?: SubmitHook[]; formContext: FormContext; formData?: any; extraErrors?: ErrorSchema; externalErrors?: ErrorSchema; error?: boolean; runningSubmitHooks?: boolean; } export interface MediaMetadata { capturerVerbatim?: string | string[]; intellectualOwner: string; intellectualRights: string; } export interface FormContext { translations: ByLang; lang: Lang; uiSchemaContext: any; formRef: React.RefObject