diff --git a/src/Components/ValidationField/ValidationField.tsx b/src/Components/ValidationField/ValidationField.tsx index 3b2f503..6e6b8ef 100644 --- a/src/Components/ValidationField/ValidationField.tsx +++ b/src/Components/ValidationField/ValidationField.tsx @@ -1,46 +1,55 @@ import React from "react"; -import "./utils/ValidationField.scss"; -import { - Date, - Time, - File, - DataRange, - SelectField, - CheckboxField, - MaltyFile, - SearchField, - TextField, - DropFile, - Default, -} from "./View"; -import { ValidationFieldProps, ValidationFieldType } from "./utils/types"; -import LocalSearchField from "./View/LocalSearch"; -import NumberFormate from "./View/NumberFormate"; +import "./ValidationField.scss"; +import { Date, Time, File, DataRange, SelectField, Default, CheckboxField } from './View'; -const components: { [key: string]: React.FC } = { - Select: SelectField, - Search: SearchField, - LocalSearch: LocalSearchField, - DataRange: DataRange, - TextArea: TextField, - Date: Date, - Time: Time, - File: File, - DropFile: DropFile, - MaltyFile: MaltyFile, - Checkbox: CheckboxField, - NumberFormate: NumberFormate, +export interface ValidationFieldProps { + name: string; + type?: "text" | "Select" | "DataRange" | "Date" | "Time" | "File" | "number" | "Checkbox" | "password"; + placeholder?: string; + label?: string; + className?: string; + option?: any[]; + isMulti?: boolean; + isDisabled?: boolean; + picker?: "data" | "week" | "month" | "quarter" | "year"; + Format?: "YYYY/MM/DD" | "MM/DD" | "YYYY/MM"; + accept?: any + onChange?: (value: any) => void; + Group?: boolean + dir?: 'ltr' | "rtl" +} + +const ValidationField = (props: ValidationFieldProps) => { + switch (props?.type) { + case 'Select': + return ; + case "DataRange": + return ; + case "Date": + return ; + case "Time": + return