Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// null so that `placeholder` can be used to name what this component can filter when there's
// no value selecting, saving horizontal space.
export default function SimpleFilterSelect(props) {
const {style, value} = props;
return (
<select placeholder="" value="{value" style="{{width:">
);
}
SimpleFilterSelect.propTypes = {
...Select.propTypes,
value: PropTypes.string.isRequired
};
</select>
import React from 'react';
import PropTypes from 'prop-types';
import ReactSelect from 'react-select';
import './Select.scss';
const Select = ({searchable, clearable, forwardedRef, ...props}) => {
return ;
};
Select.propTypes = {
...ReactSelect.propTypes,
forwardedRef: PropTypes.oneOfType([
PropTypes.elementType,
PropTypes.object,
]),
};
Select.defaultProps = {
// Rule disabled because of https://github.com/yannickcr/eslint-plugin-react/issues/1674
/* eslint-disable react/default-props-match-prop-types */
clearable: false,
searchable: false,
/* eslint-enable react/default-props-match-prop-types */
forwardedRef: undefined,
};
export default React.forwardRef((props, ref) => (
import styled, {css} from 'react-emotion';
import convertFromSelect2Choices from 'app/utils/convertFromSelect2Choices';
/**
* The library has `value` defined as `PropTypes.object`, but this
* is not the case when `multiple` is true :/
*/
ReactSelect.Value.propTypes = {
...ReactSelect.Value.propTypes,
value: PropTypes.any,
};
export default class SelectControl extends React.Component {
static propTypes = {
...ReactSelect.propTypes,
options: PropTypes.arrayOf(
PropTypes.shape({
label: PropTypes.node,
value: PropTypes.any,
})
),
// react-select knows this as multi, but for standardization
// and compatibility we use multiple
multiple: PropTypes.bool,
// multi is supported for compatibility
multi: PropTypes.bool,
// disable rendering a menu
noMenu: PropTypes.bool,
choices: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.array])),
PropTypes.func,
isSearchable={false}
defaultValue={null}
isClearable
components={{ Placeholder }}
placeholder={
}
styles={customStyles}
{...rest}
/>
);
AssigneeForm.propTypes = {
size: PropTypes.string.isRequired,
...Select.propTypes,
};
export default AssigneeForm;
'Dropdown-Select--up': dropUp,
'Dropdown-Select--icon': icon,
})}
optionClassName="Dropdown-Option"
/>
{icon && (
<div>
</div>
)}
);
}
Dropdown.propTypes = {
...Select.propTypes,
dropUp: PropTypes.bool,
allowCreate: PropTypes.bool,
wrapperClassName: PropTypes.string,
onItemClick: PropTypes.func,
};
Dropdown.defaultProps = {
dropUp: false,
allowCreate: false,
wrapperClassName: null,
onItemClick: () => {},
};