@rtstic.dev/pulse 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tabs.js +1 -1
- package/package.json +1 -1
package/dist/tabs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var s="influur-tablink",b="influur-tabcontent",m="influur-tablink-active",h="influur-tablink-fill";function _(n){return!!n&&n.nodeType===Node.ELEMENT_NODE}function a(n,t){let l=n.getAttribute(t);if(l===null)return null;let o=l.trim();return o.length>0?o:null}function g(n,t=document){return Array.from(t.querySelectorAll(n)).filter(_)}function T(n){for(let t of n)t.style.display="none"}function F(n){for(let t of n)t.setAttribute(m,"false")}function I(n){n.style.display="block"}function O(n,t){for(let l of t){let o=a(l,b);if(o!==null&&o===n)return l}return null}function V(n,t){for(let l of t){let o=a(l,s);if(o!==null&&o===n)return l}return null}function y(n){return n.querySelector(`[${h}]`)??null}function $(n){for(let t of n){let l=y(t);l&&(l.style.width="0%")}}document.addEventListener("DOMContentLoaded",()=>{let n=g(`[${s}]`),t=g(`[${b}]`);if(t.length===0){console.warn("No tab contents found.");return}if(n.length===0){console.warn("No tab links found. Hiding all tab contents."),T(t);return}let l=0,o=null,u=null;function M(){u!==null&&(cancelAnimationFrame(u),u=null)}function H(e){M(),$(n);let r=y(e);if(!r){console.warn(`Active tablink is missing ${h} child`,e);return}let i=Math.max(0,
|
|
1
|
+
"use strict";(()=>{var s="influur-tablink",b="influur-tabcontent",m="influur-tablink-active",h="influur-tablink-fill";function _(n){return!!n&&n.nodeType===Node.ELEMENT_NODE}function a(n,t){let l=n.getAttribute(t);if(l===null)return null;let o=l.trim();return o.length>0?o:null}function g(n,t=document){return Array.from(t.querySelectorAll(n)).filter(_)}function T(n){for(let t of n)t.style.display="none"}function F(n){for(let t of n)t.setAttribute(m,"false")}function I(n){n.style.display="block"}function O(n,t){for(let l of t){let o=a(l,b);if(o!==null&&o===n)return l}return null}function V(n,t){for(let l of t){let o=a(l,s);if(o!==null&&o===n)return l}return null}function y(n){return n.querySelector(`[${h}]`)??null}function $(n){for(let t of n){let l=y(t);l&&(l.style.width="0%")}}document.addEventListener("DOMContentLoaded",()=>{let n=g(`[${s}]`),t=g(`[${b}]`);if(t.length===0){console.warn("No tab contents found.");return}if(n.length===0){console.warn("No tab links found. Hiding all tab contents."),T(t);return}let l=0,o=null,u=null;function M(){u!==null&&(cancelAnimationFrame(u),u=null)}function H(e){M(),$(n);let r=y(e);if(!r){console.warn(`Active tablink is missing ${h} child`,e);return}let i=Math.max(0,4e3),f=performance.now(),E=k=>{let N=k-f,L=i===0?1:Math.min(1,N/i);r.style.width=`${(L*100).toFixed(4)}%`,e.getAttribute(m)==="true"&&L<1?u=requestAnimationFrame(E):u=null};r.style.width="0%",u=requestAnimationFrame(E)}let c=e=>{if(typeof e!="string"||e.trim().length===0){console.warn("changeTab called with invalid attributeValue:",e);return}T(t),F(n);let r=O(e,t),i=V(e,n);if(!r||!i){console.warn(`No matching pair found for value "${e}"`);return}I(r),i.setAttribute(m,"true");let f=n.indexOf(i);f>=0&&(l=f),H(i)};window.changeTab=c;for(let e of n)e.addEventListener("click",r=>{r.target?.closest("a")&&r.preventDefault();let i=a(e,s);if(i===null){console.warn(`Tablink missing valid ${s} value`,e);return}c(i),p()});let d=a(n[0],s);if(d===null){console.warn(`First tablink missing ${s} value. Hiding all tab contents.`),T(t);return}c(d);function v(){if(n.length===0)return;l=(l+1)%n.length;let e=a(n[l],s);e&&c(e)}function A(){w(),o=window.setInterval(v,4e3)}function w(){o!==null&&(clearInterval(o),o=null)}function p(){A()}A()});})();
|