"use strict";require("@babel/runtime/helpers/defineProperty");var e=require("prop-types"),t=require("@material-ui/core"),r=require("classnames"),a=require("react/jsx-runtime");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=l(e),d=l(r),n=t.withStyles({root:{paddingLeft:"7px"}})(t.Checkbox);function i(e){var r=e.currentValue,l=e.defaultValue,u=e.options,i=e.placeholder,o=e.onChange,s=e.multiple,p=e.disabled,c=e.classes,f=e.renderValue,m=e.errorText,h=e["data-testid"],x=r||l,b=d.default(c.menuItem,s&&c.multipleMenuItem);return a.jsxs(t.FormControl,{className:c.formControl,error:!!m,children:[a.jsx(t.InputLabel,{shrink:void 0!==x,children:i}),a.jsx(t.Select,{"data-testid":"".concat(h,"_select"),value:x,onChange:function(e){return o(e.target.value)},multiple:s,disabled:p,renderValue:f,MenuProps:{className:c.selectMenu,anchorOrigin:{vertical:"top"}},autoWidth:!0,displayEmpty:!0,children:u&&u.map((function(e){return a.jsxs(t.MenuItem,{"data-testid":"".concat(h,"_item_").concat(e.label,"MenuItem"),value:e.value,className:b,children:[s&&a.jsx(n,{color:"primary",checked:x&&x.includes(e.value)}),e.label]},e.value)}))}),!!m&&a.jsx(t.FormHelperText,{children:m})]})}i.propTypes={currentValue:u.default.oneOfType([u.default.number,u.default.string,u.default.array]),defaultValue:u.default.oneOfType([u.default.number,u.default.string,u.default.array]),onChange:u.default.func.isRequired,options:u.default.arrayOf(u.default.any).isRequired,placeholder:u.default.string,multiple:u.default.bool,disabled:u.default.bool,classes:u.default.shape({}).isRequired,renderValue:u.default.func,errorText:u.default.string,"data-testid":u.default.string},i.defaultProps={currentValue:void 0,defaultValue:void 0,multiple:!1,placeholder:"Choose An Option",disabled:!1,renderValue:void 0,errorText:"","data-testid":"DropdownEditor"};var o=t.withStyles({formControl:{minWidth:"200px",maxWidth:"200px",margin:"10px 20px 10px 0"},selectMenu:{maxHeight:"400px"},menuItem:{minWidth:"200px"},multipleMenuItem:{paddingLeft:"5px",minWidth:"200px"}})(i);module.exports=o;
