graphdb-workbench
Version:
The web application for GraphDB APIs
2 lines • 1.2 kB
JavaScript
export const __webpack_id__=29428;export const __webpack_ids__=[29428];export const __webpack_modules__={29428:()=>{angular.module("graphdb.framework.core.directives.multiselect-dropdown",[]).directive("multiselectDropdown",["$translate",function(e){return{restrict:"E",require:"ngModel",scope:{options:"=",dropdownLabel:"=?"},templateUrl:"js/angular/core/directives/multiselect-dropdown/templates/multiselect-dropdown.html",link:function(t,n,o,r){t.isOpen=!1;const c=e=>{n[0].contains(e.target)||t.$apply(()=>{t.isOpen=!1})};t.toggleDropdown=function(){t.isOpen=!t.isOpen},t.toggleSelection=function(e){e.selected=!e.selected,(()=>{const e=t.options.filter(function(e){return e.selected});r.$setViewValue(e)})()},t.getSelectedText=function(){const n=t.options.filter(e=>e.selected);return 0===n.length?t.dropdownLabel||e.instant("common.select"):n.map(e=>e.label).join(", ")},r.$render=function(){angular.isArray(r.$viewValue)&&t.options.forEach(function(e){e.selected=r.$viewValue.some(function(t){return t.value===e.value})})},document.addEventListener("click",c),t.$on("$destroy",()=>{document.removeEventListener("click",c)})}}}])}};
//# sourceMappingURL=29428.72ce375093488daf5583.bundle.js.map