!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={6031:e=>{e.exports=require("@babel/runtime/helpers/extends")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},8619:e=>{e.exports=require("@mui/material")},2015:e=>{e.exports=require("react")}},t={};function r(l){var a=t[l];if(void 0!==a)return a.exports;var n=t[l]={exports:{}};return e[l](n,n.exports,r),n.exports}(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var l in t)r.o(t,l)&&!r.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})}})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var l={};r.r(l),r.d(l,{default:()=>d});var a=r(6031),n=r.n(a),o=r(2462),i=r.n(o),u=r(2015),c=r.n(u),m=r(8619);const p=["name","label","allLabel","value","options","onChange"],d=e=>{let{name:t,label:r,allLabel:l,value:a=[],options:o,onChange:u}=e,d=i()(e,p);return c().createElement(m.FormControl,{fullWidth:!0,margin:"normal"},c().createElement(m.InputLabel,{id:`${t}_label`},r),c().createElement(m.Select,n()({labelId:`${t}_label`,name:t,multiple:!0,value:a,onChange:e=>{const r=e.target.value,l=Array.isArray(r)?r:"string"==typeof r?r.split(","):[];l.includes("all")?a.includes("all")&&l.length>1?u({target:{name:t,value:l.filter((e=>"all"!==e))}}):u({target:{name:t,value:["all"]}}):u({target:{name:t,value:l}})}},d,{input:c().createElement(m.OutlinedInput,{label:r}),renderValue:e=>{if(e.includes("all"))return l;return o.filter((({id:t})=>e.includes(t))).map((({name:e})=>e)).join(", ")}}),c().createElement(m.MenuItem,{key:"all",value:"all"},c().createElement(m.Checkbox,{checked:a.includes("all")}),c().createElement(m.ListItemText,{primary:l})),c().createElement(m.Divider,null),o.map((({name:e,id:t})=>c().createElement(m.MenuItem,{key:t,value:t},c().createElement(m.Checkbox,{checked:a.includes(t)}),c().createElement(m.ListItemText,{primary:e}))))))};return l})()));
//# sourceMappingURL=dropdown-checkbox.js.map