@contactstudio/mindbeui
Advanced tools
Comparing version 0.0.96 to 0.0.97
# Changelog | ||
## v0.0.97 | ||
[compare changes](https://github.com/mindbe/mindbeui/compare/v0.0.96...v0.0.97) | ||
### 🚀 Enhancements | ||
- ✨ add alert ([b66c39b](https://github.com/mindbe/mindbeui/commit/b66c39b)) | ||
### ❤️ Contributors | ||
- Christopher Gonçalves ([@chrissgon](http://github.com/chrissgon)) | ||
## v0.0.96 | ||
@@ -5,0 +18,0 @@ |
@@ -1,1 +0,1 @@ | ||
(function(r){typeof define=="function"&&define.amd?define(r):r()})(function(){"use strict";const a={name:"@contactstudio/mindbeui",displayName:"Mindbe UI",version:"0.0.96",type:"module",main:"dist/mindbeui.js",scripts:{dev:"vite",build:"vite build",preview:"vite preview",release:"changelogen --release && npm run build && npm publish && git push --follow-tags"},devDependencies:{sass:"^1.58.0",vite:"^4.1.0",changelogen:"^0.5.3"}};console.log(`🎨 ${a.displayName} - ${a.version}`);function w(){const t=document.querySelectorAll("[tooltip]");for(const e of t)e.onmouseenter=({target:o})=>{const{top:n,left:u}=document.body.getBoundingClientRect(),{top:f,left:c}=e.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 p=i.offsetHeight,l=f-n-p-5;i.style.setProperty("top",`${l}px`)},e.onmouseleave=()=>{document.querySelector("div.tooltip").remove()}}function A(){const t=document.querySelectorAll(".accordion .item");for(const e of t)e.onclick=()=>{if(!e)return;const o=e.parentElement.querySelectorAll(".item");for(const n of o)n!==e&&n.removeAttribute("open")}}function D(){const t=document.querySelectorAll("*[dropdown-trigger]");for(const e of t){const o=document.querySelector(`.dropdown[dropdown="${e.getAttribute("dropdown-trigger")}"]`);E({trigger:e,dropdown:o})}}function E({trigger:t,dropdown:e}){t.onclick=()=>{x({dropdown:e}),L({dropdown:e}),s({trigger:t,dropdown:e}),window.onresize=()=>{s({trigger:t,dropdown:e})},document.onscroll=()=>{s({trigger:t,dropdown:e})},q({trigger:t,dropdown:e}),$({trigger:t,dropdown:e})}}function x({dropdown:t}){const e=document.querySelectorAll("*[dropdown]");for(const o of e)t!==o&&d({dropdown:o})}function L({dropdown:t}){t.classList.toggle("visible"),t.classList.contains("visible")||g()}function $({trigger:t,dropdown:e}){document.onclick=o=>{!t.contains(o.target)&&!e.contains(o.target)&&d({dropdown:e})}}function q({trigger:t,dropdown:e}){const o=e.querySelectorAll(".item");for(const n of o)n.onclick=()=>{if(e.hasAttribute("static")){setTimeout(()=>{s({trigger:t,dropdown:e})},0);return}d({dropdown:e})}}function s({trigger:t,dropdown:e}){const{top:o,bottom:n,left:u,right:f}=t.getBoundingClientRect(),{width:c,height:i}=e.getBoundingClientRect(),{width:m,height:p,top:l,left:y}=document.body.getBoundingClientRect(),v=f-y,S=u-y,b=n-l,k=o-l,h=v+c>m,T=b+i>p;T||e.style.setProperty("top",`${b}px`),T&&e.style.setProperty("top",`${k-i}px`),h||e.style.setProperty("left",`${S}px`),h&&e.style.setProperty("left",`${v-c}px`)}function d({dropdown:t}){t.classList.remove("visible"),g()}function g(){window.onresize=()=>{},document.onscroll=()=>{}}(function(){if(window&&document){let e=!1;const o=()=>e=!0,n=()=>e=!1;document.addEventListener("mousemove",()=>{e||(o(),setTimeout(n,2e3),w(),A(),D())})}})();const W=""}); | ||
(function(r){typeof define=="function"&&define.amd?define(r):r()})(function(){"use strict";const p={name:"@contactstudio/mindbeui",displayName:"Mindbe UI",version:"0.0.97",type:"module",main:"dist/mindbeui.js",scripts:{dev:"vite",build:"vite build",preview:"vite preview",release:"changelogen --release && npm run build && npm publish && git push --follow-tags"},devDependencies:{sass:"^1.58.0",vite:"^4.1.0",changelogen:"^0.5.3"}};console.log(`🎨 ${p.displayName} - ${p.version}`);function g(){const t=document.querySelectorAll(".alert");for(const e of t)e.onclick=()=>{e.classList.contains("visible")&&e.classList.remove("visible")}}function v(){const t=document.querySelectorAll("[tooltip]");for(const e of t)e.onmouseenter=({target:o})=>{const{top:n,left:u}=document.body.getBoundingClientRect(),{top:f,left:c}=e.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`)},e.onmouseleave=()=>{document.querySelector("div.tooltip").remove()}}function y(){const t=document.querySelectorAll(".accordion .item");for(const e of t)e.onclick=()=>{if(!e)return;const o=e.parentElement.querySelectorAll(".item");for(const n of o)n!==e&&n.removeAttribute("open")}}function b(){const t=document.querySelectorAll("*[dropdown-trigger]");for(const e of t){const o=document.querySelector(`.dropdown[dropdown="${e.getAttribute("dropdown-trigger")}"]`);E({trigger:e,dropdown:o})}}function E({trigger:t,dropdown:e}){t.onclick=()=>{k({dropdown:e}),q({dropdown:e}),s({trigger:t,dropdown:e}),window.onresize=()=>{s({trigger:t,dropdown:e})},document.onscroll=()=>{s({trigger:t,dropdown:e})},S({trigger:t,dropdown:e}),x({trigger:t,dropdown:e})}}function k({dropdown:t}){const e=document.querySelectorAll("*[dropdown]");for(const o of e)t!==o&&d({dropdown:o})}function q({dropdown:t}){t.classList.toggle("visible"),t.classList.contains("visible")||h()}function x({trigger:t,dropdown:e}){document.onclick=o=>{!t.contains(o.target)&&!e.contains(o.target)&&d({dropdown:e})}}function S({trigger:t,dropdown:e}){const o=e.querySelectorAll(".item");for(const n of o)n.onclick=()=>{if(e.hasAttribute("static")){setTimeout(()=>{s({trigger:t,dropdown:e})},0);return}d({dropdown:e})}}function s({trigger:t,dropdown:e}){const{top:o,bottom:n,left:u,right:f}=t.getBoundingClientRect(),{width:c,height:i}=e.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||e.style.setProperty("top",`${w}px`),L&&e.style.setProperty("top",`${B-i}px`),D||e.style.setProperty("left",`${$}px`),D&&e.style.setProperty("left",`${T-c}px`)}function d({dropdown:t}){t.classList.remove("visible"),h()}function h(){window.onresize=()=>{},document.onscroll=()=>{}}(function(){if(window&&document){let e=!1;const o=()=>e=!0,n=()=>e=!1;document.addEventListener("mousemove",()=>{e||(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.96", | ||
"version": "0.0.97", | ||
"type": "module", | ||
@@ -6,0 +6,0 @@ "main": "dist/mindbeui.js", |
@@ -5,2 +5,12 @@ import pkg from "../package.json"; | ||
function Alert() { | ||
const items = document.querySelectorAll(".alert"); | ||
for (const item of items) { | ||
item.onclick = () => { | ||
if (!item.classList.contains("visible")) return; | ||
item.classList.remove("visible"); | ||
}; | ||
} | ||
} | ||
function Tooltip() { | ||
@@ -186,4 +196,11 @@ const items = document.querySelectorAll("[tooltip]"); | ||
Dropdown(); | ||
Alert(); | ||
}); | ||
document.addEventListener("click", () => { | ||
Tooltip(); | ||
Accordion(); | ||
Dropdown(); | ||
Alert(); | ||
}); | ||
} | ||
})(); |
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
53226
28
279