@form-engine-ts/react 2.9.1 → 2.9.2
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 +6 -0
- package/dist/index.cjs +879 -764
- package/dist/index.d.cts +24 -8
- package/dist/index.d.ts +24 -8
- package/dist/index.js +879 -764
- package/dist/styles.css +12 -8
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -129,11 +129,14 @@ declare function useSubmissionReceipts(store: SubmissionReceiptStore, queries: r
|
|
|
129
129
|
|
|
130
130
|
interface ComponentBaseProps {
|
|
131
131
|
readonly id?: string;
|
|
132
|
-
readonly className?: string;
|
|
132
|
+
readonly className?: string | undefined;
|
|
133
133
|
readonly disabled?: boolean;
|
|
134
134
|
readonly readOnly?: boolean;
|
|
135
|
-
readonly "aria-label"?: string;
|
|
135
|
+
readonly "aria-label"?: string | undefined;
|
|
136
|
+
readonly "aria-describedby"?: string | undefined;
|
|
137
|
+
readonly "aria-labelledby"?: string | undefined;
|
|
136
138
|
}
|
|
139
|
+
type BuilderActionIconType = "moveUp" | "moveDown" | "delete" | "add" | "edit" | "settings" | "translate" | "close" | "dragHandle";
|
|
137
140
|
interface BuilderButtonProps extends ComponentBaseProps {
|
|
138
141
|
readonly onClick?: () => void;
|
|
139
142
|
readonly variant?: "primary" | "secondary" | "danger";
|
|
@@ -142,10 +145,17 @@ interface BuilderButtonProps extends ComponentBaseProps {
|
|
|
142
145
|
readonly action?: string;
|
|
143
146
|
readonly targetId?: string;
|
|
144
147
|
}
|
|
148
|
+
interface IconButtonProps extends ComponentBaseProps {
|
|
149
|
+
readonly onClick?: () => void;
|
|
150
|
+
readonly icon?: string | ReactNode;
|
|
151
|
+
readonly actionType?: BuilderActionIconType;
|
|
152
|
+
readonly title?: string;
|
|
153
|
+
}
|
|
145
154
|
interface BuilderIconButtonProps extends ComponentBaseProps {
|
|
146
155
|
readonly onClick?: () => void;
|
|
147
|
-
readonly icon
|
|
148
|
-
readonly
|
|
156
|
+
readonly icon?: string | ReactNode;
|
|
157
|
+
readonly actionType?: BuilderActionIconType;
|
|
158
|
+
readonly title?: string;
|
|
149
159
|
}
|
|
150
160
|
interface InputComponentProps extends ComponentBaseProps {
|
|
151
161
|
readonly name?: string;
|
|
@@ -183,7 +193,7 @@ interface BuilderCheckboxProps extends ComponentBaseProps {
|
|
|
183
193
|
}
|
|
184
194
|
interface BuilderSectionProps {
|
|
185
195
|
readonly id?: string;
|
|
186
|
-
readonly className?: string;
|
|
196
|
+
readonly className?: string | undefined;
|
|
187
197
|
readonly title?: string;
|
|
188
198
|
readonly description?: string;
|
|
189
199
|
readonly headingId?: string;
|
|
@@ -192,11 +202,14 @@ interface BuilderSectionProps {
|
|
|
192
202
|
readonly children: ReactNode;
|
|
193
203
|
}
|
|
194
204
|
interface BuilderFieldsetProps {
|
|
195
|
-
readonly className?: string;
|
|
205
|
+
readonly className?: string | undefined;
|
|
196
206
|
readonly legend?: string;
|
|
197
207
|
readonly disabled?: boolean;
|
|
198
208
|
readonly children: ReactNode;
|
|
199
209
|
}
|
|
210
|
+
interface BuilderErrorMessageProps extends ComponentBaseProps {
|
|
211
|
+
readonly message: string;
|
|
212
|
+
}
|
|
200
213
|
interface FormBuilderComponents {
|
|
201
214
|
readonly Button?: ComponentType<BuilderButtonProps>;
|
|
202
215
|
readonly IconButton?: ComponentType<BuilderIconButtonProps>;
|
|
@@ -209,6 +222,7 @@ interface FormBuilderComponents {
|
|
|
209
222
|
readonly ErrorMessage?: ComponentType<{
|
|
210
223
|
readonly message: string;
|
|
211
224
|
}>;
|
|
225
|
+
readonly renderIcon?: (actionType: BuilderActionIconType) => ReactNode;
|
|
212
226
|
}
|
|
213
227
|
type FormBuilderActions = Omit<FormBuilderResult, "schema" | "validationIssues">;
|
|
214
228
|
interface BuilderSlotBaseProps {
|
|
@@ -401,8 +415,10 @@ interface FormBuilderProps {
|
|
|
401
415
|
readonly features?: FormBuilderFeatures;
|
|
402
416
|
readonly components?: FormBuilderComponents;
|
|
403
417
|
readonly slots?: FormBuilderSlots;
|
|
418
|
+
readonly disableDefaultStyles?: boolean;
|
|
419
|
+
readonly unstyled?: boolean;
|
|
404
420
|
}
|
|
405
|
-
declare function FormBuilder({ schema, onChange, locale, translator, translationAdapter, translationOptions, onTranslationReport, policy, idFactory, factories, className, defaultFieldType, onActionError, createManualTranslationMetadata, readOnly, features, components: componentOverrides, slots }: FormBuilderProps): react.JSX.Element;
|
|
421
|
+
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;
|
|
406
422
|
|
|
407
423
|
type SubmitStatus = "idle" | "submitting" | "success" | "error";
|
|
408
424
|
interface FormContextValue {
|
|
@@ -475,4 +491,4 @@ interface StandaloneFormRendererProps extends FormRendererPresentationProps {
|
|
|
475
491
|
type FormRendererProps = FormRendererPresentationProps | StandaloneFormRendererProps;
|
|
476
492
|
declare function FormRenderer(props: FormRendererProps): react.JSX.Element;
|
|
477
493
|
|
|
478
|
-
export { type BeforeSubmit, type BuilderActionContext, type BuilderActionError, type BuilderActionResult, type BuilderButtonProps, type BuilderCheckboxProps, 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 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 };
|
|
494
|
+
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -129,11 +129,14 @@ declare function useSubmissionReceipts(store: SubmissionReceiptStore, queries: r
|
|
|
129
129
|
|
|
130
130
|
interface ComponentBaseProps {
|
|
131
131
|
readonly id?: string;
|
|
132
|
-
readonly className?: string;
|
|
132
|
+
readonly className?: string | undefined;
|
|
133
133
|
readonly disabled?: boolean;
|
|
134
134
|
readonly readOnly?: boolean;
|
|
135
|
-
readonly "aria-label"?: string;
|
|
135
|
+
readonly "aria-label"?: string | undefined;
|
|
136
|
+
readonly "aria-describedby"?: string | undefined;
|
|
137
|
+
readonly "aria-labelledby"?: string | undefined;
|
|
136
138
|
}
|
|
139
|
+
type BuilderActionIconType = "moveUp" | "moveDown" | "delete" | "add" | "edit" | "settings" | "translate" | "close" | "dragHandle";
|
|
137
140
|
interface BuilderButtonProps extends ComponentBaseProps {
|
|
138
141
|
readonly onClick?: () => void;
|
|
139
142
|
readonly variant?: "primary" | "secondary" | "danger";
|
|
@@ -142,10 +145,17 @@ interface BuilderButtonProps extends ComponentBaseProps {
|
|
|
142
145
|
readonly action?: string;
|
|
143
146
|
readonly targetId?: string;
|
|
144
147
|
}
|
|
148
|
+
interface IconButtonProps extends ComponentBaseProps {
|
|
149
|
+
readonly onClick?: () => void;
|
|
150
|
+
readonly icon?: string | ReactNode;
|
|
151
|
+
readonly actionType?: BuilderActionIconType;
|
|
152
|
+
readonly title?: string;
|
|
153
|
+
}
|
|
145
154
|
interface BuilderIconButtonProps extends ComponentBaseProps {
|
|
146
155
|
readonly onClick?: () => void;
|
|
147
|
-
readonly icon
|
|
148
|
-
readonly
|
|
156
|
+
readonly icon?: string | ReactNode;
|
|
157
|
+
readonly actionType?: BuilderActionIconType;
|
|
158
|
+
readonly title?: string;
|
|
149
159
|
}
|
|
150
160
|
interface InputComponentProps extends ComponentBaseProps {
|
|
151
161
|
readonly name?: string;
|
|
@@ -183,7 +193,7 @@ interface BuilderCheckboxProps extends ComponentBaseProps {
|
|
|
183
193
|
}
|
|
184
194
|
interface BuilderSectionProps {
|
|
185
195
|
readonly id?: string;
|
|
186
|
-
readonly className?: string;
|
|
196
|
+
readonly className?: string | undefined;
|
|
187
197
|
readonly title?: string;
|
|
188
198
|
readonly description?: string;
|
|
189
199
|
readonly headingId?: string;
|
|
@@ -192,11 +202,14 @@ interface BuilderSectionProps {
|
|
|
192
202
|
readonly children: ReactNode;
|
|
193
203
|
}
|
|
194
204
|
interface BuilderFieldsetProps {
|
|
195
|
-
readonly className?: string;
|
|
205
|
+
readonly className?: string | undefined;
|
|
196
206
|
readonly legend?: string;
|
|
197
207
|
readonly disabled?: boolean;
|
|
198
208
|
readonly children: ReactNode;
|
|
199
209
|
}
|
|
210
|
+
interface BuilderErrorMessageProps extends ComponentBaseProps {
|
|
211
|
+
readonly message: string;
|
|
212
|
+
}
|
|
200
213
|
interface FormBuilderComponents {
|
|
201
214
|
readonly Button?: ComponentType<BuilderButtonProps>;
|
|
202
215
|
readonly IconButton?: ComponentType<BuilderIconButtonProps>;
|
|
@@ -209,6 +222,7 @@ interface FormBuilderComponents {
|
|
|
209
222
|
readonly ErrorMessage?: ComponentType<{
|
|
210
223
|
readonly message: string;
|
|
211
224
|
}>;
|
|
225
|
+
readonly renderIcon?: (actionType: BuilderActionIconType) => ReactNode;
|
|
212
226
|
}
|
|
213
227
|
type FormBuilderActions = Omit<FormBuilderResult, "schema" | "validationIssues">;
|
|
214
228
|
interface BuilderSlotBaseProps {
|
|
@@ -401,8 +415,10 @@ interface FormBuilderProps {
|
|
|
401
415
|
readonly features?: FormBuilderFeatures;
|
|
402
416
|
readonly components?: FormBuilderComponents;
|
|
403
417
|
readonly slots?: FormBuilderSlots;
|
|
418
|
+
readonly disableDefaultStyles?: boolean;
|
|
419
|
+
readonly unstyled?: boolean;
|
|
404
420
|
}
|
|
405
|
-
declare function FormBuilder({ schema, onChange, locale, translator, translationAdapter, translationOptions, onTranslationReport, policy, idFactory, factories, className, defaultFieldType, onActionError, createManualTranslationMetadata, readOnly, features, components: componentOverrides, slots }: FormBuilderProps): react.JSX.Element;
|
|
421
|
+
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;
|
|
406
422
|
|
|
407
423
|
type SubmitStatus = "idle" | "submitting" | "success" | "error";
|
|
408
424
|
interface FormContextValue {
|
|
@@ -475,4 +491,4 @@ interface StandaloneFormRendererProps extends FormRendererPresentationProps {
|
|
|
475
491
|
type FormRendererProps = FormRendererPresentationProps | StandaloneFormRendererProps;
|
|
476
492
|
declare function FormRenderer(props: FormRendererProps): react.JSX.Element;
|
|
477
493
|
|
|
478
|
-
export { type BeforeSubmit, type BuilderActionContext, type BuilderActionError, type BuilderActionResult, type BuilderButtonProps, type BuilderCheckboxProps, 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 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 };
|
|
494
|
+
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 };
|