import React, {FC, memo, ReactText} from 'react'; import RSelect from 'react-select'; import {cn} from '../../util/bem'; import {FormSizesType, SizeType} from '../../util/global-props'; import {CustomSelectContainer} from './select-container.component'; import {CustomSingleValue} from './select-single-value.component'; import {CustomValueContainer} from './select-value-container.component'; import './select.component.scss'; export type OptionType = { label: string; value: ReactText | string; } export type SelectPropsType = { className?: string; options: OptionType[]; value?: OptionType | undefined; defaultValue?: OptionType; placeholder?: string; size?: FormSizesType; margin?: SizeType; isSearchable?: boolean; isDisabled?: boolean; transparent?: boolean; menuIsOpen?: boolean; title?: string; onChange?: (item: OptionType) => void; } const className = cn('select'); export const Select: FC = memo((props) => (
{ props.title && (
{ props.title }
) }
({ ...provided, zIndex: 9999 }) } } { ...props } />
)); Select.defaultProps = { size: 'lg', isSearchable: false };