@contactstudio/mindbeui
Advanced tools
Comparing version 0.0.106 to 0.0.107
@@ -1,1 +0,1 @@ | ||
(function(r){typeof define=="function"&&define.amd?define(r):r()})(function(){"use strict";const p={name:"@contactstudio/mindbeui",displayName:"Mindbe UI",version:"0.0.106",type:"module",main:"dist/mindbeui.js",scripts:{dev:"vite",build:"vite build",preview:"vite preview"},devDependencies:{sass:"^1.58.0",vite:"^4.1.0",changelogen:"^0.5.3"}};console.log(`🎨 ${p.displayName} - ${p.version}`);function g(){const e=document.querySelectorAll(".alert");for(const t of e)t.onclick=()=>{t.classList.contains("visible")&&t.classList.remove("visible")}}function v(){const e=document.querySelectorAll("[tooltip]");for(const t of e)t.onmouseenter=({target:o})=>{const{top:n,left:u}=document.body.getBoundingClientRect(),{top:f,left:c}=t.getBoundingClientRect(),i=document.createElement("div");i.innerHTML=o.getAttribute("tooltip"),i.classList.add("tooltip"),document.body.append(i);const m=c-u;i.style.setProperty("left",`${m}px`);const a=i.offsetHeight,l=f-n-a-5;i.style.setProperty("top",`${l}px`)},t.onmouseleave=()=>{document.querySelector("div.tooltip").remove()}}function y(){const e=document.querySelectorAll(".accordion .item");for(const t of e)t.onclick=()=>{if(!t)return;const o=t.parentElement.querySelectorAll(".item");for(const n of o)n!==t&&n.removeAttribute("open")}}function b(){const e=document.querySelectorAll("*[dropdown-trigger]");for(const t of e){const o=document.querySelector(`.dropdown[dropdown="${t.getAttribute("dropdown-trigger")}"]`);E({trigger:t,dropdown:o})}}function E({trigger:e,dropdown:t}){e.onclick=()=>{k({dropdown:t}),q({dropdown:t}),s({trigger:e,dropdown:t}),window.onresize=()=>{s({trigger:e,dropdown:t})},document.onscroll=()=>{s({trigger:e,dropdown:t})},S({trigger:e,dropdown:t}),x({trigger:e,dropdown:t})}}function k({dropdown:e}){const t=document.querySelectorAll("*[dropdown]");for(const o of t)e!==o&&d({dropdown:o})}function q({dropdown:e}){e.classList.toggle("visible"),e.classList.contains("visible")||h()}function x({trigger:e,dropdown:t}){document.onclick=o=>{!e.contains(o.target)&&!t.contains(o.target)&&d({dropdown:t})}}function S({trigger:e,dropdown:t}){const o=t.querySelectorAll(".item");for(const n of o)n.onclick=()=>{if(t.hasAttribute("static")){setTimeout(()=>{s({trigger:e,dropdown:t})},0);return}d({dropdown:t})}}function s({trigger:e,dropdown:t}){const{top:o,bottom:n,left:u,right:f}=e.getBoundingClientRect(),{width:c,height:i}=t.getBoundingClientRect(),{width:m,height:a,top:l,left:A}=document.body.getBoundingClientRect(),T=f-A,$=u-A,w=n-l,B=o-l,D=T+c>m,L=w+i>a;L||t.style.setProperty("top",`${w}px`),L&&t.style.setProperty("top",`${B-i}px`),D||t.style.setProperty("left",`${$}px`),D&&t.style.setProperty("left",`${T-c}px`)}function d({dropdown:e}){e.classList.remove("visible"),h()}function h(){window.onresize=()=>{},document.onscroll=()=>{}}(function(){if(window&&document){let t=!1;const o=()=>t=!0,n=()=>t=!1;document.addEventListener("mousemove",()=>{t||(o(),setTimeout(n,2e3),v(),y(),b(),g())}),document.addEventListener("click",()=>{v(),y(),b(),g()})}})();const z=""}); | ||
(function(r){typeof define=="function"&&define.amd?define(r):r()})(function(){"use strict";const p={name:"@contactstudio/mindbeui",displayName:"Mindbe UI",version:"0.0.107",type:"module",main:"dist/mindbeui.js",scripts:{dev:"vite",build:"vite build",preview:"vite preview"},devDependencies:{sass:"^1.58.0",vite:"^4.1.0",changelogen:"^0.5.3"}};console.log(`🎨 ${p.displayName} - ${p.version}`);function g(){const e=document.querySelectorAll(".alert");for(const t of e)t.onclick=()=>{t.classList.contains("visible")&&t.classList.remove("visible")}}function v(){const e=document.querySelectorAll("[tooltip]");for(const t of e)t.onmouseenter=({target:o})=>{const{top:n,left:u}=document.body.getBoundingClientRect(),{top:f,left:c}=t.getBoundingClientRect(),i=document.createElement("div");i.innerHTML=o.getAttribute("tooltip"),i.classList.add("tooltip"),document.body.append(i);const m=c-u;i.style.setProperty("left",`${m}px`);const a=i.offsetHeight,l=f-n-a-5;i.style.setProperty("top",`${l}px`)},t.onmouseleave=()=>{document.querySelector("div.tooltip").remove()}}function y(){const e=document.querySelectorAll(".accordion .item");for(const t of e)t.onclick=()=>{if(!t)return;const o=t.parentElement.querySelectorAll(".item");for(const n of o)n!==t&&n.removeAttribute("open")}}function b(){const e=document.querySelectorAll("*[dropdown-trigger]");for(const t of e){const o=document.querySelector(`.dropdown[dropdown="${t.getAttribute("dropdown-trigger")}"]`);E({trigger:t,dropdown:o})}}function E({trigger:e,dropdown:t}){e.onclick=()=>{k({dropdown:t}),q({dropdown:t}),s({trigger:e,dropdown:t}),window.onresize=()=>{s({trigger:e,dropdown:t})},document.onscroll=()=>{s({trigger:e,dropdown:t})},S({trigger:e,dropdown:t}),x({trigger:e,dropdown:t})}}function k({dropdown:e}){const t=document.querySelectorAll("*[dropdown]");for(const o of t)e!==o&&d({dropdown:o})}function q({dropdown:e}){e.classList.toggle("visible"),e.classList.contains("visible")||h()}function x({trigger:e,dropdown:t}){document.onclick=o=>{!e.contains(o.target)&&!t.contains(o.target)&&d({dropdown:t})}}function S({trigger:e,dropdown:t}){const o=t.querySelectorAll(".item");for(const n of o)n.onclick=()=>{if(t.hasAttribute("static")){setTimeout(()=>{s({trigger:e,dropdown:t})},0);return}d({dropdown:t})}}function s({trigger:e,dropdown:t}){const{top:o,bottom:n,left:u,right:f}=e.getBoundingClientRect(),{width:c,height:i}=t.getBoundingClientRect(),{width:m,height:a,top:l,left:A}=document.body.getBoundingClientRect(),$=f-A,T=u-A,w=n-l,B=o-l,D=T+c>m,L=w+i>a;L||t.style.setProperty("top",`${w}px`),L&&t.style.setProperty("top",`${B-i}px`),D||t.style.setProperty("left",`${T}px`),D&&t.style.setProperty("left",`${$-c}px`)}function d({dropdown:e}){e.classList.remove("visible"),h()}function h(){window.onresize=()=>{},document.onscroll=()=>{}}(function(){if(window&&document){let t=!1;const o=()=>t=!0,n=()=>t=!1;document.addEventListener("mousemove",()=>{t||(o(),setTimeout(n,2e3),v(),y(),b(),g())}),document.addEventListener("click",()=>{v(),y(),b(),g()})}})();const z=""}); |
{ | ||
"name": "@contactstudio/mindbeui", | ||
"displayName": "Mindbe UI", | ||
"version": "0.0.106", | ||
"version": "0.0.107", | ||
"type": "module", | ||
@@ -6,0 +6,0 @@ "main": "dist/mindbeui.js", |
@@ -154,3 +154,3 @@ import pkg from "../package.json"; | ||
const rightExceeded = absoluteRightTrigger + widthDrop > totalWidth; | ||
const rightExceeded = absoluteLeftTrigger + widthDrop > totalWidth; | ||
const bottomExceeded = absoluteBottomTrigger + heightDrop > totalHeight; | ||
@@ -157,0 +157,0 @@ |
Sorry, the diff of this file is not supported yet
54220