@form-engine-ts/react 2.9.3 → 2.9.4
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 +5 -2
- package/dist/index.cjs +416 -338
- package/dist/index.d.cts +19 -2
- package/dist/index.d.ts +19 -2
- package/dist/index.js +417 -339
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -234,6 +234,7 @@ interface BuilderSlotBaseProps {
|
|
|
234
234
|
readonly readOnly: boolean;
|
|
235
235
|
readonly actions: FormBuilderActions;
|
|
236
236
|
readonly components: Required<FormBuilderComponents>;
|
|
237
|
+
readonly translate: (key: string, params?: Record<string, unknown>) => string;
|
|
237
238
|
}
|
|
238
239
|
interface BuilderToolbarSlotProps extends BuilderSlotBaseProps {
|
|
239
240
|
readonly kind: "page" | "field" | "option";
|
|
@@ -250,6 +251,11 @@ interface BuilderFieldEditorSlotProps extends BuilderSlotBaseProps {
|
|
|
250
251
|
readonly index: number;
|
|
251
252
|
readonly currentLocale: string;
|
|
252
253
|
readonly policy?: FormPolicy;
|
|
254
|
+
readonly features?: {
|
|
255
|
+
readonly pages?: boolean;
|
|
256
|
+
readonly localization?: boolean;
|
|
257
|
+
readonly conditions?: boolean;
|
|
258
|
+
};
|
|
253
259
|
}
|
|
254
260
|
interface BuilderOptionEditorSlotProps extends BuilderSlotBaseProps {
|
|
255
261
|
readonly field: FormField & {
|
|
@@ -261,6 +267,11 @@ interface BuilderOptionEditorSlotProps extends BuilderSlotBaseProps {
|
|
|
261
267
|
}
|
|
262
268
|
interface BuilderPagesSlotProps extends BuilderSlotBaseProps {
|
|
263
269
|
readonly currentLocale: string;
|
|
270
|
+
readonly features?: {
|
|
271
|
+
readonly pages?: boolean;
|
|
272
|
+
readonly localization?: boolean;
|
|
273
|
+
readonly conditions?: boolean;
|
|
274
|
+
};
|
|
264
275
|
}
|
|
265
276
|
interface BuilderLocalizationSlotProps extends BuilderSlotBaseProps {
|
|
266
277
|
readonly currentLocale: string;
|
|
@@ -268,6 +279,8 @@ interface BuilderLocalizationSlotProps extends BuilderSlotBaseProps {
|
|
|
268
279
|
readonly onAutoTranslate: () => void;
|
|
269
280
|
readonly isTranslating: boolean;
|
|
270
281
|
readonly translationError?: string;
|
|
282
|
+
readonly policy?: FormPolicy;
|
|
283
|
+
readonly translationAdapterAvailable?: boolean;
|
|
271
284
|
}
|
|
272
285
|
interface BuilderTranslationActionsSlotProps extends BuilderSlotBaseProps {
|
|
273
286
|
readonly currentLocale: string;
|
|
@@ -276,7 +289,9 @@ interface BuilderTranslationActionsSlotProps extends BuilderSlotBaseProps {
|
|
|
276
289
|
readonly translationError?: string;
|
|
277
290
|
readonly translationReport?: TranslationReport;
|
|
278
291
|
readonly onClearTranslationError?: () => void;
|
|
292
|
+
readonly translationAdapterAvailable?: boolean;
|
|
279
293
|
}
|
|
294
|
+
type FormBuilderSectionName = "basicSettings" | "completionMessage" | "questions" | "addQuestion" | "localization";
|
|
280
295
|
interface FormBuilderSlots {
|
|
281
296
|
readonly toolbar?: ComponentType<BuilderToolbarSlotProps>;
|
|
282
297
|
readonly fieldEditor?: ComponentType<BuilderFieldEditorSlotProps>;
|
|
@@ -284,6 +299,7 @@ interface FormBuilderSlots {
|
|
|
284
299
|
readonly pages?: ComponentType<BuilderPagesSlotProps>;
|
|
285
300
|
readonly localization?: ComponentType<BuilderLocalizationSlotProps>;
|
|
286
301
|
readonly translationActions?: ComponentType<BuilderTranslationActionsSlotProps>;
|
|
302
|
+
readonly sectionOrder?: readonly FormBuilderSectionName[];
|
|
287
303
|
}
|
|
288
304
|
interface BuilderActionContext {
|
|
289
305
|
readonly action: "addField" | "removeField" | "moveField" | "changeFieldType" | "updateField" | "addOption" | "removeOption" | "moveOption" | "updateOption" | "addPage" | "removePage" | "movePage" | "updatePage" | "assignFieldToPage" | "addLocale" | "setDefaultLocale" | "setDisplayCondition" | "setSourceText" | "setLocaleTranslation";
|
|
@@ -419,10 +435,11 @@ interface FormBuilderProps {
|
|
|
419
435
|
readonly features?: FormBuilderFeatures;
|
|
420
436
|
readonly components?: FormBuilderComponents;
|
|
421
437
|
readonly slots?: FormBuilderSlots;
|
|
438
|
+
readonly sectionOrder?: readonly FormBuilderSectionName[];
|
|
422
439
|
readonly disableDefaultStyles?: boolean;
|
|
423
440
|
readonly unstyled?: boolean;
|
|
424
441
|
}
|
|
425
|
-
declare function FormBuilder({ schema, onChange, locale, translator, translationAdapter, translationOptions, onTranslationReport, policy, idFactory, factories, className, defaultFieldType, onActionError, createManualTranslationMetadata, readOnly, features, components: componentOverrides, slots, disableDefaultStyles, unstyled }: FormBuilderProps): react.JSX.Element;
|
|
442
|
+
declare function FormBuilder({ schema, onChange, locale, translator, translationAdapter, translationOptions, onTranslationReport, policy, idFactory, factories, className, defaultFieldType, onActionError, createManualTranslationMetadata, readOnly, features, components: componentOverrides, slots, sectionOrder, disableDefaultStyles, unstyled }: FormBuilderProps): react.JSX.Element;
|
|
426
443
|
|
|
427
444
|
type SubmitStatus = "idle" | "submitting" | "success" | "error";
|
|
428
445
|
interface FormContextValue {
|
|
@@ -495,4 +512,4 @@ interface StandaloneFormRendererProps extends FormRendererPresentationProps {
|
|
|
495
512
|
type FormRendererProps = FormRendererPresentationProps | StandaloneFormRendererProps;
|
|
496
513
|
declare function FormRenderer(props: FormRendererProps): react.JSX.Element;
|
|
497
514
|
|
|
498
|
-
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 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 FormBuilderSlots, type FormContextValue, FormProvider, type FormProviderProps, FormRenderer, type FormRendererPresentationProps, type FormRendererProps, type FormRendererSlots, type FormSubmitHandler, type FormSubmitState, type IconButtonProps, type InputComponentProps, type ManualTranslationContext, 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 };
|
|
515
|
+
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 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 IconButtonProps, type InputComponentProps, type ManualTranslationContext, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -234,6 +234,7 @@ interface BuilderSlotBaseProps {
|
|
|
234
234
|
readonly readOnly: boolean;
|
|
235
235
|
readonly actions: FormBuilderActions;
|
|
236
236
|
readonly components: Required<FormBuilderComponents>;
|
|
237
|
+
readonly translate: (key: string, params?: Record<string, unknown>) => string;
|
|
237
238
|
}
|
|
238
239
|
interface BuilderToolbarSlotProps extends BuilderSlotBaseProps {
|
|
239
240
|
readonly kind: "page" | "field" | "option";
|
|
@@ -250,6 +251,11 @@ interface BuilderFieldEditorSlotProps extends BuilderSlotBaseProps {
|
|
|
250
251
|
readonly index: number;
|
|
251
252
|
readonly currentLocale: string;
|
|
252
253
|
readonly policy?: FormPolicy;
|
|
254
|
+
readonly features?: {
|
|
255
|
+
readonly pages?: boolean;
|
|
256
|
+
readonly localization?: boolean;
|
|
257
|
+
readonly conditions?: boolean;
|
|
258
|
+
};
|
|
253
259
|
}
|
|
254
260
|
interface BuilderOptionEditorSlotProps extends BuilderSlotBaseProps {
|
|
255
261
|
readonly field: FormField & {
|
|
@@ -261,6 +267,11 @@ interface BuilderOptionEditorSlotProps extends BuilderSlotBaseProps {
|
|
|
261
267
|
}
|
|
262
268
|
interface BuilderPagesSlotProps extends BuilderSlotBaseProps {
|
|
263
269
|
readonly currentLocale: string;
|
|
270
|
+
readonly features?: {
|
|
271
|
+
readonly pages?: boolean;
|
|
272
|
+
readonly localization?: boolean;
|
|
273
|
+
readonly conditions?: boolean;
|
|
274
|
+
};
|
|
264
275
|
}
|
|
265
276
|
interface BuilderLocalizationSlotProps extends BuilderSlotBaseProps {
|
|
266
277
|
readonly currentLocale: string;
|
|
@@ -268,6 +279,8 @@ interface BuilderLocalizationSlotProps extends BuilderSlotBaseProps {
|
|
|
268
279
|
readonly onAutoTranslate: () => void;
|
|
269
280
|
readonly isTranslating: boolean;
|
|
270
281
|
readonly translationError?: string;
|
|
282
|
+
readonly policy?: FormPolicy;
|
|
283
|
+
readonly translationAdapterAvailable?: boolean;
|
|
271
284
|
}
|
|
272
285
|
interface BuilderTranslationActionsSlotProps extends BuilderSlotBaseProps {
|
|
273
286
|
readonly currentLocale: string;
|
|
@@ -276,7 +289,9 @@ interface BuilderTranslationActionsSlotProps extends BuilderSlotBaseProps {
|
|
|
276
289
|
readonly translationError?: string;
|
|
277
290
|
readonly translationReport?: TranslationReport;
|
|
278
291
|
readonly onClearTranslationError?: () => void;
|
|
292
|
+
readonly translationAdapterAvailable?: boolean;
|
|
279
293
|
}
|
|
294
|
+
type FormBuilderSectionName = "basicSettings" | "completionMessage" | "questions" | "addQuestion" | "localization";
|
|
280
295
|
interface FormBuilderSlots {
|
|
281
296
|
readonly toolbar?: ComponentType<BuilderToolbarSlotProps>;
|
|
282
297
|
readonly fieldEditor?: ComponentType<BuilderFieldEditorSlotProps>;
|
|
@@ -284,6 +299,7 @@ interface FormBuilderSlots {
|
|
|
284
299
|
readonly pages?: ComponentType<BuilderPagesSlotProps>;
|
|
285
300
|
readonly localization?: ComponentType<BuilderLocalizationSlotProps>;
|
|
286
301
|
readonly translationActions?: ComponentType<BuilderTranslationActionsSlotProps>;
|
|
302
|
+
readonly sectionOrder?: readonly FormBuilderSectionName[];
|
|
287
303
|
}
|
|
288
304
|
interface BuilderActionContext {
|
|
289
305
|
readonly action: "addField" | "removeField" | "moveField" | "changeFieldType" | "updateField" | "addOption" | "removeOption" | "moveOption" | "updateOption" | "addPage" | "removePage" | "movePage" | "updatePage" | "assignFieldToPage" | "addLocale" | "setDefaultLocale" | "setDisplayCondition" | "setSourceText" | "setLocaleTranslation";
|
|
@@ -419,10 +435,11 @@ interface FormBuilderProps {
|
|
|
419
435
|
readonly features?: FormBuilderFeatures;
|
|
420
436
|
readonly components?: FormBuilderComponents;
|
|
421
437
|
readonly slots?: FormBuilderSlots;
|
|
438
|
+
readonly sectionOrder?: readonly FormBuilderSectionName[];
|
|
422
439
|
readonly disableDefaultStyles?: boolean;
|
|
423
440
|
readonly unstyled?: boolean;
|
|
424
441
|
}
|
|
425
|
-
declare function FormBuilder({ schema, onChange, locale, translator, translationAdapter, translationOptions, onTranslationReport, policy, idFactory, factories, className, defaultFieldType, onActionError, createManualTranslationMetadata, readOnly, features, components: componentOverrides, slots, disableDefaultStyles, unstyled }: FormBuilderProps): react.JSX.Element;
|
|
442
|
+
declare function FormBuilder({ schema, onChange, locale, translator, translationAdapter, translationOptions, onTranslationReport, policy, idFactory, factories, className, defaultFieldType, onActionError, createManualTranslationMetadata, readOnly, features, components: componentOverrides, slots, sectionOrder, disableDefaultStyles, unstyled }: FormBuilderProps): react.JSX.Element;
|
|
426
443
|
|
|
427
444
|
type SubmitStatus = "idle" | "submitting" | "success" | "error";
|
|
428
445
|
interface FormContextValue {
|
|
@@ -495,4 +512,4 @@ interface StandaloneFormRendererProps extends FormRendererPresentationProps {
|
|
|
495
512
|
type FormRendererProps = FormRendererPresentationProps | StandaloneFormRendererProps;
|
|
496
513
|
declare function FormRenderer(props: FormRendererProps): react.JSX.Element;
|
|
497
514
|
|
|
498
|
-
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 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 FormBuilderSlots, type FormContextValue, FormProvider, type FormProviderProps, FormRenderer, type FormRendererPresentationProps, type FormRendererProps, type FormRendererSlots, type FormSubmitHandler, type FormSubmitState, type IconButtonProps, type InputComponentProps, type ManualTranslationContext, 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 };
|
|
515
|
+
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 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 IconButtonProps, type InputComponentProps, type ManualTranslationContext, 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 };
|