@contactstudio/mindbeui
Advanced tools
Comparing version 0.0.40 to 0.0.41
@@ -1,1 +0,1 @@ | ||
(function(n){typeof define=="function"&&define.amd?define(n):n()})(function(){"use strict";console.log("Mindbe UI"),function(){window&&document&&(document.addEventListener("DOMContentLoaded",()=>{n(),c()}),document.addEventListener("click",()=>{n(),c()}))}();async function n(){const e=document.querySelectorAll(".accordion .item");for(const t of e)t.onclick=()=>{const i=t.parentElement.querySelectorAll(".item:not([disabled])");for(const o of i)o!==t&&o.removeAttribute("open")}}function c(){const e=document.querySelectorAll("*[dropdown-trigger]");for(const t of e){const i=document.querySelector(`.dropdown[dropdown="${t.getAttribute("dropdown-trigger")}"]`);r({trigger:t,dropdown:i})}}function r({trigger:e,dropdown:t}){e.onclick=()=>{if(t.classList.contains("visible")){t.classList.remove("visible");return}f(),t.classList.add("visible"),d({trigger:e,dropdown:t}),u({dropdown:t}),l({trigger:e,dropdown:t})}}function l({trigger:e,dropdown:t}){document.onclick=i=>{!e.contains(i.target)&&!t.contains(i.target)&&t.classList.remove("visible")}}function u({dropdown:e}){const t=e.querySelectorAll(".item");for(const i of t)i.onclick=()=>{e.hasAttribute("static")||e.classList.remove("visible")}}function f(){const e=document.querySelectorAll("*[dropdown]");for(const t of e)t.classList.remove("visible")}function d({trigger:e,dropdown:t}){const{top:i,left:o,right:a,height:p}=e.getBoundingClientRect(),{width:m,height:y}=t.getBoundingClientRect(),g=Math.abs(document.body.getBoundingClientRect().top),s=i+g;if(t.hasAttribute("dropend")){t.style.setProperty("top",`${s}px`),t.style.setProperty("left",`${a}px`);return}if(t.hasAttribute("dropstart")){t.style.setProperty("top",`${s}px`),t.style.setProperty("left",`${o-m}px`);return}if(t.hasAttribute("dropup")){t.style.setProperty("top",`${s-y}px`),t.style.setProperty("left",`${o}px`);return}t.style.setProperty("top",`${s+p}px`),t.style.setProperty("left",`${o}px`)}const b=""}); | ||
(function(o){typeof define=="function"&&define.amd?define(o):o()})(function(){"use strict";console.log("Mindbe UI"),function(){window&&document&&(document.addEventListener("DOMContentLoaded",()=>{o(),c()}),document.addEventListener("click",()=>{o(),c()}))}();async function o(){const e=document.querySelectorAll(".accordion .item");for(const t of e)t.onclick=()=>{const i=t.parentElement.querySelectorAll(".item:not([disabled])");for(const n of i)n!==t&&n.removeAttribute("open")}}function c(){const e=document.querySelectorAll("*[dropdown-trigger]");for(const t of e){const i=document.querySelector(`.dropdown[dropdown="${t.getAttribute("dropdown-trigger")}"]`);r({trigger:t,dropdown:i})}}function r({trigger:e,dropdown:t}){e.onclick=()=>{if(t.classList.contains("visible")){t.classList.remove("visible");return}t.classList.add("visible"),f({trigger:e,dropdown:t}),u({dropdown:t}),l({trigger:e,dropdown:t})}}function l({trigger:e,dropdown:t}){document.onclick=i=>{!e.contains(i.target)&&!t.contains(i.target)&&t.classList.remove("visible")}}function u({dropdown:e}){const t=e.querySelectorAll(".item");for(const i of t)i.onclick=()=>{e.hasAttribute("static")||e.classList.remove("visible")}}function f({trigger:e,dropdown:t}){const{top:i,left:n,right:a,height:d}=e.getBoundingClientRect(),{width:y,height:m}=t.getBoundingClientRect(),p=Math.abs(document.body.getBoundingClientRect().top),s=i+p;if(t.hasAttribute("dropend")){t.style.setProperty("top",`${s}px`),t.style.setProperty("left",`${a}px`);return}if(t.hasAttribute("dropstart")){t.style.setProperty("top",`${s}px`),t.style.setProperty("left",`${n-y}px`);return}if(t.hasAttribute("dropup")){t.style.setProperty("top",`${s-m}px`),t.style.setProperty("left",`${n}px`);return}t.style.setProperty("top",`${s+d}px`),t.style.setProperty("left",`${n}px`)}const g=""}); |
{ | ||
"name": "@contactstudio/mindbeui", | ||
"version": "0.0.40", | ||
"version": "0.0.41", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "main": "dist/mindbeui.js", |
@@ -53,3 +53,3 @@ console.log("Mindbe UI"); | ||
hideAllDropdowns(); | ||
// hideAllDropdowns(); | ||
dropdown.classList.add("visible"); | ||
@@ -56,0 +56,0 @@ |
44002
175