@form-engine-ts/react 2.9.5 → 3.0.0
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/README.md +13 -4
- package/dist/index.cjs +458 -145
- package/dist/index.d.cts +74 -5
- package/dist/index.d.ts +74 -5
- package/dist/index.js +458 -145
- package/dist/styles.css +51 -0
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode, ComponentType, MouseEvent } from 'react';
|
|
2
|
+
import { ReactNode, ComponentType, KeyboardEvent, MouseEvent } from 'react';
|
|
3
3
|
import { QuestionType, FormField, ChoiceOption, FormPage, FormSchema, DisplayCondition, JsonValue, SchemaIssue, FormPolicy, FieldOption, TranslationReport, ValidationError, FormValues, TranslationAdapter, AsyncTranslationAdapter, PopulateTranslationOptions, FormValue, ValidationIssue, AnswerValidationResult, FieldType } from '@form-engine-ts/core';
|
|
4
4
|
import { SensitiveDataFinding } from '@form-engine-ts/privacy';
|
|
5
5
|
|
|
@@ -139,6 +139,7 @@ interface ComponentBaseProps {
|
|
|
139
139
|
type BuilderActionIconType = "moveUp" | "moveDown" | "delete" | "add" | "edit" | "settings" | "translate" | "close" | "dragHandle";
|
|
140
140
|
interface BuilderButtonProps extends ComponentBaseProps {
|
|
141
141
|
readonly onClick?: () => void;
|
|
142
|
+
readonly noWrap?: boolean;
|
|
142
143
|
readonly variant?: "primary" | "secondary" | "danger";
|
|
143
144
|
readonly children: ReactNode;
|
|
144
145
|
readonly title?: string;
|
|
@@ -165,6 +166,7 @@ interface InputComponentProps extends ComponentBaseProps {
|
|
|
165
166
|
readonly helperText?: string;
|
|
166
167
|
readonly value: string;
|
|
167
168
|
readonly onChange: (value: string) => void;
|
|
169
|
+
readonly onKeyDown?: (event: KeyboardEvent<HTMLElement>) => void;
|
|
168
170
|
readonly placeholder?: string;
|
|
169
171
|
readonly maxLength?: number;
|
|
170
172
|
}
|
|
@@ -289,6 +291,11 @@ interface BuilderLocalizationSlotProps extends BuilderSlotBaseProps {
|
|
|
289
291
|
readonly policy?: FormPolicy;
|
|
290
292
|
readonly translationAdapterAvailable?: boolean;
|
|
291
293
|
}
|
|
294
|
+
interface LocalizationSummaryContext {
|
|
295
|
+
readonly defaultLocale: string;
|
|
296
|
+
readonly supportedLocales: readonly string[];
|
|
297
|
+
readonly totalLocales: number;
|
|
298
|
+
}
|
|
292
299
|
interface BuilderTranslationActionsSlotProps extends BuilderSlotBaseProps {
|
|
293
300
|
readonly currentLocale: string;
|
|
294
301
|
readonly onAutoTranslate: () => void;
|
|
@@ -338,7 +345,52 @@ interface SubmitResponse {
|
|
|
338
345
|
readonly submissionId?: string;
|
|
339
346
|
readonly submittedAt?: string;
|
|
340
347
|
}
|
|
341
|
-
|
|
348
|
+
interface SubmitContext {
|
|
349
|
+
readonly attemptId: string;
|
|
350
|
+
readonly formId: string;
|
|
351
|
+
readonly formVersion: number;
|
|
352
|
+
readonly locale?: string;
|
|
353
|
+
readonly submittedAt: string;
|
|
354
|
+
}
|
|
355
|
+
interface FormRendererMessages {
|
|
356
|
+
readonly submitButton?: string;
|
|
357
|
+
readonly submittingButton?: string;
|
|
358
|
+
readonly retryButton?: string;
|
|
359
|
+
readonly requiredField?: string;
|
|
360
|
+
readonly alreadySubmittedTitle?: string;
|
|
361
|
+
readonly alreadySubmittedMessage?: string;
|
|
362
|
+
readonly serverErrorSummary?: string;
|
|
363
|
+
readonly confirmSensitiveDataTitle?: string;
|
|
364
|
+
readonly confirmSensitiveDataMessage?: string;
|
|
365
|
+
readonly confirmButton?: string;
|
|
366
|
+
readonly cancelButton?: string;
|
|
367
|
+
}
|
|
368
|
+
interface FormSubmittedAnswerItem {
|
|
369
|
+
readonly fieldId: string;
|
|
370
|
+
readonly title: string;
|
|
371
|
+
readonly type: QuestionType;
|
|
372
|
+
readonly rawValue: unknown;
|
|
373
|
+
readonly displayValue: string;
|
|
374
|
+
readonly visible: boolean;
|
|
375
|
+
readonly metadata?: Readonly<Record<string, JsonValue>>;
|
|
376
|
+
}
|
|
377
|
+
interface FormCompletionSlotProps {
|
|
378
|
+
readonly message?: string;
|
|
379
|
+
readonly schema: FormSchema;
|
|
380
|
+
readonly answers: Readonly<Record<string, unknown>>;
|
|
381
|
+
readonly submittedItems: readonly FormSubmittedAnswerItem[];
|
|
382
|
+
readonly response?: SubmitResponse;
|
|
383
|
+
readonly onReset?: () => void;
|
|
384
|
+
}
|
|
385
|
+
interface FormServerErrorPayload {
|
|
386
|
+
readonly fieldErrors?: Readonly<Record<string, string>>;
|
|
387
|
+
readonly formError?: string;
|
|
388
|
+
}
|
|
389
|
+
declare class FormSubmissionError extends Error {
|
|
390
|
+
readonly payload: FormServerErrorPayload;
|
|
391
|
+
constructor(message: string, payload?: FormServerErrorPayload);
|
|
392
|
+
}
|
|
393
|
+
type FormSubmitHandler = (answers: FormValues, context: SubmitContext) => SubmitResponse | void | Promise<SubmitResponse | undefined> | Promise<void>;
|
|
342
394
|
type SubmissionGuardResult = {
|
|
343
395
|
readonly status: "allow";
|
|
344
396
|
} | {
|
|
@@ -352,6 +404,7 @@ type SubmissionGuardResult = {
|
|
|
352
404
|
};
|
|
353
405
|
type SubmissionGuard = (schema: FormSchema, values: Record<string, unknown>) => SubmissionGuardResult | Promise<SubmissionGuardResult>;
|
|
354
406
|
type FormSuccessRenderMode = "append" | "replace";
|
|
407
|
+
type SubmissionConfirmationRenderMode = "inline" | "replace" | "dialog";
|
|
355
408
|
type FormSubmitStatus = "idle" | "submitting" | "confirming" | "success" | "error";
|
|
356
409
|
/** @deprecated Use FormSubmitStatus instead. */
|
|
357
410
|
type FormSubmitState = "idle" | "submitting" | "confirming" | "success" | "error";
|
|
@@ -369,6 +422,10 @@ interface SubmissionConfirmationSlotProps {
|
|
|
369
422
|
readonly onConfirm: () => void;
|
|
370
423
|
readonly onCancel: () => void;
|
|
371
424
|
}
|
|
425
|
+
interface FormFieldsSlotProps {
|
|
426
|
+
readonly children: ReactNode;
|
|
427
|
+
readonly className?: string;
|
|
428
|
+
}
|
|
372
429
|
interface FormRendererSlots {
|
|
373
430
|
readonly renderHeader?: (props: {
|
|
374
431
|
readonly title: string;
|
|
@@ -397,9 +454,14 @@ interface FormRendererSlots {
|
|
|
397
454
|
readonly renderValidationSummary?: (props: {
|
|
398
455
|
readonly issues: readonly ValidationError[];
|
|
399
456
|
}) => ReactNode;
|
|
400
|
-
readonly renderCompletion?: (props: {
|
|
457
|
+
readonly renderCompletion?: (props: FormCompletionSlotProps & {
|
|
401
458
|
readonly message: string;
|
|
402
459
|
}) => ReactNode;
|
|
460
|
+
readonly renderSubmittedValues?: (props: {
|
|
461
|
+
readonly items: readonly FormSubmittedAnswerItem[];
|
|
462
|
+
readonly schema: FormSchema;
|
|
463
|
+
}) => ReactNode;
|
|
464
|
+
readonly renderFields?: (props: FormFieldsSlotProps) => ReactNode;
|
|
403
465
|
readonly renderSubmitError?: (props: {
|
|
404
466
|
readonly error: Error;
|
|
405
467
|
readonly onRetry?: () => void;
|
|
@@ -467,10 +529,11 @@ interface FormContextValue {
|
|
|
467
529
|
readonly submitError: Error | null;
|
|
468
530
|
readonly isSubmitting: boolean;
|
|
469
531
|
readonly setValue: (fieldId: string, value: FormValue) => void;
|
|
532
|
+
readonly setServerErrors?: (fieldErrors: Readonly<Record<string, string>>) => void;
|
|
470
533
|
readonly restoreValues: (values: FormValues) => void;
|
|
471
534
|
readonly validatePage: (pageIndex: number) => AnswerValidationResult;
|
|
472
535
|
readonly reset: () => void;
|
|
473
|
-
readonly submit: (beforeSubmit?: BeforeSubmit,
|
|
536
|
+
readonly submit: (beforeSubmit?: BeforeSubmit, submitContext?: SubmitContext) => Promise<SubmitResult>;
|
|
474
537
|
readonly translate: (key: string, params?: Readonly<Record<string, string | number>>) => string;
|
|
475
538
|
}
|
|
476
539
|
interface FormProviderProps {
|
|
@@ -512,10 +575,16 @@ interface FormRendererPresentationProps extends SubmissionProtectionProps {
|
|
|
512
575
|
* Defaults to "append" for backwards compatibility.
|
|
513
576
|
*/
|
|
514
577
|
readonly successRenderMode?: FormSuccessRenderMode;
|
|
578
|
+
readonly submissionConfirmationRenderMode?: SubmissionConfirmationRenderMode;
|
|
579
|
+
readonly showHiddenFieldsInSummary?: boolean;
|
|
580
|
+
readonly fieldsClassName?: string;
|
|
515
581
|
/** @deprecated Use successRenderMode="replace" instead. */
|
|
516
582
|
readonly hideFormOnSuccess?: boolean;
|
|
517
583
|
readonly successMessageKey?: string;
|
|
518
584
|
readonly errorMessageKey?: string;
|
|
585
|
+
readonly attemptIdFactory?: () => string;
|
|
586
|
+
readonly messages?: Partial<FormRendererMessages>;
|
|
587
|
+
readonly messageResolver?: (key: keyof FormRendererMessages, defaultText: string) => string;
|
|
519
588
|
readonly autoSaveKey?: string;
|
|
520
589
|
readonly beforeSubmit?: BeforeSubmit;
|
|
521
590
|
readonly onDraftSave?: (draft: FormValues) => void;
|
|
@@ -532,4 +601,4 @@ interface StandaloneFormRendererProps extends FormRendererPresentationProps {
|
|
|
532
601
|
type FormRendererProps = FormRendererPresentationProps | StandaloneFormRendererProps;
|
|
533
602
|
declare function FormRenderer(props: FormRendererProps): react.JSX.Element;
|
|
534
603
|
|
|
535
|
-
export { type BeforeSubmit, type BuilderActionContext, type BuilderActionError, type BuilderActionIconType, type BuilderActionResult, type BuilderButtonProps, type BuilderCheckboxProps, type BuilderErrorMessageProps, type BuilderFactories, type BuilderFieldEditorSlotProps, type BuilderFieldsetProps, type BuilderIconButtonProps, type BuilderIdKind, type BuilderLocalizationSlotProps, type BuilderOptionEditorSlotProps, type BuilderPagesSlotProps, type BuilderPolicy, type BuilderSectionProps, type BuilderSelectOption, type BuilderSelectProps, type BuilderSlotActions, type BuilderTextAreaProps, type BuilderTextInputProps, type BuilderTextTarget, type BuilderToolbarSlotProps, type BuilderTranslationActionsSlotProps, type ComponentBaseProps, type FieldComponentProps, type FieldComponents, type FieldState, FormBuilder, type FormBuilderActions, type FormBuilderComponents, type FormBuilderFeatures, type FormBuilderOptions, type FormBuilderProps, type FormBuilderResult, type FormBuilderSectionName, type FormBuilderSlots, type FormContextValue, FormProvider, type FormProviderProps, FormRenderer, type FormRendererPresentationProps, type FormRendererProps, type FormRendererSlots, type FormSubmitHandler, type FormSubmitState, type FormSubmitStatus, type FormSuccessRenderMode, type IconButtonProps, type InputComponentProps, type ManualTranslationContext, type ManualTranslationTarget, type RenderSubmitButtonProps, type StandaloneFormRendererProps, type SubmissionAttempt, type SubmissionAttemptStore, type SubmissionConfirmationSlotProps, type SubmissionGuard, type SubmissionGuardResult, type SubmissionProtectionProps, type SubmissionReceipt, type SubmissionReceiptQuery, type SubmissionReceiptStore, type SubmitResponse, type SubmitResult, type SubmitStatus, type UseSubmissionReceiptsResult, createLocalStorageSubmissionAttemptStore, createLocalStorageSubmissionReceiptStore, resolveInitialFieldType, submissionReceiptQueryKey, useField, useForm, useFormBuilder, useSubmissionReceipts };
|
|
604
|
+
export { type BeforeSubmit, type BuilderActionContext, type BuilderActionError, type BuilderActionIconType, type BuilderActionResult, type BuilderButtonProps, type BuilderCheckboxProps, type BuilderErrorMessageProps, type BuilderFactories, type BuilderFieldEditorSlotProps, type BuilderFieldsetProps, type BuilderIconButtonProps, type BuilderIdKind, type BuilderLocalizationSlotProps, type BuilderOptionEditorSlotProps, type BuilderPagesSlotProps, type BuilderPolicy, type BuilderSectionProps, type BuilderSelectOption, type BuilderSelectProps, type BuilderSlotActions, type BuilderTextAreaProps, type BuilderTextInputProps, type BuilderTextTarget, type BuilderToolbarSlotProps, type BuilderTranslationActionsSlotProps, type ComponentBaseProps, type FieldComponentProps, type FieldComponents, type FieldState, FormBuilder, type FormBuilderActions, type FormBuilderComponents, type FormBuilderFeatures, type FormBuilderOptions, type FormBuilderProps, type FormBuilderResult, type FormBuilderSectionName, type FormBuilderSlots, type FormCompletionSlotProps, type FormContextValue, type FormFieldsSlotProps, FormProvider, type FormProviderProps, FormRenderer, type FormRendererMessages, type FormRendererPresentationProps, type FormRendererProps, type FormRendererSlots, type FormServerErrorPayload, FormSubmissionError, type FormSubmitHandler, type FormSubmitState, type FormSubmitStatus, type FormSubmittedAnswerItem, type FormSuccessRenderMode, type IconButtonProps, type InputComponentProps, type LocalizationSummaryContext, type ManualTranslationContext, type ManualTranslationTarget, type RenderSubmitButtonProps, type StandaloneFormRendererProps, type SubmissionAttempt, type SubmissionAttemptStore, type SubmissionConfirmationRenderMode, type SubmissionConfirmationSlotProps, type SubmissionGuard, type SubmissionGuardResult, type SubmissionProtectionProps, type SubmissionReceipt, type SubmissionReceiptQuery, type SubmissionReceiptStore, type SubmitContext, type SubmitResponse, type SubmitResult, type SubmitStatus, type UseSubmissionReceiptsResult, createLocalStorageSubmissionAttemptStore, createLocalStorageSubmissionReceiptStore, resolveInitialFieldType, submissionReceiptQueryKey, useField, useForm, useFormBuilder, useSubmissionReceipts };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode, ComponentType, MouseEvent } from 'react';
|
|
2
|
+
import { ReactNode, ComponentType, KeyboardEvent, MouseEvent } from 'react';
|
|
3
3
|
import { QuestionType, FormField, ChoiceOption, FormPage, FormSchema, DisplayCondition, JsonValue, SchemaIssue, FormPolicy, FieldOption, TranslationReport, ValidationError, FormValues, TranslationAdapter, AsyncTranslationAdapter, PopulateTranslationOptions, FormValue, ValidationIssue, AnswerValidationResult, FieldType } from '@form-engine-ts/core';
|
|
4
4
|
import { SensitiveDataFinding } from '@form-engine-ts/privacy';
|
|
5
5
|
|
|
@@ -139,6 +139,7 @@ interface ComponentBaseProps {
|
|
|
139
139
|
type BuilderActionIconType = "moveUp" | "moveDown" | "delete" | "add" | "edit" | "settings" | "translate" | "close" | "dragHandle";
|
|
140
140
|
interface BuilderButtonProps extends ComponentBaseProps {
|
|
141
141
|
readonly onClick?: () => void;
|
|
142
|
+
readonly noWrap?: boolean;
|
|
142
143
|
readonly variant?: "primary" | "secondary" | "danger";
|
|
143
144
|
readonly children: ReactNode;
|
|
144
145
|
readonly title?: string;
|
|
@@ -165,6 +166,7 @@ interface InputComponentProps extends ComponentBaseProps {
|
|
|
165
166
|
readonly helperText?: string;
|
|
166
167
|
readonly value: string;
|
|
167
168
|
readonly onChange: (value: string) => void;
|
|
169
|
+
readonly onKeyDown?: (event: KeyboardEvent<HTMLElement>) => void;
|
|
168
170
|
readonly placeholder?: string;
|
|
169
171
|
readonly maxLength?: number;
|
|
170
172
|
}
|
|
@@ -289,6 +291,11 @@ interface BuilderLocalizationSlotProps extends BuilderSlotBaseProps {
|
|
|
289
291
|
readonly policy?: FormPolicy;
|
|
290
292
|
readonly translationAdapterAvailable?: boolean;
|
|
291
293
|
}
|
|
294
|
+
interface LocalizationSummaryContext {
|
|
295
|
+
readonly defaultLocale: string;
|
|
296
|
+
readonly supportedLocales: readonly string[];
|
|
297
|
+
readonly totalLocales: number;
|
|
298
|
+
}
|
|
292
299
|
interface BuilderTranslationActionsSlotProps extends BuilderSlotBaseProps {
|
|
293
300
|
readonly currentLocale: string;
|
|
294
301
|
readonly onAutoTranslate: () => void;
|
|
@@ -338,7 +345,52 @@ interface SubmitResponse {
|
|
|
338
345
|
readonly submissionId?: string;
|
|
339
346
|
readonly submittedAt?: string;
|
|
340
347
|
}
|
|
341
|
-
|
|
348
|
+
interface SubmitContext {
|
|
349
|
+
readonly attemptId: string;
|
|
350
|
+
readonly formId: string;
|
|
351
|
+
readonly formVersion: number;
|
|
352
|
+
readonly locale?: string;
|
|
353
|
+
readonly submittedAt: string;
|
|
354
|
+
}
|
|
355
|
+
interface FormRendererMessages {
|
|
356
|
+
readonly submitButton?: string;
|
|
357
|
+
readonly submittingButton?: string;
|
|
358
|
+
readonly retryButton?: string;
|
|
359
|
+
readonly requiredField?: string;
|
|
360
|
+
readonly alreadySubmittedTitle?: string;
|
|
361
|
+
readonly alreadySubmittedMessage?: string;
|
|
362
|
+
readonly serverErrorSummary?: string;
|
|
363
|
+
readonly confirmSensitiveDataTitle?: string;
|
|
364
|
+
readonly confirmSensitiveDataMessage?: string;
|
|
365
|
+
readonly confirmButton?: string;
|
|
366
|
+
readonly cancelButton?: string;
|
|
367
|
+
}
|
|
368
|
+
interface FormSubmittedAnswerItem {
|
|
369
|
+
readonly fieldId: string;
|
|
370
|
+
readonly title: string;
|
|
371
|
+
readonly type: QuestionType;
|
|
372
|
+
readonly rawValue: unknown;
|
|
373
|
+
readonly displayValue: string;
|
|
374
|
+
readonly visible: boolean;
|
|
375
|
+
readonly metadata?: Readonly<Record<string, JsonValue>>;
|
|
376
|
+
}
|
|
377
|
+
interface FormCompletionSlotProps {
|
|
378
|
+
readonly message?: string;
|
|
379
|
+
readonly schema: FormSchema;
|
|
380
|
+
readonly answers: Readonly<Record<string, unknown>>;
|
|
381
|
+
readonly submittedItems: readonly FormSubmittedAnswerItem[];
|
|
382
|
+
readonly response?: SubmitResponse;
|
|
383
|
+
readonly onReset?: () => void;
|
|
384
|
+
}
|
|
385
|
+
interface FormServerErrorPayload {
|
|
386
|
+
readonly fieldErrors?: Readonly<Record<string, string>>;
|
|
387
|
+
readonly formError?: string;
|
|
388
|
+
}
|
|
389
|
+
declare class FormSubmissionError extends Error {
|
|
390
|
+
readonly payload: FormServerErrorPayload;
|
|
391
|
+
constructor(message: string, payload?: FormServerErrorPayload);
|
|
392
|
+
}
|
|
393
|
+
type FormSubmitHandler = (answers: FormValues, context: SubmitContext) => SubmitResponse | void | Promise<SubmitResponse | undefined> | Promise<void>;
|
|
342
394
|
type SubmissionGuardResult = {
|
|
343
395
|
readonly status: "allow";
|
|
344
396
|
} | {
|
|
@@ -352,6 +404,7 @@ type SubmissionGuardResult = {
|
|
|
352
404
|
};
|
|
353
405
|
type SubmissionGuard = (schema: FormSchema, values: Record<string, unknown>) => SubmissionGuardResult | Promise<SubmissionGuardResult>;
|
|
354
406
|
type FormSuccessRenderMode = "append" | "replace";
|
|
407
|
+
type SubmissionConfirmationRenderMode = "inline" | "replace" | "dialog";
|
|
355
408
|
type FormSubmitStatus = "idle" | "submitting" | "confirming" | "success" | "error";
|
|
356
409
|
/** @deprecated Use FormSubmitStatus instead. */
|
|
357
410
|
type FormSubmitState = "idle" | "submitting" | "confirming" | "success" | "error";
|
|
@@ -369,6 +422,10 @@ interface SubmissionConfirmationSlotProps {
|
|
|
369
422
|
readonly onConfirm: () => void;
|
|
370
423
|
readonly onCancel: () => void;
|
|
371
424
|
}
|
|
425
|
+
interface FormFieldsSlotProps {
|
|
426
|
+
readonly children: ReactNode;
|
|
427
|
+
readonly className?: string;
|
|
428
|
+
}
|
|
372
429
|
interface FormRendererSlots {
|
|
373
430
|
readonly renderHeader?: (props: {
|
|
374
431
|
readonly title: string;
|
|
@@ -397,9 +454,14 @@ interface FormRendererSlots {
|
|
|
397
454
|
readonly renderValidationSummary?: (props: {
|
|
398
455
|
readonly issues: readonly ValidationError[];
|
|
399
456
|
}) => ReactNode;
|
|
400
|
-
readonly renderCompletion?: (props: {
|
|
457
|
+
readonly renderCompletion?: (props: FormCompletionSlotProps & {
|
|
401
458
|
readonly message: string;
|
|
402
459
|
}) => ReactNode;
|
|
460
|
+
readonly renderSubmittedValues?: (props: {
|
|
461
|
+
readonly items: readonly FormSubmittedAnswerItem[];
|
|
462
|
+
readonly schema: FormSchema;
|
|
463
|
+
}) => ReactNode;
|
|
464
|
+
readonly renderFields?: (props: FormFieldsSlotProps) => ReactNode;
|
|
403
465
|
readonly renderSubmitError?: (props: {
|
|
404
466
|
readonly error: Error;
|
|
405
467
|
readonly onRetry?: () => void;
|
|
@@ -467,10 +529,11 @@ interface FormContextValue {
|
|
|
467
529
|
readonly submitError: Error | null;
|
|
468
530
|
readonly isSubmitting: boolean;
|
|
469
531
|
readonly setValue: (fieldId: string, value: FormValue) => void;
|
|
532
|
+
readonly setServerErrors?: (fieldErrors: Readonly<Record<string, string>>) => void;
|
|
470
533
|
readonly restoreValues: (values: FormValues) => void;
|
|
471
534
|
readonly validatePage: (pageIndex: number) => AnswerValidationResult;
|
|
472
535
|
readonly reset: () => void;
|
|
473
|
-
readonly submit: (beforeSubmit?: BeforeSubmit,
|
|
536
|
+
readonly submit: (beforeSubmit?: BeforeSubmit, submitContext?: SubmitContext) => Promise<SubmitResult>;
|
|
474
537
|
readonly translate: (key: string, params?: Readonly<Record<string, string | number>>) => string;
|
|
475
538
|
}
|
|
476
539
|
interface FormProviderProps {
|
|
@@ -512,10 +575,16 @@ interface FormRendererPresentationProps extends SubmissionProtectionProps {
|
|
|
512
575
|
* Defaults to "append" for backwards compatibility.
|
|
513
576
|
*/
|
|
514
577
|
readonly successRenderMode?: FormSuccessRenderMode;
|
|
578
|
+
readonly submissionConfirmationRenderMode?: SubmissionConfirmationRenderMode;
|
|
579
|
+
readonly showHiddenFieldsInSummary?: boolean;
|
|
580
|
+
readonly fieldsClassName?: string;
|
|
515
581
|
/** @deprecated Use successRenderMode="replace" instead. */
|
|
516
582
|
readonly hideFormOnSuccess?: boolean;
|
|
517
583
|
readonly successMessageKey?: string;
|
|
518
584
|
readonly errorMessageKey?: string;
|
|
585
|
+
readonly attemptIdFactory?: () => string;
|
|
586
|
+
readonly messages?: Partial<FormRendererMessages>;
|
|
587
|
+
readonly messageResolver?: (key: keyof FormRendererMessages, defaultText: string) => string;
|
|
519
588
|
readonly autoSaveKey?: string;
|
|
520
589
|
readonly beforeSubmit?: BeforeSubmit;
|
|
521
590
|
readonly onDraftSave?: (draft: FormValues) => void;
|
|
@@ -532,4 +601,4 @@ interface StandaloneFormRendererProps extends FormRendererPresentationProps {
|
|
|
532
601
|
type FormRendererProps = FormRendererPresentationProps | StandaloneFormRendererProps;
|
|
533
602
|
declare function FormRenderer(props: FormRendererProps): react.JSX.Element;
|
|
534
603
|
|
|
535
|
-
export { type BeforeSubmit, type BuilderActionContext, type BuilderActionError, type BuilderActionIconType, type BuilderActionResult, type BuilderButtonProps, type BuilderCheckboxProps, type BuilderErrorMessageProps, type BuilderFactories, type BuilderFieldEditorSlotProps, type BuilderFieldsetProps, type BuilderIconButtonProps, type BuilderIdKind, type BuilderLocalizationSlotProps, type BuilderOptionEditorSlotProps, type BuilderPagesSlotProps, type BuilderPolicy, type BuilderSectionProps, type BuilderSelectOption, type BuilderSelectProps, type BuilderSlotActions, type BuilderTextAreaProps, type BuilderTextInputProps, type BuilderTextTarget, type BuilderToolbarSlotProps, type BuilderTranslationActionsSlotProps, type ComponentBaseProps, type FieldComponentProps, type FieldComponents, type FieldState, FormBuilder, type FormBuilderActions, type FormBuilderComponents, type FormBuilderFeatures, type FormBuilderOptions, type FormBuilderProps, type FormBuilderResult, type FormBuilderSectionName, type FormBuilderSlots, type FormContextValue, FormProvider, type FormProviderProps, FormRenderer, type FormRendererPresentationProps, type FormRendererProps, type FormRendererSlots, type FormSubmitHandler, type FormSubmitState, type FormSubmitStatus, type FormSuccessRenderMode, type IconButtonProps, type InputComponentProps, type ManualTranslationContext, type ManualTranslationTarget, type RenderSubmitButtonProps, type StandaloneFormRendererProps, type SubmissionAttempt, type SubmissionAttemptStore, type SubmissionConfirmationSlotProps, type SubmissionGuard, type SubmissionGuardResult, type SubmissionProtectionProps, type SubmissionReceipt, type SubmissionReceiptQuery, type SubmissionReceiptStore, type SubmitResponse, type SubmitResult, type SubmitStatus, type UseSubmissionReceiptsResult, createLocalStorageSubmissionAttemptStore, createLocalStorageSubmissionReceiptStore, resolveInitialFieldType, submissionReceiptQueryKey, useField, useForm, useFormBuilder, useSubmissionReceipts };
|
|
604
|
+
export { type BeforeSubmit, type BuilderActionContext, type BuilderActionError, type BuilderActionIconType, type BuilderActionResult, type BuilderButtonProps, type BuilderCheckboxProps, type BuilderErrorMessageProps, type BuilderFactories, type BuilderFieldEditorSlotProps, type BuilderFieldsetProps, type BuilderIconButtonProps, type BuilderIdKind, type BuilderLocalizationSlotProps, type BuilderOptionEditorSlotProps, type BuilderPagesSlotProps, type BuilderPolicy, type BuilderSectionProps, type BuilderSelectOption, type BuilderSelectProps, type BuilderSlotActions, type BuilderTextAreaProps, type BuilderTextInputProps, type BuilderTextTarget, type BuilderToolbarSlotProps, type BuilderTranslationActionsSlotProps, type ComponentBaseProps, type FieldComponentProps, type FieldComponents, type FieldState, FormBuilder, type FormBuilderActions, type FormBuilderComponents, type FormBuilderFeatures, type FormBuilderOptions, type FormBuilderProps, type FormBuilderResult, type FormBuilderSectionName, type FormBuilderSlots, type FormCompletionSlotProps, type FormContextValue, type FormFieldsSlotProps, FormProvider, type FormProviderProps, FormRenderer, type FormRendererMessages, type FormRendererPresentationProps, type FormRendererProps, type FormRendererSlots, type FormServerErrorPayload, FormSubmissionError, type FormSubmitHandler, type FormSubmitState, type FormSubmitStatus, type FormSubmittedAnswerItem, type FormSuccessRenderMode, type IconButtonProps, type InputComponentProps, type LocalizationSummaryContext, type ManualTranslationContext, type ManualTranslationTarget, type RenderSubmitButtonProps, type StandaloneFormRendererProps, type SubmissionAttempt, type SubmissionAttemptStore, type SubmissionConfirmationRenderMode, type SubmissionConfirmationSlotProps, type SubmissionGuard, type SubmissionGuardResult, type SubmissionProtectionProps, type SubmissionReceipt, type SubmissionReceiptQuery, type SubmissionReceiptStore, type SubmitContext, type SubmitResponse, type SubmitResult, type SubmitStatus, type UseSubmissionReceiptsResult, createLocalStorageSubmissionAttemptStore, createLocalStorageSubmissionReceiptStore, resolveInitialFieldType, submissionReceiptQueryKey, useField, useForm, useFormBuilder, useSubmissionReceipts };
|