export const __webpack_esm_id__=48605;export const __webpack_esm_ids__=[48605];export const __webpack_esm_modules__={48605(){angular.module("graphdb.framework.core.directives.multiselect",[]).directive("multiSelectDropdown",function(){return{restrict:"E",scope:{items:"=",placeholder:"@?",onChange:"&?",labelKeys:"=?"},templateUrl:"js/angular/core/directives/multiselect-search/templates/multiselect-search.html",controller:["$scope","$document","$element","$filter","$timeout",function(e,t,o,n,c){e.open=!1,e.search={query:""},e.visibleItems=[];const s=[],l=e=>null===e?"":(""+e).toLowerCase(),r=()=>{const t=Array.isArray(e.items)?e.items:[],o=l(e.search.query);e.visibleItems=o?t.filter(e=>l(e.label).includes(o)):t},i=t=>{e.open&&(o[0].contains(t.target)||e.$applyAsync(function(){e.open=!1}))};e.toggleOpen=function(t){t&&t.stopPropagation(),e.open=!e.open,e.open&&c(function(){const e=o[0].querySelector(".multiselect-search");e&&e.focus()})},e.onKeydownMenu=function(t){"Escape"===t.key&&(e.open=!1,t.stopPropagation(),t.preventDefault(),c(function(){const e=o[0].querySelector(".multiselect-button");e&&e.focus()}))},e.selectedCount=function(){return Array.isArray(e.items)?e.items.filter(e=>e.selected).length:0},e.allFilteredSelected=function(){const t=e.visibleItems||[];return 0!==t.length&&t.every(e=>e.selected)},e.someFilteredSelected=function(){const t=e.visibleItems||[],o=t.some(e=>e.selected),n=t.every(e=>e.selected);return o&&!n},e.toggleSelectAll=function(t){t&&t.stopPropagation();const o=e.visibleItems||[],n=!e.allFilteredSelected();for(const e of o)e.selected=n;e.emitChange()},e.emitChange=function(){if("function"==typeof e.onChange){const t=(e.items||[]).filter(e=>e.selected);e.onChange({selected:t})}},t.on("click",i),s.push(e.$watch("search.query",r),e.$watchCollection("items",r)),e.$on("$destroy",()=>{t.off("click",i);for(const e of s)e()}),r()}]}})}};
//# sourceMappingURL=48605.4e44f318ac77a904d78c.bundle.js.map