@contactstudio/mindbeui
Advanced tools
Comparing version 0.0.26 to 0.0.27
@@ -1,1 +0,1 @@ | ||
(function(s){typeof define=="function"&&define.amd?define(s):s()})(function(){"use strict";console.log("Mindbe UI");async function s(){const e=document.querySelectorAll(".accordion .item:not([disabled])");for(const t of e)t.addEventListener("click",()=>{const i=t.parentElement.querySelectorAll(".item:not([disabled])");for(const n of i)n!==t&&n.removeAttribute("open")})}function o(){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}),c({trigger:t,dropdown:i}),l({trigger:t,dropdown:i})}}function r({trigger:e,dropdown:t}){e.addEventListener("click",()=>{if(t.classList.contains("show")){t.classList.remove("show");return}t.classList.add("show"),u({trigger:e,dropdown:t})})}function c({trigger:e,dropdown:t}){document.addEventListener("click",i=>{!e.contains(i.target)&&!t.contains(i.target)&&t.classList.remove("show")})}function l({dropdown:e}){if(e.hasAttribute("static"))return;const t=e.querySelectorAll(".item");for(const i of t)i.addEventListener("click",()=>{e.classList.remove("show")})}function u({trigger:e,dropdown:t}){const{top:i,left:n,right:f,height:a}=e.getBoundingClientRect(),{width:d,height:m}=t.getBoundingClientRect();if(t.hasAttribute("dropend")){t.style.setProperty("top",`${i}px`),t.style.setProperty("left",`${f}px`);return}if(t.hasAttribute("dropstart")){t.style.setProperty("top",`${i}px`),t.style.setProperty("left",`${n-d}px`);return}if(t.hasAttribute("dropup")){t.style.setProperty("top",`${i-m}px`),t.style.setProperty("left",`${n}px`);return}t.style.setProperty("top",`${i+a}px`),t.style.setProperty("left",`${n}px`)}(function e(){if(document){s(),o(),document.addEventListener("click",function(t){s(),!t.target.hasAttribute("dropdown-trigger")&&o()});return}setTimeout(()=>{e()},1e3)})();const p=""}); | ||
(function(n){typeof define=="function"&&define.amd?define(n):n()})(function(){"use strict";console.log("Mindbe UI");async function n(){const e=document.querySelectorAll(".accordion .item:not([disabled])");for(const t of e)t.addEventListener("click",()=>{const i=t.parentElement.querySelectorAll(".item:not([disabled])");for(const o of i)o!==t&&o.removeAttribute("open")})}function s(){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}),c({trigger:t,dropdown:i}),l({trigger:t,dropdown:i})}}function r({trigger:e,dropdown:t}){e.addEventListener("click",()=>{if(t.classList.contains("show")){t.classList.remove("show");return}t.classList.add("show"),u({trigger:e,dropdown:t})})}function c({trigger:e,dropdown:t}){document.addEventListener("click",i=>{!e.contains(i.target)&&!t.contains(i.target)&&t.classList.remove("show")})}function l({dropdown:e}){if(e.hasAttribute("static"))return;const t=e.querySelectorAll(".item");for(const i of t)i.addEventListener("click",()=>{e.classList.remove("show")})}function u({trigger:e,dropdown:t}){const{top:i,left:o,right:a,height:f}=e.getBoundingClientRect(),{width:d,height:g}=t.getBoundingClientRect();if(t.hasAttribute("dropend")){t.style.setProperty("top",`${i}px`),t.style.setProperty("left",`${a}px`);return}if(t.hasAttribute("dropstart")){t.style.setProperty("top",`${i}px`),t.style.setProperty("left",`${o-d}px`);return}if(t.hasAttribute("dropup")){t.style.setProperty("top",`${i-g}px`),t.style.setProperty("left",`${o}px`);return}t.style.setProperty("top",`${i+f}px`),t.style.setProperty("left",`${o}px`)}(function e(){if(document){n(),s(),document.addEventListener("click",function(t){n(),console.log("click"),!t.target.hasAttribute("dropdown-trigger")&&(console.log("passow"),console.log(t.target.hasAttribute("dropdown-trigger")),console.log(t.target),s())});return}setTimeout(()=>{e()},1e3)})();const p=""}); |
{ | ||
"name": "@contactstudio/mindbeui", | ||
"version": "0.0.26", | ||
"version": "0.0.27", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "main": "dist/mindbeui.js", |
@@ -102,3 +102,7 @@ console.log("Mindbe UI"); | ||
console.log("click"); | ||
if (e.target.hasAttribute("dropdown-trigger")) return; | ||
console.log("passow", ); | ||
console.log(e.target.hasAttribute("dropdown-trigger")); | ||
console.log(e.target); | ||
@@ -105,0 +109,0 @@ Dropdown(); |
44010
174