PluginProbe
Elementor Website Builder – more than just a page builder / 3.8.0-beta1
Elementor Website Builder – more than just a page builder v3.8.0-beta1
4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 All 457 releases
elementor / app / assets / js / ui / atoms / select.js

select.js in Elementor Website Builder – more than just a page builder 3.8.0-beta1, at app/assets/js/ui/atoms/select.js

33 lines 978 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 export default function Select( props ) {
2 return (
3 <select multiple={ props.multiple } className={ props.className } value={ props.value } onChange={ props.onChange } ref={ props.elRef } onClick={ () => props.onClick?.() }>
4 { props.options.map( ( option ) =>
5 option.children
6 ? <optgroup label={ option.label } key={ option.label }>
7 { option.children.map( ( childOption ) =>
8 <option key={ childOption.value } value={ childOption.value }>
9 { childOption.label }
10 </option>,
11 ) }
12 </optgroup>
13 : <option key={ option.value } value={ option.value }>
14 { option.label }
15 </option>,
16 ) }
17 </select>
18 );
19 }
20 Select.propTypes = {
21 className: PropTypes.string,
22 onChange: PropTypes.func,
23 options: PropTypes.array,
24 elRef: PropTypes.object,
25 multiple: PropTypes.bool,
26 value: PropTypes.oneOfType( [ PropTypes.array, PropTypes.string ] ),
27 onClick: PropTypes.func,
28 };
29 Select.defaultProps = {
30 className: '',
31 options: [],
32 };
33