infinity-forge
Version:
90 lines (89 loc) • 3.47 kB
TypeScript
import { IconsNames } from '../../../ui/icons/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';
import { InputURLProps } from './input-url/index.js';
import { InputRangePickerProps } from './input-range-picker/index.js';
export type Option = {
label: string;
value?: string | number;
color?: string;
isDisabled?: boolean;
options?: Option[];
};
export type ISelectProps = {
isClearable?: boolean;
hideSelectedOptions?: boolean;
controlledOnChangeValue?: boolean;
creatableSelect?: boolean;
forceOpenToDevelop?: boolean;
onlyOneValue?: boolean;
closeMenuOnSelect?: boolean;
customStyles?: StylesConfig;
options: Option[];
isGroup?: boolean;
isMultiple?: boolean;
isSearchable?: boolean;
noOptionMessage?: string;
maxItemsValueContainer?: number;
onCloseMenu?: () => void;
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 {
i18n?: {
disabled?: boolean;
};
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[] | {
value?: string;
checked?: boolean;
}, callback?: () => void, formik?: InputFormikState, applyMask?: (value: string, mask: string) => string, formikContext?: FormikContextType<unknown>) => any;
controlledInitialValue?: {
value?: string;
};
enableToClearInput?: boolean;
showSelectedValues?: boolean;
}
export interface IOptionSelect {
label: string;
value: string;
}
export type InputProps = React.InputHTMLAttributes<HTMLInputElement> & React.TextareaHTMLAttributes<HTMLTextAreaElement> & Props & Partial<ISelectProps> & Partial<IInputDatePicker> & Partial<InputManagerProps> & Partial<InputMaskProps> & Partial<InputCurrencyProps> & Partial<InputCheckboxProps> & Partial<InputFileProps> & Partial<InputCounterProps> & Partial<InputURLProps> & Partial<InputRangePickerProps>;
export {};