infinity-forge
Version:
79 lines (78 loc) • 3.13 kB
TypeScript
import { IconsNames } from '../../../ui/icons/index.js';
import { TranslateProps } from '../../../ui/contexts/index.js';
import { FieldHelperProps, FieldMetaProps, FormikContextType } from 'formik';
type InputFormikState = {
utils: FieldHelperProps<any>;
state: FieldMetaProps<any>;
};
import { StylesConfig } from 'react-select';
import { InputMaskProps } from './input-mask/index.js';
import { InputManagerProps } from './input-manager/index.js';
import { IInputDatePicker } from './input-date-picker/index.js';
import { InputCurrencyProps } from './input-currency/index.js';
import { InputCheckboxProps } from './checkbox/index.js';
import { FileSystemType } from '../../../ui/utils/index.js';
import { InputFileProps } from './input-file/index.js';
import { InputCounterProps } from './input-counter/index.js';
export type Option = {
label: string;
value?: string | number;
color?: string;
isDisabled?: boolean;
options?: Option[];
};
export type ISelectProps = {
isClearable?: boolean;
controlledOnChangeValue?: boolean;
creatableSelect?: boolean;
forceOpenToDevelop?: boolean;
onlyOneValue?: boolean;
closeMenuOnSelect?: boolean;
customStlyes?: StylesConfig;
options: Option[];
isGroup?: boolean;
isMultiple?: boolean;
isSearchable?: boolean;
noOptionMessage?: string;
menuPlacement?: 'bottom' | 'top' | 'auto';
listposition?: number;
CustomOption?: (props: {
data: Option;
innerRef: any;
innerProps: any;
}) => React.ReactNode;
addButton?: {
onClick?: (param?: any) => void;
CustomComponent?: React.ReactNode;
};
};
interface Props {
disable?: boolean;
debug?: boolean;
prefix?: string;
name: string;
label?: string;
loading?: boolean;
onChangeMode?: "blur";
onChangeBlur?: (value: number | string | boolean | string[] | Date | FileSystemType[], callback?: () => void, formik?: InputFormikState, applyMask?: (value: string, mask: string) => string, formikContext?: FormikContextType<unknown>) => any;
icon?: {
name?: IconsNames;
element?: React.ReactNode;
size?: number;
color?: string;
direction?: 'left' | 'right';
onClick?: (value: any) => void;
};
iconDirection?: 'left' | 'right';
onChangeInput?: (value: number | string | boolean | string[] | Date | FileSystemType[], callback?: () => void, formik?: InputFormikState, applyMask?: (value: string, mask: string) => string, formikContext?: FormikContextType<unknown>) => any;
controlledInitialValue?: {
value?: string;
};
enableToClearInput?: boolean;
}
export interface IOptionSelect {
label: string;
value: string;
}
export type InputProps = React.InputHTMLAttributes<HTMLInputElement> & React.TextareaHTMLAttributes<HTMLTextAreaElement> & Props & Partial<TranslateProps> & Partial<ISelectProps> & Partial<IInputDatePicker> & Partial<InputManagerProps> & Partial<InputMaskProps> & Partial<InputCurrencyProps> & Partial<InputCheckboxProps> & Partial<InputFileProps> & Partial<InputCounterProps>;
export {};