import { IForm, IFormData, IFormField, IFormSection, IRequestBody } from "../constants/common-interface"; import { TiconPositionType, TValue } from "../constants/types"; import { Page } from "../core/Page"; import { IDependency, IDisplayProps, IField, IFormatterType, IIconConfig, IMeta, IOption, ISchema, TParam } from "./../constants/model-interfaces"; /** * @ignore */ export default class FormUtils { static getCssClassName(prop: IDisplayProps | undefined): string; static isFormControl(prop: IMeta): boolean; static getVerticalSpacing(theme: string): "" | "my-2 my-md-3"; static getAlignment(align: string): string; static getPadding(theme: string): "" | "py-md-3"; static getUUID(prefix?: string): string; static hasSections(fields: Array): boolean; static getFormDefaultButtons(): Array; static getFormGroupDefaultButtons(): Array; static getThemeProp(theme: any, prop: string): any; static getNormalizedFormData(formData: IFormData): {}; static getBase64(file?: File): Promise; static getFormFieldValue(formField: IFormField): Promise; static updateFormData(formData: IForm, newFormData: IFormData, formatter: IFormatterType): Promise; static updateSectionFormData(formData: IFormSection | null, newFormData: IFormData, formatter: IFormatterType): Promise; static updateNestedFormData(formData: IFormData): Promise; static updateNestedProp(formData: IFormData, props: Array, value: TValue): Promise; static getSearchValue(options: Array, value: TValue): string | number | boolean | Date | IOption | null | undefined; static getDataFromValueKey(data: string, props: string): string; /** * Update parameters with special values ($input, $initial etc) * @param queryParams * @param eventType * @param currentValue * @returns */ static updateParams(queryParams: Array | undefined, eventType: string | undefined, currentValue: TValue): TParam[] | undefined; /** * Updates request payload body * @param requestBody * @param requestBodyParams * @returns */ static updateBodyParams(requestBody: IRequestBody, requestBodyParams: Array): any; static updateFieldProp(field: IFormField, prop: string, value: TValue): void; static getDateString(date: Date): string; static getLocalDateStringFormat(inputDateString: string, inputFormat: string): string; static cleanupSchema(schema: ISchema): ISchema; static createFileInput(fileWidthClass: string, fieldName: string, accept: string | undefined, displayLabel: string | undefined, onChangeCallback: EventListener): HTMLInputElement; static resolveButtonDependencies(deps: IDependency | undefined, page: Page): boolean; static getIconNameByPosition(positionType: TiconPositionType, allIcons: IIconConfig): string | undefined; }