UNPKG

@manojadams/metaforms

Version:
30 lines (29 loc) 2.15 kB
import { Page } from "../constants"; import { IFormField, TiconPositionType } from "../constants/common-interface"; import { IDependency, IDisplayProps, IField, IFormatterType, IIconConfig, IMeta, IOption, ISchema, ITheme, TParam } from "./../constants/model-interfaces"; 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<IField>): boolean; static getFormDefaultButtons(): Array<IField>; static getThemeProp(themeName: string, theme: ITheme, prop: string): any; static getNormalizedFormData(formData: any): {}; static updateFormData(formData: any, newFormData: any, formatter: IFormatterType): any; static updateSectionFormData(formData: any, newFormData: any, formatter: IFormatterType): any; static updateNestedFormData(formData: any): void; static updateNestedProp(formData: any, props: Array<string>, value: any): void; static getSearchValue(options: Array<IOption>, value: any): any; static getDataFromValueKey(data: any, props: string): any; static updateParams(queryParams: Array<TParam> | undefined, eventType: string | undefined, currentValue: any): TParam[] | undefined; static updateFieldProp(field: IFormField, prop: string, value: any): 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; }