/**
 * External imports
 */
import PropTypes from 'prop-types';
import { __ } from '@eventespresso/i18n';

export const REACT_SELECT_TYPES = {
	'aria-describedby': PropTypes.string,
	'aria-label': PropTypes.string,
	'aria-labelledby': PropTypes.string,
	autoFocus: PropTypes.bool,
	backspaceRemovesValue: PropTypes.bool,
	blurInputOnSelect: PropTypes.bool,
	captureMenuScroll: PropTypes.bool,
	className: PropTypes.string,
	classNamePrefix: PropTypes.string,
	closeMenuOnSelect: PropTypes.bool,
	components: PropTypes.object,
	controlShouldRenderValue: PropTypes.bool,
	delimiter: PropTypes.string,
	escapeClearsValue: PropTypes.bool,
	filterOption: PropTypes.func,
	formatGroupLabel: PropTypes.func,
	formatOptionLabel: PropTypes.func,
	getOptionLabel: PropTypes.func,
	getOptionValue: PropTypes.func,
	hideSelectedOptions: PropTypes.bool,
	id: PropTypes.string,
	inputValue: PropTypes.string,
	inputId: PropTypes.string,
	instanceId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
	isClearable: PropTypes.bool,
	isDisabled: PropTypes.bool,
	isLoading: PropTypes.bool,
	isOptionDisabled: PropTypes.func,
	isOptionSelected: PropTypes.func,
	isMulti: PropTypes.bool,
	isSearchable: PropTypes.bool,
	loadingMessage: PropTypes.func,
	minMenuHeight: PropTypes.number,
	maxMenuHeight: PropTypes.number,
	menuIsOpen: PropTypes.bool,
	menuPlacement: PropTypes.oneOf(['auto', 'bottom', 'top']),
	menuPosition: PropTypes.oneOf(['absolute', 'fixed']),
	menuPortalTarget: PropTypes.element,
	menuShouldBlockScroll: PropTypes.bool,
	menuShouldScrollIntoView: PropTypes.bool,
	name: PropTypes.string,
	noOptionsMessage: PropTypes.func,
	onBlur: PropTypes.func,
	onChange: PropTypes.func,
	onFocus: PropTypes.func,
	onInputChange: PropTypes.func,
	onKeyDown: PropTypes.func,
	onMenuOpen: PropTypes.func,
	onMenuClose: PropTypes.func,
	onMenuScrollToTop: PropTypes.func,
	onMenuScrollToBottom: PropTypes.func,
	openMenuOnFocus: PropTypes.bool,
	openMenuOnClick: PropTypes.bool,
	options: PropTypes.array,
	pageSize: PropTypes.number,
	placeholder: PropTypes.string,
	screenReaderStatus: PropTypes.func,
	styles: PropTypes.shape({
		clearIndicator: PropTypes.func,
		container: PropTypes.func,
		control: PropTypes.func,
		dropdownIndicator: PropTypes.func,
		group: PropTypes.func,
		groupHeading: PropTypes.func,
		indicatorsContainer: PropTypes.func,
		indicatorSeparator: PropTypes.func,
		input: PropTypes.func,
		loadingIndicator: PropTypes.func,
		loadingMessageCSS: PropTypes.func,
		menu: PropTypes.func,
		menuList: PropTypes.func,
		menuPortal: PropTypes.func,
		multiValue: PropTypes.func,
		multiValueLabel: PropTypes.func,
		multiValueRemove: PropTypes.func,
		noOptionsMessageCSS: PropTypes.func,
		option: PropTypes.func,
		placeholder: PropTypes.func,
		singleValue: PropTypes.func,
		valueContainer: PropTypes.func,
	}),
	tabIndex: PropTypes.string,
	tabSelectsValue: PropTypes.bool,
	value: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
};

export const REACT_SELECT_DEFAULTS = {
	isClearable: true,
	isLoading: true,
	placeholder: __('Select…', 'event_espresso'),
};
