!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={8619:e=>{e.exports=require("@mui/material")},2015:e=>{e.exports=require("react")}},t={};function l(a){var r=t[a];if(void 0!==r)return r.exports;var n=t[a]={exports:{}};return e[a](n,n.exports,l),n.exports}(()=>{l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t}})(),(()=>{l.d=(e,t)=>{for(var a in t)l.o(t,a)&&!l.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})}})(),(()=>{l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var a={};l.r(a),l.d(a,{default:()=>u});var r=l(2015),n=l.n(r),o=l(8619);const u=({name:e,label:t,allLabel:l,value:a=[],options:r,onChange:u})=>n().createElement(o.FormControl,{fullWidth:!0,margin:"normal"},n().createElement(o.InputLabel,{id:`${e}_label`},t),n().createElement(o.Select,{labelId:`${e}_label`,name:e,multiple:!0,value:a,onChange:t=>{const l=t.target.value;l.includes("all")?a.includes("all")?l.length>1&&u({target:{name:e,value:l.filter((e=>"all"!==e))}}):u({target:{name:e,value:["all"]}}):u({target:{name:e,value:l}})},input:n().createElement(o.OutlinedInput,{label:t}),renderValue:e=>{if(e.includes("all"))return l;return r.filter((({id:t})=>e.includes(t))).map((({name:e})=>e)).join(", ")}},n().createElement(o.MenuItem,{key:"all",value:"all"},n().createElement(o.Checkbox,{checked:a.includes("all")}),n().createElement(o.ListItemText,{primary:l})),n().createElement(o.Divider,null),r.map((({name:e,id:t})=>n().createElement(o.MenuItem,{key:t,value:t},n().createElement(o.Checkbox,{checked:a.includes(t)}),n().createElement(o.ListItemText,{primary:e}))))));return a})()));
//# sourceMappingURL=dropdown-checkbox.js.map