UNPKG

digitaform-preview-react

Version:

A comprehensive React form preview component library with form controls,responsive design

46 lines 1.83 kB
import { TFormComponent, TFormComponentName, TComponentCategory, IOption } from '../types/form-builder-schema.model'; import { IComponentConfig, IFieldConfig } from '../utils/component-configs-new'; /** * Creates a default form component based on the component type */ export declare function createDefaultComponent(componentType: TFormComponentName): TFormComponent | null; /** * Gets the configuration for a specific component type */ export declare function getComponentConfiguration(componentType: string): IComponentConfig | undefined; /** * Gets all available component types */ export declare function getAvailableComponentTypes(): string[]; /** * Gets components by category */ export declare function getComponentsByCategory(_category: TComponentCategory): IComponentConfig[]; /** * Validates a field configuration value */ export declare function validateFieldValue(fieldConfig: IFieldConfig, value: any): boolean; /** * Gets default value for a field configuration */ export declare function getDefaultFieldValue(fieldConfig: IFieldConfig): any; /** * Creates options array for select fields */ export declare function createDefaultOptions(count?: number): IOption[]; /** * Updates a component property based on field configuration */ export declare function updateComponentProperty(component: TFormComponent, fieldConfig: IFieldConfig, value: any): Partial<TFormComponent>; /** * Gets field configuration by key from a component configuration */ export declare function getFieldConfigByKey(componentConfig: IComponentConfig, fieldKey: string): IFieldConfig | undefined; /** * Validates a complete component configuration */ export declare function validateComponentConfiguration(component: TFormComponent): { isValid: boolean; errors: string[]; }; //# sourceMappingURL=config-utils.d.ts.map