@contactstudio/mindbeui
Advanced tools
Comparing version 0.0.51 to 0.0.52
@@ -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")}"]`);l({trigger:t,dropdown:i})}}function l({trigger:e,dropdown:t}){e.onclick=()=>{u(),f({dropdown:t}),r({trigger:e,dropdown:t}),a({trigger:e,dropdown:t}),d({trigger:e,dropdown:t})}}function u(){const e=document.querySelectorAll("*[dropdown]");for(const t of e)t.classList.remove("visible")}function f({dropdown:e}){if(e.classList.contains("visible")){e.classList.remove("visible");return}e.classList.add("visible")}function d({trigger:e,dropdown:t}){document.onclick=i=>{!e.contains(i.target)&&!t.contains(i.target)&&t.classList.remove("visible")}}function a({trigger:e,dropdown:t}){const i=t.querySelectorAll(".item");for(const o of i)o.onclick=()=>{r({trigger:e,dropdown:t}),!t.hasAttribute("static")&&t.classList.remove("visible")}}function r({trigger:e,dropdown:t}){const{top:i,left:o,right:p,height:m}=e.getBoundingClientRect(),{width:y,height:g}=t.getBoundingClientRect(),b=Math.abs(document.body.getBoundingClientRect().top),s=i+b;if(t.hasAttribute("dropend")){t.style.setProperty("top",`${s}px`),t.style.setProperty("left",`${p}px`);return}if(t.hasAttribute("dropstart")){t.style.setProperty("top",`${s}px`),t.style.setProperty("left",`${o-y}px`);return}if(t.hasAttribute("dropup")){t.style.setProperty("top",`${s-g}px`),t.style.setProperty("left",`${o}px`);return}t.style.setProperty("top",`${s+m}px`),t.style.setProperty("left",`${o}px`)}const v=""}); | ||
(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 o=t.parentElement.querySelectorAll(".item:not([disabled])");for(const i of o)i!==t&&i.removeAttribute("open")}}function c(){const e=document.querySelectorAll("*[dropdown-trigger]");for(const t of e){const o=document.querySelector(`.dropdown[dropdown="${t.getAttribute("dropdown-trigger")}"]`);l({trigger:t,dropdown:o})}}function l({trigger:e,dropdown:t}){e.onclick=()=>{u(),f({dropdown:t}),r({trigger:e,dropdown:t}),a({trigger:e,dropdown:t}),d({trigger:e,dropdown:t})}}function u(){const e=document.querySelectorAll("*[dropdown]");for(const t of e)t.classList.remove("visible")}function f({dropdown:e}){if(e.classList.contains("visible")){e.classList.remove("visible");return}e.classList.add("visible")}function d({trigger:e,dropdown:t}){document.onclick=o=>{!e.contains(o.target)&&!t.contains(o.target)&&t.classList.remove("visible")}}function a({trigger:e,dropdown:t}){const o=t.querySelectorAll(".item");for(const i of o)i.onclick=()=>{console.log("trigger item"),r({trigger:e,dropdown:t}),!t.hasAttribute("static")&&t.classList.remove("visible")}}function r({trigger:e,dropdown:t}){const{top:o,left:i,right:m,height:p}=e.getBoundingClientRect(),{width:y,height:g}=t.getBoundingClientRect(),b=Math.abs(document.body.getBoundingClientRect().top),s=o+b;if(t.hasAttribute("dropend")){t.style.setProperty("top",`${s}px`),t.style.setProperty("left",`${m}px`);return}if(t.hasAttribute("dropstart")){t.style.setProperty("top",`${s}px`),t.style.setProperty("left",`${i-y}px`);return}if(t.hasAttribute("dropup")){t.style.setProperty("top",`${s-g}px`),t.style.setProperty("left",`${i}px`);return}t.style.setProperty("top",`${s+p}px`),t.style.setProperty("left",`${i}px`)}const v=""}); |
{ | ||
"name": "@contactstudio/mindbeui", | ||
"version": "0.0.51", | ||
"version": "0.0.52", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "main": "dist/mindbeui.js", |
@@ -89,2 +89,3 @@ console.log("Mindbe UI"); | ||
item.onclick = () => { | ||
console.log("trigger item"); | ||
setPositionDropdown({ trigger, dropdown }); | ||
@@ -91,0 +92,0 @@ if (dropdown.hasAttribute("static")) return; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
47897
23
188