@form-engine-ts/react 2.9.1 → 2.9.3
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 +907 -777
- package/dist/index.d.cts +28 -8
- package/dist/index.d.ts +28 -8
- package/dist/index.js +907 -777
- 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;
|
|
@@ -177,13 +187,17 @@ interface BuilderSelectProps extends InputComponentProps {
|
|
|
177
187
|
readonly options: readonly BuilderSelectOption[];
|
|
178
188
|
}
|
|
179
189
|
interface BuilderCheckboxProps extends ComponentBaseProps {
|
|
190
|
+
readonly name?: string;
|
|
191
|
+
readonly required?: boolean;
|
|
192
|
+
readonly error?: boolean;
|
|
193
|
+
readonly helperText?: string;
|
|
180
194
|
readonly checked: boolean;
|
|
181
195
|
readonly onChange: (checked: boolean) => void;
|
|
182
196
|
readonly label: string;
|
|
183
197
|
}
|
|
184
198
|
interface BuilderSectionProps {
|
|
185
199
|
readonly id?: string;
|
|
186
|
-
readonly className?: string;
|
|
200
|
+
readonly className?: string | undefined;
|
|
187
201
|
readonly title?: string;
|
|
188
202
|
readonly description?: string;
|
|
189
203
|
readonly headingId?: string;
|
|
@@ -192,11 +206,14 @@ interface BuilderSectionProps {
|
|
|
192
206
|
readonly children: ReactNode;
|
|
193
207
|
}
|
|
194
208
|
interface BuilderFieldsetProps {
|
|
195
|
-
readonly className?: string;
|
|
209
|
+
readonly className?: string | undefined;
|
|
196
210
|
readonly legend?: string;
|
|
197
211
|
readonly disabled?: boolean;
|
|
198
212
|
readonly children: ReactNode;
|
|
199
213
|
}
|
|
214
|
+
interface BuilderErrorMessageProps extends ComponentBaseProps {
|
|
215
|
+
readonly message: string;
|
|
216
|
+
}
|
|
200
217
|
interface FormBuilderComponents {
|
|
201
218
|
readonly Button?: ComponentType<BuilderButtonProps>;
|
|
202
219
|
readonly IconButton?: ComponentType<BuilderIconButtonProps>;
|
|
@@ -209,6 +226,7 @@ interface FormBuilderComponents {
|
|
|
209
226
|
readonly ErrorMessage?: ComponentType<{
|
|
210
227
|
readonly message: string;
|
|
211
228
|
}>;
|
|
229
|
+
readonly renderIcon?: (actionType: BuilderActionIconType) => ReactNode;
|
|
212
230
|
}
|
|
213
231
|
type FormBuilderActions = Omit<FormBuilderResult, "schema" | "validationIssues">;
|
|
214
232
|
interface BuilderSlotBaseProps {
|
|
@@ -401,8 +419,10 @@ interface FormBuilderProps {
|
|
|
401
419
|
readonly features?: FormBuilderFeatures;
|
|
402
420
|
readonly components?: FormBuilderComponents;
|
|
403
421
|
readonly slots?: FormBuilderSlots;
|
|
422
|
+
readonly disableDefaultStyles?: boolean;
|
|
423
|
+
readonly unstyled?: boolean;
|
|
404
424
|
}
|
|
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;
|
|
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;
|
|
406
426
|
|
|
407
427
|
type SubmitStatus = "idle" | "submitting" | "success" | "error";
|
|
408
428
|
interface FormContextValue {
|
|
@@ -475,4 +495,4 @@ interface StandaloneFormRendererProps extends FormRendererPresentationProps {
|
|
|
475
495
|
type FormRendererProps = FormRendererPresentationProps | StandaloneFormRendererProps;
|
|
476
496
|
declare function FormRenderer(props: FormRendererProps): react.JSX.Element;
|
|
477
497
|
|
|
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 };
|
|
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 };
|
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;
|
|
@@ -177,13 +187,17 @@ interface BuilderSelectProps extends InputComponentProps {
|
|
|
177
187
|
readonly options: readonly BuilderSelectOption[];
|
|
178
188
|
}
|
|
179
189
|
interface BuilderCheckboxProps extends ComponentBaseProps {
|
|
190
|
+
readonly name?: string;
|
|
191
|
+
readonly required?: boolean;
|
|
192
|
+
readonly error?: boolean;
|
|
193
|
+
readonly helperText?: string;
|
|
180
194
|
readonly checked: boolean;
|
|
181
195
|
readonly onChange: (checked: boolean) => void;
|
|
182
196
|
readonly label: string;
|
|
183
197
|
}
|
|
184
198
|
interface BuilderSectionProps {
|
|
185
199
|
readonly id?: string;
|
|
186
|
-
readonly className?: string;
|
|
200
|
+
readonly className?: string | undefined;
|
|
187
201
|
readonly title?: string;
|
|
188
202
|
readonly description?: string;
|
|
189
203
|
readonly headingId?: string;
|
|
@@ -192,11 +206,14 @@ interface BuilderSectionProps {
|
|
|
192
206
|
readonly children: ReactNode;
|
|
193
207
|
}
|
|
194
208
|
interface BuilderFieldsetProps {
|
|
195
|
-
readonly className?: string;
|
|
209
|
+
readonly className?: string | undefined;
|
|
196
210
|
readonly legend?: string;
|
|
197
211
|
readonly disabled?: boolean;
|
|
198
212
|
readonly children: ReactNode;
|
|
199
213
|
}
|
|
214
|
+
interface BuilderErrorMessageProps extends ComponentBaseProps {
|
|
215
|
+
readonly message: string;
|
|
216
|
+
}
|
|
200
217
|
interface FormBuilderComponents {
|
|
201
218
|
readonly Button?: ComponentType<BuilderButtonProps>;
|
|
202
219
|
readonly IconButton?: ComponentType<BuilderIconButtonProps>;
|
|
@@ -209,6 +226,7 @@ interface FormBuilderComponents {
|
|
|
209
226
|
readonly ErrorMessage?: ComponentType<{
|
|
210
227
|
readonly message: string;
|
|
211
228
|
}>;
|
|
229
|
+
readonly renderIcon?: (actionType: BuilderActionIconType) => ReactNode;
|
|
212
230
|
}
|
|
213
231
|
type FormBuilderActions = Omit<FormBuilderResult, "schema" | "validationIssues">;
|
|
214
232
|
interface BuilderSlotBaseProps {
|
|
@@ -401,8 +419,10 @@ interface FormBuilderProps {
|
|
|
401
419
|
readonly features?: FormBuilderFeatures;
|
|
402
420
|
readonly components?: FormBuilderComponents;
|
|
403
421
|
readonly slots?: FormBuilderSlots;
|
|
422
|
+
readonly disableDefaultStyles?: boolean;
|
|
423
|
+
readonly unstyled?: boolean;
|
|
404
424
|
}
|
|
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;
|
|
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;
|
|
406
426
|
|
|
407
427
|
type SubmitStatus = "idle" | "submitting" | "success" | "error";
|
|
408
428
|
interface FormContextValue {
|
|
@@ -475,4 +495,4 @@ interface StandaloneFormRendererProps extends FormRendererPresentationProps {
|
|
|
475
495
|
type FormRendererProps = FormRendererPresentationProps | StandaloneFormRendererProps;
|
|
476
496
|
declare function FormRenderer(props: FormRendererProps): react.JSX.Element;
|
|
477
497
|
|
|
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 };
|
|
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 };
|