const { Component, PropTypes } = require('react') const h = require('react-hyperscript') const classnames = require('classnames') const R = require('ramda') class SimpleDropdown extends Component { constructor (props) { super(props) this.state = { isOpen: false, } } getDisplayValue () { const { selectedOption, options } = this.props const matchesOption = option => option.value === selectedOption const matchingOption = R.find(matchesOption)(options) return matchingOption ? matchingOption.displayValue || matchingOption.value : selectedOption } handleClose () { this.setState({ isOpen: false }) } toggleOpen () { const { isOpen } = this.state this.setState({ isOpen: !isOpen }) } renderOptions () { const { options, onSelect, selectedOption } = this.props return h('div', [ h('div.simple-dropdown__close-area', { onClick: event => { event.stopPropagation() this.handleClose() }, }), h('div.simple-dropdown__options', [ ...options.map(option => { return h( 'div.simple-dropdown__option', { className: classnames({ 'simple-dropdown__option--selected': option.value === selectedOption, }), key: option.value, onClick: () => { if (option.value !== selectedOption) { onSelect(option.value) } this.handleClose() }, }, option.displayValue || option.value, ) }), ]), ]) } render () { const { placeholder } = this.props const { isOpen } = this.state return h( 'div.simple-dropdown', { onClick: () => this.toggleOpen(), }, [ h('div.simple-dropdown__selected', this.getDisplayValue() || placeholder || 'Select'), h('i.fa.fa-caret-down.fa-lg.simple-dropdown__caret'), isOpen && this.renderOptions(), ] ) } } SimpleDropdown.propTypes = { options: PropTypes.array.isRequired, placeholder: PropTypes.string, onSelect: PropTypes.func, selectedOption: PropTypes.string, } module.exports = SimpleDropdown ption> FreeBSD Ports (https://github.com/freebsd/freebsd-ports)
aboutsummaryrefslogtreecommitdiffstats
path: root/lang/nim
e with our bugzilla experimental url
Diffstat (limited to 'Tools')
Commit message (Expand)AuthorAgeFilesLines
* lang/nim: Remove BROKEN for powerpc64pkubaj2019-11-282-3/+23
* Update to 1.0.2.rakuco2019-10-273-8/+8
-0/+1
* Remove expired ports:rene2020-02-061-0/+37
* Move devel/rubygem-web-console-rails{50,5,52} to devel/rubygem-web-console3-r...sunpoet2020-02-061-0/+3
* Remove duplicate port math/mandelbulber2yuri2020-02-051-0/+1
* x11-themes/xfce-evolution: rename to x11-themes/classiclooksswills2020-02-041-0/+1
* Remove expired ports:rene2020-02-041-0/+2
* Unbreak bulk -aantoine2020-02-041-0/+1
* remove rubyzip12 (use rubyzip instead)cmt2020-02-041-0/+1
* Remove expired ports:rene2020-02-041-0/+169
* Added/reviewed ports required by gitlab-ce 12.7.mfechner2020-02-021-3/+0
* Remove entry for editors/xed which, even though the name has beenlinimon2020-02-011-1/+0
* Remove more expired ports:rene2020-01-311-0/+3
* Remove expired ports:rene2020-01-311-0/+20
* Pet MOVEDlint.linimon2020-01-311-1/+1
* Fix entry for java/jakarta-commons-commons-beanutils.linimon2020-01-311-1/+1
* Finish migration of java/jakarta-commons-beanutils to apache-commons-beanutils.olgeni2020-01-311-0/+1
* java/jakarta-commons-discovery: move to java/apache-commons-discoverypfg2020-01-301-0/+1
* Readd py-zfec 1.5.3sunpoet2020-01-301-1/+0
* Convert to modern Python and revive `games/battletanks'.danfe2020-01-281-1/+0
* Remove textproc/gnome-doc-utils.rene2020-01-281-0/+1
* Remove games/vegastrike-data after its master port games/vegastrike was removed.rene2020-01-281-0/+1
* Remove expired ports (part 2):rene2020-01-281-0/+60
* Remove expired ports:rene2020-01-271-0/+187
* Update gstreamer1 to 1.16.2.kwm2020-01-271-0/+1
* Revert r524124, resurrection of a still broken and still unmaintained portantoine2020-01-261-0/+1
* Move devel/py-microversion_parse to devel/py-microversion_parsesunpoet2020-01-261-0/+1
* Move audio/py-mpd2 to audio/py-python-mpd2sunpoet2020-01-261-0/+1
* math/jakarta-commons-math3 update and rename to apache-commons-mathpfg2020-01-251-0/+1
* math/superlu_mt: Resurrect.pfg2020-01-241-1/+0
* Resurrect rtptoolsse2020-01-221-1/+0
* Resurrect tcptracese2020-01-221-1/+0
* Move security/py-pymacaroons-pynacl to security/py-pymacaroonssunpoet2020-01-211-0/+1
* Correct explanations of two remove ports.yuri2020-01-191-2/+2
* Unbreak bulk -a harderantoine2020-01-191-0/+1
* Unbreak bulk -aantoine2020-01-191-0/+1
* update the Coin3D stack to it's latest releasecmt2020-01-181-2/+2
* Remove devel/pecl-expect entry after r523306sunpoet2020-01-181-1/+0
* - Resurrect port math/octave-forge-audio.stephen2020-01-171-1/+0
* Remove expired port:rene2020-01-161-0/+1
* Move cad/elmerfem -> science/elmerfemyuri2020-01-161-0/+1
* Remove expired ports:rene2020-01-151-0/+2
* Unbreak bulk -a after r522845antoine2020-01-131-0/+1
* MOVED: Fix the last record missing the date fieldyuri2020-01-131-1/+1
* MOVED: Add the forgotten record about the duplicate port deletion science/moldenyuri2020-01-13