@contactstudio/mindbeui
Advanced tools
Comparing version 0.0.80 to 0.0.81
@@ -1,1 +0,1 @@ | ||
(function(i){typeof define=="function"&&define.amd?define(i):i()})(function(){"use strict";console.log("Mindbe UI");async function i(){const e=document.querySelectorAll(".accordion .item:not([disabled]");for(const t of e)t.onclick=()=>{const o=t.parentElement.querySelectorAll(".item:not([disabled])");for(const n of o)n!==t&&n.removeAttribute("open")}}function r(){const e=document.querySelectorAll("*[dropdown-trigger]");for(const t of e){const o=document.querySelector(`.dropdown[dropdown="${t.getAttribute("dropdown-trigger")}"]`);y({trigger:t,dropdown:o})}}function y({trigger:e,dropdown:t}){e.onclick=()=>{b({dropdown:t}),w({dropdown:t}),c({trigger:e,dropdown:t}),window.onresize=()=>{c({trigger:e,dropdown:t})},document.onscroll=()=>{c({trigger:e,dropdown:t})},v({trigger:e,dropdown:t}),A({trigger:e,dropdown:t})}}function b({dropdown:e}){const t=document.querySelectorAll("*[dropdown]");for(const o of t)e!==o&&s({dropdown:o})}function w({dropdown:e}){e.classList.toggle("visible"),e.classList.contains("visible")||l()}function A({trigger:e,dropdown:t}){document.onclick=o=>{!e.contains(o.target)&&!t.contains(o.target)&&s({dropdown:t})}}function v({trigger:e,dropdown:t}){const o=t.querySelectorAll(".item");for(const n of o)n.onclick=()=>{if(t.hasAttribute("static")){setTimeout(()=>{c({trigger:e,dropdown:t})},0);return}s({dropdown:t})}}function c({trigger:e,dropdown:t}){const{top:o,bottom:n,left:D,right:T}=e.getBoundingClientRect(),{width:d,height:u}=t.getBoundingClientRect(),{width:E,height:L,top:f,left:g}=document.body.getBoundingClientRect(),m=T-g,k=D-g,a=n-f,x=o-f,p=m+d>E,h=a+u>L;h||t.style.setProperty("top",`${a}px`),h&&t.style.setProperty("top",`${x-u}px`),p||t.style.setProperty("left",`${k}px`),p&&t.style.setProperty("left",`${m-d}px`)}function s({dropdown:e}){e.classList.remove("visible"),l()}function l(){window.onresize=()=>{},document.onscroll=()=>{}}(function(){window&&document&&(document.addEventListener("DOMContentLoaded",()=>{i(),r()}),document.addEventListener("click",()=>{i(),r()}))})();const q=""}); | ||
(function(i){typeof define=="function"&&define.amd?define(i):i()})(function(){"use strict";console.log("Mindbe UI");async function i(){const e=document.querySelectorAll(".accordion .item:not([disabled]");for(const t of e)t.onclick=()=>{const o=t.parentElement.querySelectorAll(".item:not([disabled])");for(const n of o)n!==t&&n.removeAttribute("open")}}function r(){const e=document.querySelectorAll("*[dropdown-trigger]");for(const t of e){const o=document.querySelector(`.dropdown[dropdown="${t.getAttribute("dropdown-trigger")}"]`);y({trigger:t,dropdown:o})}}function y({trigger:e,dropdown:t}){e.onclick=()=>{b({dropdown:t}),w({dropdown:t}),c({trigger:e,dropdown:t}),window.onresize=()=>{c({trigger:e,dropdown:t})},document.onscroll=()=>{c({trigger:e,dropdown:t})},v({trigger:e,dropdown:t}),A({trigger:e,dropdown:t})}}function b({dropdown:e}){const t=document.querySelectorAll("*[dropdown]");for(const o of t)e!==o&&s({dropdown:o})}function w({dropdown:e}){e.classList.toggle("visible"),e.classList.contains("visible")||l()}function A({trigger:e,dropdown:t}){document.onclick=o=>{!e.contains(o.target)&&!t.contains(o.target)&&s({dropdown:t})}}function v({trigger:e,dropdown:t}){const o=t.querySelectorAll(".item");for(const n of o)n.onclick=()=>{if(t.hasAttribute("static")){setTimeout(()=>{console.log("entrei"),c({trigger:e,dropdown:t})},100);return}s({dropdown:t})}}function c({trigger:e,dropdown:t}){const{top:o,bottom:n,left:D,right:T}=e.getBoundingClientRect(),{width:d,height:u}=t.getBoundingClientRect(),{width:E,height:L,top:f,left:g}=document.body.getBoundingClientRect(),m=T-g,k=D-g,a=n-f,x=o-f,p=m+d>E,h=a+u>L;h||t.style.setProperty("top",`${a}px`),h&&t.style.setProperty("top",`${x-u}px`),p||t.style.setProperty("left",`${k}px`),p&&t.style.setProperty("left",`${m-d}px`)}function s({dropdown:e}){e.classList.remove("visible"),l()}function l(){window.onresize=()=>{},document.onscroll=()=>{}}(function(){window&&document&&(document.addEventListener("DOMContentLoaded",()=>{i(),r()}),document.addEventListener("click",()=>{i(),r()}))})();const q=""}); |
{ | ||
"name": "@contactstudio/mindbeui", | ||
"version": "0.0.80", | ||
"version": "0.0.81", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "main": "dist/mindbeui.js", |
@@ -83,4 +83,5 @@ console.log("Mindbe UI"); | ||
setTimeout(() => { | ||
console.log("entrei"); | ||
setPositionDropdown({ trigger, dropdown }); | ||
}, 0); | ||
}, 100); | ||
return; | ||
@@ -87,0 +88,0 @@ } |
52047
221