UNPKG

@govbr-ds/core

Version:

Padrão Digital de Governo

2 lines 1.46 kB
!function t(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define("core",[],o):"object"==typeof exports?exports.core=o():e.core=o()}(self,(()=>(()=>{var t=()=>{},e,o=()=>{};(()=>{class t{constructor(t,e){this.name=t,this.component=e,this.menuBtns=e.querySelectorAll(".contextual-btn"),this.hideEvents=["mouseleave","blur"],this._setBehavior()}_hideNotification(t){const e=undefined;t.parentNode.parentNode.setAttribute("hidden","")}_hideAllNotifications(t){const e=undefined;t.parentNode.parentNode.parentNode.querySelectorAll(".br-item").forEach((t=>{t.setAttribute("hidden","")}))}_setBehavior(){for(const t of this.component.querySelectorAll(".br-notification .close"))t.addEventListener("click",(()=>{this._dismiss(this.component)}));this._notificationTooltip()}_notificationTooltip(){const t=[];window.document.querySelectorAll(":not(.br-header) .notification-tooltip").forEach((e=>{const o=e.querySelector("[data-tooltip-text]");let n="";if(!o)return;if(n=o.getAttribute("data-tooltip-text"),null===n)return;if(void 0===n)return;if(""===n.trim())return;const i={activator:e,placement:"top",textTooltip:n};for(parent=e.parentNode;parent;parent=parent.parentNode)if(parent.classList&&parent.classList.contains("header-avatar"))return;t.push(new Tooltip(i))}))}_dismiss(t){t.classList.add("close")}}var e=null})(),t();var n={};return o(),n})())); //# sourceMappingURL=notification.min.js.map