drf-react-by-schema
Version:
Components and Tools for building a React App having Django Rest Framework (DRF) as server
33 lines • 1.6 kB
TypeScript
import { GridFilterModel } from '@mui/x-data-grid';
import { Choice, ChoiceValue, GenericValue, Item, SchemaType } from './@types';
export declare const emptyByType: GenericValue;
export declare const getChoiceByValue: (value: ChoiceValue, choices: Choice[] | undefined) => string | null | undefined;
export declare const populateValues: ({ data, schema }: {
data: Item;
schema: SchemaType;
}) => Item;
export declare const buildGenericYupValidationSchema: ({ data, schema, many, skipFields, extraValidators, }: {
data: Item;
schema: SchemaType;
many?: boolean;
skipFields?: string[];
extraValidators?: Item;
}) => any;
export declare const errorProps: ({ errors, fieldKey, fieldKeyProp, index, }: {
errors: Item;
fieldKey: string;
fieldKeyProp: string;
index?: number;
}) => {
error: any;
helperText: any;
};
export declare const getTmpId: () => string;
export declare const isTmpId: (id: string | number | undefined | null) => boolean;
export declare function reducer<T>(state: T | null, newState: Partial<T> | null): T | null;
export declare const getPatternFormat: (type: string) => string;
export declare function buildDateFormatBySchema(dateViews: string[] | null | undefined): "DD/MM/YYYY" | "MM/YYYY" | "YYYY" | "MM" | "DD";
export declare const slugToCamelCase: (str: string, includeFirst?: boolean) => string;
export declare const slugify: (text: string | null) => string;
export declare function mergeFilterItems(defaultFilter: GridFilterModel | undefined, filter: GridFilterModel | undefined): any;
//# sourceMappingURL=utils.d.ts.map