extended-dynamic-forms
Version:
Extended React JSON Schema Form (RJSF) v6 with custom components, widgets, templates, layouts, and form events
209 lines (207 loc) • 12.8 kB
TypeScript
import { default as React } from 'react';
import { default as ReactDOM } from 'react-dom/client';
import { default as dayjs } from 'dayjs';
import * as antd from 'antd';
import * as ExtendedDynamicFormsExports from './index';
declare function createForm(config: {
container: string | HTMLElement;
schema: any;
uiSchema?: any;
formData?: any;
onChange?: (data: any) => void;
onSubmit?: (data: any) => void;
onError?: (errors: any) => void;
conditionals?: any;
webhooks?: any;
widgets?: any;
fields?: any;
}): {
setFormData: (data: any) => void;
destroy: () => void;
};
declare function createWizardForm(config: {
container: string | HTMLElement;
schema: any;
uiSchema?: any;
formData?: any;
onStepChange?: (step: number, data: any) => void;
onSubmit?: (data: any) => void;
conditionals?: any;
webhooks?: any;
}): {
destroy: () => void;
};
declare const ExtendedDynamicForms: {
utils: {
createSchema: (properties: any) => {
type: string;
properties: any;
required: string[];
};
createUiSchema: (fields: any) => any;
widgets: {
text: string;
textarea: string;
select: string;
checkbox: string;
radio: string;
date: string;
datetime: string;
email: string;
password: string;
number: string;
file: string;
hidden: string;
};
};
validator: import('@rjsf/validator-ajv8/lib/validator.js').default<any, ExtendedDynamicFormsExports.RJSFSchema, any>;
ExtendedForm: React.ForwardRefExoticComponent<Omit<ExtendedDynamicFormsExports.ExtendedFormProps, "ref"> & React.RefAttributes<any>>;
WizardForm: typeof ExtendedDynamicFormsExports.WizardForm;
customFields: {
address: React.FC<ExtendedDynamicFormsExports.FieldProps<any, ExtendedDynamicFormsExports.RJSFSchema, any>>;
phone: React.FC<ExtendedDynamicFormsExports.FieldProps<any, ExtendedDynamicFormsExports.RJSFSchema, any>>;
currency: React.FC<ExtendedDynamicFormsExports.FieldProps<any, ExtendedDynamicFormsExports.RJSFSchema, any>>;
};
customTemplates: {
FieldTemplate: React.FC<ExtendedDynamicFormsExports.FieldTemplateProps>;
ArrayFieldTemplate: (props: ExtendedDynamicFormsExports.ArrayFieldTemplateProps) => import("react/jsx-runtime").JSX.Element;
ArrayFieldItemTemplate: (props: import('@rjsf/utils').ArrayFieldItemTemplateType) => import("react/jsx-runtime").JSX.Element;
WizardObjectFieldTemplate: React.FC<ExtendedDynamicFormsExports.ObjectFieldTemplateProps>;
WizardSectionTemplate: React.FC<import('./layouts/wizard/WizardSectionTemplate').WizardSectionTemplateProps>;
ButtonTemplates: {
SubmitButton: React.FC<import('@rjsf/utils').SubmitButtonProps>;
};
};
AddressField: React.FC<ExtendedDynamicFormsExports.FieldProps<any, ExtendedDynamicFormsExports.RJSFSchema, any>>;
PhoneField: React.FC<ExtendedDynamicFormsExports.FieldProps<any, ExtendedDynamicFormsExports.RJSFSchema, any>>;
CurrencyField: React.FC<ExtendedDynamicFormsExports.FieldProps<any, ExtendedDynamicFormsExports.RJSFSchema, any>>;
FieldTemplate: React.FC<ExtendedDynamicFormsExports.FieldTemplateProps>;
ArrayFieldTemplate: (props: ExtendedDynamicFormsExports.ArrayFieldTemplateProps) => import("react/jsx-runtime").JSX.Element;
ArrayFieldItemTemplate: (props: import('@rjsf/utils').ArrayFieldItemTemplateType) => import("react/jsx-runtime").JSX.Element;
WizardObjectFieldTemplate: React.FC<ExtendedDynamicFormsExports.ObjectFieldTemplateProps>;
WizardSectionTemplate: React.FC<import('./layouts/wizard/WizardSectionTemplate').WizardSectionTemplateProps>;
SubmitButton: React.FC<import('@rjsf/utils').SubmitButtonProps>;
customWidgets: {
TextWidget: typeof ExtendedDynamicFormsExports.EnhancedTextWidget;
TextareaWidget: typeof ExtendedDynamicFormsExports.EnhancedTextareaWidget;
SelectWidget: typeof ExtendedDynamicFormsExports.EnhancedSelectWidget;
CheckboxWidget: typeof ExtendedDynamicFormsExports.EnhancedCheckboxWidget;
RadioWidget: typeof ExtendedDynamicFormsExports.EnhancedRadioWidget;
UpDownWidget: typeof ExtendedDynamicFormsExports.EnhancedNumberWidget;
FileWidget: typeof ExtendedDynamicFormsExports.FileUploadWidget;
tel: typeof ExtendedDynamicFormsExports.TelephoneWidget;
email: typeof ExtendedDynamicFormsExports.EmailWidget;
url: typeof ExtendedDynamicFormsExports.URLWidget;
password: typeof ExtendedDynamicFormsExports.PasswordWidget;
date: typeof import('./widgets/enhanced/EnhancedWidgets').DateWidget;
'datetime-local': typeof ExtendedDynamicFormsExports.DateTimeWidget;
TelWidget: typeof ExtendedDynamicFormsExports.TelephoneWidget;
EmailWidget: typeof ExtendedDynamicFormsExports.EmailWidget;
URLWidget: typeof ExtendedDynamicFormsExports.URLWidget;
PasswordWidget: typeof ExtendedDynamicFormsExports.PasswordWidget;
DateWidget: typeof import('./widgets/enhanced/EnhancedWidgets').DateWidget;
DateTimeWidget: typeof ExtendedDynamicFormsExports.DateTimeWidget;
color: React.FC<ExtendedDynamicFormsExports.WidgetProps<any, ExtendedDynamicFormsExports.RJSFSchema, any>>;
file: React.FC<ExtendedDynamicFormsExports.WidgetProps<any, ExtendedDynamicFormsExports.RJSFSchema, any>>;
range: React.FC<ExtendedDynamicFormsExports.WidgetProps<any, ExtendedDynamicFormsExports.RJSFSchema, any>>;
rating: React.FC<ExtendedDynamicFormsExports.WidgetProps<any, ExtendedDynamicFormsExports.RJSFSchema, any>>;
};
ColorWidget: React.FC<ExtendedDynamicFormsExports.WidgetProps<any, ExtendedDynamicFormsExports.RJSFSchema, any>>;
DateWidget: React.FC<ExtendedDynamicFormsExports.WidgetProps<any, ExtendedDynamicFormsExports.RJSFSchema, any>>;
FileWidget: React.FC<ExtendedDynamicFormsExports.WidgetProps<any, ExtendedDynamicFormsExports.RJSFSchema, any>>;
RangeWidget: React.FC<ExtendedDynamicFormsExports.WidgetProps<any, ExtendedDynamicFormsExports.RJSFSchema, any>>;
RatingWidget: React.FC<ExtendedDynamicFormsExports.WidgetProps<any, ExtendedDynamicFormsExports.RJSFSchema, any>>;
EnhancedTextWidget: typeof ExtendedDynamicFormsExports.EnhancedTextWidget;
EnhancedTextareaWidget: typeof ExtendedDynamicFormsExports.EnhancedTextareaWidget;
EnhancedSelectWidget: typeof ExtendedDynamicFormsExports.EnhancedSelectWidget;
EnhancedCheckboxWidget: typeof ExtendedDynamicFormsExports.EnhancedCheckboxWidget;
EnhancedRadioWidget: typeof ExtendedDynamicFormsExports.EnhancedRadioWidget;
EnhancedNumberWidget: typeof ExtendedDynamicFormsExports.EnhancedNumberWidget;
TelephoneWidget: typeof ExtendedDynamicFormsExports.TelephoneWidget;
EmailWidget: typeof ExtendedDynamicFormsExports.EmailWidget;
URLWidget: typeof ExtendedDynamicFormsExports.URLWidget;
PasswordWidget: typeof ExtendedDynamicFormsExports.PasswordWidget;
DateTimeWidget: typeof ExtendedDynamicFormsExports.DateTimeWidget;
FileUploadWidget: typeof ExtendedDynamicFormsExports.FileUploadWidget;
enhancedWidgets: {
TextWidget: typeof ExtendedDynamicFormsExports.EnhancedTextWidget;
TextareaWidget: typeof ExtendedDynamicFormsExports.EnhancedTextareaWidget;
SelectWidget: typeof ExtendedDynamicFormsExports.EnhancedSelectWidget;
CheckboxWidget: typeof ExtendedDynamicFormsExports.EnhancedCheckboxWidget;
RadioWidget: typeof ExtendedDynamicFormsExports.EnhancedRadioWidget;
UpDownWidget: typeof ExtendedDynamicFormsExports.EnhancedNumberWidget;
FileWidget: typeof ExtendedDynamicFormsExports.FileUploadWidget;
tel: typeof ExtendedDynamicFormsExports.TelephoneWidget;
email: typeof ExtendedDynamicFormsExports.EmailWidget;
url: typeof ExtendedDynamicFormsExports.URLWidget;
password: typeof ExtendedDynamicFormsExports.PasswordWidget;
date: typeof import('./widgets/enhanced/EnhancedWidgets').DateWidget;
'datetime-local': typeof ExtendedDynamicFormsExports.DateTimeWidget;
TelWidget: typeof ExtendedDynamicFormsExports.TelephoneWidget;
EmailWidget: typeof ExtendedDynamicFormsExports.EmailWidget;
URLWidget: typeof ExtendedDynamicFormsExports.URLWidget;
PasswordWidget: typeof ExtendedDynamicFormsExports.PasswordWidget;
DateWidget: typeof import('./widgets/enhanced/EnhancedWidgets').DateWidget;
DateTimeWidget: typeof ExtendedDynamicFormsExports.DateTimeWidget;
};
WizardLayout: React.FC<import('./layouts/wizard/WizardLayout').WizardLayoutProps>;
ProgressIndicator: React.FC<import('./layouts/wizard/ProgressIndicator').ProgressIndicatorProps>;
StepNavigation: React.FC<import('./layouts/wizard/StepNavigation').StepNavigationProps>;
WizardNavigation: React.FC<import('./layouts/wizard/WizardNavigation').WizardNavigationProps>;
FormEventManager: typeof ExtendedDynamicFormsExports.FormEventManager;
FormEventHub: typeof ExtendedDynamicFormsExports.FormEventHub;
FormEventProvider: React.FC<import('./events/FormEventContext').FormEventProviderProps>;
useFormEventHub: () => import('./events/FormEventContext').FormEventContextType;
useFieldEventHandlers: (fieldId: string, schema?: any, fieldPath?: string[]) => {
onFocus: (value: any) => Promise<void>;
onBlur: (value: any) => Promise<void>;
onChange: (value: any) => Promise<void>;
};
ConditionalProcessor: typeof ExtendedDynamicFormsExports.ConditionalProcessor;
SimpleConditionalEngine: typeof ExtendedDynamicFormsExports.ConditionalProcessor;
DynamicArrayConditionalEngine: typeof ExtendedDynamicFormsExports.DynamicArrayConditionalEngine;
defaultActions: ExtendedDynamicFormsExports.ConditionalActions;
remove: ExtendedDynamicFormsExports.ConditionalAction;
require: ExtendedDynamicFormsExports.ConditionalAction;
uiAppend: ExtendedDynamicFormsExports.ConditionalAction;
uiOverride: ExtendedDynamicFormsExports.ConditionalAction;
uiReplace: ExtendedDynamicFormsExports.ConditionalAction;
enable: ExtendedDynamicFormsExports.ConditionalAction;
disable: ExtendedDynamicFormsExports.ConditionalAction;
optional: ExtendedDynamicFormsExports.ConditionalAction;
show: ExtendedDynamicFormsExports.ConditionalAction;
transformJsonRulesEngine: typeof ExtendedDynamicFormsExports.transformJsonRulesEngine;
smartTransformJsonRulesEngine: typeof ExtendedDynamicFormsExports.transformJsonRulesEngine;
Engine: any;
deepEquals(obj1: any, obj2: any): boolean;
formDataUtils: {
cloneFormData: (data: any) => any;
mergeFormData: (current: any, updates: any) => any;
getNestedValue: (data: any, path: string) => any;
setNestedValue: (data: any, path: string, value: any) => any;
removeEmptyValues: (data: any) => any;
};
schemaUtils: {
getRequiredFields: (schema: ExtendedDynamicFormsExports.RJSFSchema) => string[];
isFieldRequired: (schema: ExtendedDynamicFormsExports.RJSFSchema, fieldName: string) => boolean;
getFieldSchema: (schema: ExtendedDynamicFormsExports.RJSFSchema, path: string) => ExtendedDynamicFormsExports.RJSFSchema | undefined;
mergeSchemas: (schema1: ExtendedDynamicFormsExports.RJSFSchema, schema2: ExtendedDynamicFormsExports.RJSFSchema) => ExtendedDynamicFormsExports.RJSFSchema;
getAllFieldPaths: (schema: ExtendedDynamicFormsExports.RJSFSchema, prefix?: string) => string[];
};
validationUtils: {
isValidEmail: (email: string) => boolean;
isValidPhone: (phone: string) => boolean;
isValidUrl: (url: string) => boolean;
isValidDate: (date: string) => boolean;
isInRange: (value: number, min?: number, max?: number) => boolean;
getValidationMessage: (type: string, params?: any) => string;
};
useFormDevTools(formData: any, uiRules?: import('./conditionals/v2').Rule<import('./conditionals/v2').UiEffect>[], schemaRules?: import('./conditionals/v2').Rule<import('./conditionals/v2').SchemaEffect>[], validationRules?: import('./conditionals/v2').Rule<import('./conditionals/v2').ValidationEffect>[], options?: ExtendedDynamicFormsExports.DevToolsOptions): ExtendedDynamicFormsExports.DevToolsOutput;
createForm: typeof createForm;
createWizardForm: typeof createWizardForm;
React: typeof React;
ReactDOM: typeof ReactDOM;
antd: typeof antd;
dayjs: typeof dayjs;
};
export default ExtendedDynamicForms;