@k37z3r/jbase 2.0.0
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/LICENSE +621 -0
- package/README.md +124 -0
- package/dist/browser.d.ts +30 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +29 -0
- package/dist/browser.js.map +1 -0
- package/dist/core.d.ts +42 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +78 -0
- package/dist/core.js.map +1 -0
- package/dist/index.cjs +2150 -0
- package/dist/index.d.ts +1158 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +100 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2118 -0
- package/dist/jbase.browser.js +1906 -0
- package/dist/jbase.js +1898 -0
- package/dist/jbase.min.js +9 -0
- package/dist/modules/css/classes.d.ts +61 -0
- package/dist/modules/css/classes.d.ts.map +1 -0
- package/dist/modules/css/classes.js +88 -0
- package/dist/modules/css/classes.js.map +1 -0
- package/dist/modules/css/index.d.ts +30 -0
- package/dist/modules/css/index.d.ts.map +1 -0
- package/dist/modules/css/index.js +33 -0
- package/dist/modules/css/index.js.map +1 -0
- package/dist/modules/css/styles.d.ts +31 -0
- package/dist/modules/css/styles.d.ts.map +1 -0
- package/dist/modules/css/styles.js +49 -0
- package/dist/modules/css/styles.js.map +1 -0
- package/dist/modules/data/arrays.d.ts +131 -0
- package/dist/modules/data/arrays.d.ts.map +1 -0
- package/dist/modules/data/arrays.js +177 -0
- package/dist/modules/data/arrays.js.map +1 -0
- package/dist/modules/data/index.d.ts +29 -0
- package/dist/modules/data/index.d.ts.map +1 -0
- package/dist/modules/data/index.js +33 -0
- package/dist/modules/data/index.js.map +1 -0
- package/dist/modules/data/objects.d.ts +108 -0
- package/dist/modules/data/objects.d.ts.map +1 -0
- package/dist/modules/data/objects.js +168 -0
- package/dist/modules/data/objects.js.map +1 -0
- package/dist/modules/data/types.d.ts +35 -0
- package/dist/modules/data/types.d.ts.map +1 -0
- package/dist/modules/data/types.js +43 -0
- package/dist/modules/data/types.js.map +1 -0
- package/dist/modules/dom/attributes.d.ts +42 -0
- package/dist/modules/dom/attributes.d.ts.map +1 -0
- package/dist/modules/dom/attributes.js +69 -0
- package/dist/modules/dom/attributes.js.map +1 -0
- package/dist/modules/dom/content.d.ts +39 -0
- package/dist/modules/dom/content.d.ts.map +1 -0
- package/dist/modules/dom/content.js +63 -0
- package/dist/modules/dom/content.js.map +1 -0
- package/dist/modules/dom/index.d.ts +78 -0
- package/dist/modules/dom/index.d.ts.map +1 -0
- package/dist/modules/dom/index.js +48 -0
- package/dist/modules/dom/index.js.map +1 -0
- package/dist/modules/dom/manipulation.d.ts +159 -0
- package/dist/modules/dom/manipulation.d.ts.map +1 -0
- package/dist/modules/dom/manipulation.js +343 -0
- package/dist/modules/dom/manipulation.js.map +1 -0
- package/dist/modules/dom/states.d.ts +50 -0
- package/dist/modules/dom/states.d.ts.map +1 -0
- package/dist/modules/dom/states.js +89 -0
- package/dist/modules/dom/states.js.map +1 -0
- package/dist/modules/dom/traversal.d.ts +246 -0
- package/dist/modules/dom/traversal.d.ts.map +1 -0
- package/dist/modules/dom/traversal.js +527 -0
- package/dist/modules/dom/traversal.js.map +1 -0
- package/dist/modules/effects/fade.d.ts +58 -0
- package/dist/modules/effects/fade.d.ts.map +1 -0
- package/dist/modules/effects/fade.js +104 -0
- package/dist/modules/effects/fade.js.map +1 -0
- package/dist/modules/effects/index.d.ts +40 -0
- package/dist/modules/effects/index.d.ts.map +1 -0
- package/dist/modules/effects/index.js +38 -0
- package/dist/modules/effects/index.js.map +1 -0
- package/dist/modules/effects/slide.d.ts +58 -0
- package/dist/modules/effects/slide.d.ts.map +1 -0
- package/dist/modules/effects/slide.js +103 -0
- package/dist/modules/effects/slide.js.map +1 -0
- package/dist/modules/effects/vertical.d.ts +58 -0
- package/dist/modules/effects/vertical.d.ts.map +1 -0
- package/dist/modules/effects/vertical.js +118 -0
- package/dist/modules/effects/vertical.js.map +1 -0
- package/dist/modules/events/binding.d.ts +47 -0
- package/dist/modules/events/binding.d.ts.map +1 -0
- package/dist/modules/events/binding.js +60 -0
- package/dist/modules/events/binding.js.map +1 -0
- package/dist/modules/events/form.d.ts +72 -0
- package/dist/modules/events/form.d.ts.map +1 -0
- package/dist/modules/events/form.js +106 -0
- package/dist/modules/events/form.js.map +1 -0
- package/dist/modules/events/index.d.ts +62 -0
- package/dist/modules/events/index.d.ts.map +1 -0
- package/dist/modules/events/index.js +53 -0
- package/dist/modules/events/index.js.map +1 -0
- package/dist/modules/events/keyboard.d.ts +65 -0
- package/dist/modules/events/keyboard.d.ts.map +1 -0
- package/dist/modules/events/keyboard.js +83 -0
- package/dist/modules/events/keyboard.js.map +1 -0
- package/dist/modules/events/lifecycle.d.ts +28 -0
- package/dist/modules/events/lifecycle.d.ts.map +1 -0
- package/dist/modules/events/lifecycle.js +40 -0
- package/dist/modules/events/lifecycle.js.map +1 -0
- package/dist/modules/events/mouse.d.ts +120 -0
- package/dist/modules/events/mouse.d.ts.map +1 -0
- package/dist/modules/events/mouse.js +172 -0
- package/dist/modules/events/mouse.js.map +1 -0
- package/dist/modules/events/touch.d.ts +61 -0
- package/dist/modules/events/touch.d.ts.map +1 -0
- package/dist/modules/events/touch.js +74 -0
- package/dist/modules/events/touch.js.map +1 -0
- package/dist/modules/http/get.d.ts +47 -0
- package/dist/modules/http/get.d.ts.map +1 -0
- package/dist/modules/http/get.js +65 -0
- package/dist/modules/http/get.js.map +1 -0
- package/dist/modules/http/index.d.ts +37 -0
- package/dist/modules/http/index.d.ts.map +1 -0
- package/dist/modules/http/index.js +42 -0
- package/dist/modules/http/index.js.map +1 -0
- package/dist/modules/http/post.d.ts +36 -0
- package/dist/modules/http/post.d.ts.map +1 -0
- package/dist/modules/http/post.js +54 -0
- package/dist/modules/http/post.js.map +1 -0
- package/dist/types.d.ts +61 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +15 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +51 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +71 -0
- package/dist/utils.js.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @k37z3r/jbase - A modern micro-framework for the web: jBase offers the familiar syntax of classic DOM libraries, but without their baggage. Fully typed, modular, and optimized for modern browser engines.
|
|
3
|
+
* @version 2.0.0
|
|
4
|
+
* @homepage https://github.com/k37z3r/jBase-2.0
|
|
5
|
+
* @author Sven Minio (https://github.com/k37z3r/jBase-2.0)
|
|
6
|
+
* @license GPL-3.0-or-later
|
|
7
|
+
* @copyright 2026 Sven Minio (https://github.com/k37z3r/jBase-2.0)
|
|
8
|
+
*/
|
|
9
|
+
"use strict";(()=>{var ve=Object.defineProperty;var i=(t,e)=>()=>(t&&(e=t(t=0)),e);var ye=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),a=(t,e)=>{for(var n in e)ve(t,n,{get:e[n],enumerable:!0})};var c,d=i(()=>{"use strict";c=class extends Array{selectorSource="";constructor(e){if(super(),!(typeof document>"u")&&(this.selectorSource=typeof e=="string"?e:"<DOM Object/Array>",!!e))if(e instanceof HTMLElement||e===document||e===window||e instanceof Element)this.push(e);else if(typeof e=="string"){let n=e.trim();if(n.startsWith("<")&&n.endsWith(">")){let s=document.createElement("div");s.innerHTML=n,this.push(...Array.from(s.children))}else if(n.startsWith("#")&&!n.includes(" ")&&!n.includes(".")){let s=document.getElementById(n.slice(1));s&&this.push(s)}else this.push(...Array.from(document.querySelectorAll(e)))}else(e instanceof NodeList||Array.isArray(e))&&this.push(...Array.from(e))}toJSON(){return{meta:"jBase Wrapper",query:this.selectorSource,count:this.length,preview:this.slice(0,10).map(e=>e instanceof Element?e.tagName.toLowerCase():typeof e)}}}});var p={};a(p,{addClass:()=>xe,hasClass:()=>we,removeClass:()=>be,toggleClass:()=>Te});function xe(...t){return this.forEach(e=>{e instanceof Element&&e.classList.add(...t)}),this}function be(...t){return this.forEach(e=>{e instanceof Element&&e.classList.remove(...t)}),this}function Te(t){return this.forEach(e=>{e instanceof Element&&e.classList.toggle(t)}),this}function we(t){return this.some(e=>e instanceof Element&&e.classList.contains(t))}var K=i(()=>{"use strict";});var m={};a(m,{css:()=>Me});function Me(t,e){if(e===void 0){let n=this[0];return n instanceof HTMLElement||n instanceof SVGElement?window.getComputedStyle(n)[t]:""}return this.forEach(n=>{(n instanceof HTMLElement||n instanceof SVGElement)&&(n.style[t]=e)}),this}var I=i(()=>{"use strict";});var J,W=i(()=>{"use strict";K();I();J={...p,...m}});var B={};a(B,{off:()=>Se,on:()=>Le});function Le(t,e){return this.forEach(n=>{n.addEventListener(t,e)}),this}function Se(t,e){return this.forEach(n=>{n.removeEventListener(t,e)}),this}var q=i(()=>{"use strict";});var j={};a(j,{click:()=>Ce,dblclick:()=>_e,mousedown:()=>Ae,mouseenter:()=>Oe,mouseleave:()=>He,mousemove:()=>ke,mouseout:()=>Ke,mouseover:()=>Ie,mouseup:()=>Ne});function Ce(t){return t?this.on("click",t):(this.forEach(e=>{e instanceof HTMLElement&&e.click()}),this)}function ke(t){return this.on("mousemove",t)}function He(t){return this.on("mouseleave",t)}function Oe(t){return this.on("mouseenter",t)}function Ae(t){return this.on("mousedown",t)}function Ne(t){return this.on("mouseup",t)}function _e(t){return t?this.on("dblclick",t):(this.forEach(e=>{e instanceof HTMLElement&&e.dispatchEvent(new MouseEvent("dblclick",{bubbles:!0,cancelable:!0,view:window}))}),this)}function Ke(t){return this.on("mouseout",t)}function Ie(t){return this.on("mouseover",t)}var P=i(()=>{"use strict";});var E={};a(E,{ready:()=>Je});function Je(t){return document.readyState==="complete"||document.readyState==="interactive"?t():this.on("DOMContentLoaded",t),this}var $=i(()=>{"use strict";});var g={};a(g,{keydown:()=>We,keypress:()=>Pe,keyup:()=>qe,pressedKey:()=>$e});function We(t){return this.on("keydown",t)}function qe(t){return this.on("keyup",t)}function Pe(t){return this.on("keypress",t)}function $e(t,e){return this.on("keydown",n=>{let s=n;s.key.toLowerCase()===t.toLowerCase()&&e(s)})}var D=i(()=>{"use strict";});var v={};a(v,{blur:()=>ze,change:()=>Fe,focus:()=>Ve,input:()=>Ue,submit:()=>De});function De(t){return this.on("submit",t)}function Fe(t){return this.on("change",t)}function Ue(t){return this.on("input",t)}function Ve(t){return t?this.on("focus",t):(this.forEach(e=>{e instanceof HTMLElement&&e.focus()}),this)}function ze(t){return t?this.on("blur",t):(this.forEach(e=>{e instanceof HTMLElement&&e.blur()}),this)}var F=i(()=>{"use strict";});var y={};a(y,{touchcancel:()=>Qe,touchend:()=>Ge,touchmove:()=>Re,touchstart:()=>Xe});function Xe(t){return this.on("touchstart",t)}function Ge(t){return this.on("touchend",t)}function Re(t){return this.on("touchmove",t)}function Qe(t){return this.on("touchcancel",t)}var U=i(()=>{"use strict";});var V,z=i(()=>{"use strict";q();P();$();D();F();U();V={...B,...j,...E,...g,...v,...y}});var x={};a(x,{attr:()=>Ye,val:()=>Ze});function Ye(t,e){if(e===void 0){let n=this[0];return n instanceof Element?n.getAttribute(t):null}return this.forEach(n=>{n instanceof Element&&n.setAttribute(t,e)}),this}function Ze(t){if(t===void 0){let e=this[0];return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement?e.value:""}return this.forEach(e=>{(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement)&&(e.value=t)}),this}var X=i(()=>{"use strict";});var b={};a(b,{html:()=>et,text:()=>tt});function et(t){if(t===void 0){let e=this[0];return e instanceof Element?e.innerHTML:""}return this.forEach(e=>{e instanceof Element&&(e.innerHTML=t)}),this}function tt(t){if(t===void 0){let e=this[0];return e instanceof Node&&e.textContent||""}return this.forEach(e=>{e instanceof HTMLElement&&(e.textContent=t)}),this}var G=i(()=>{"use strict";});var T={};a(T,{after:()=>ut,append:()=>it,appendTo:()=>ht,before:()=>ct,empty:()=>ot,insertAfter:()=>pt,insertBefore:()=>dt,prepend:()=>at,prependTo:()=>lt,remove:()=>st,replaceWith:()=>ft,replaceWithClone:()=>rt,unwrap:()=>Bt,wrap:()=>mt});function nt(t){let e=document.createElement("div");return e.innerHTML=t.trim(),e.firstElementChild}function f(t){let e=document.createDocumentFragment(),n=s=>{if(typeof s=="string"){let o=document.createElement("div");for(o.innerHTML=s.trim();o.firstChild;)e.appendChild(o.firstChild)}else s instanceof Node?e.appendChild(s):(s instanceof c||Array.isArray(s)||s instanceof NodeList)&&Array.from(s).forEach(o=>n(o))};return n(t),e}function st(){return this.forEach(t=>{t instanceof Element&&t.remove()}),this}function ot(){return this.forEach(t=>{t instanceof Element&&(t.innerHTML="")}),this}function rt(){let t=[];return this.forEach(e=>{if(e instanceof Element){let n=e.cloneNode(!0);e.replaceWith(n),t.push(n)}}),new this.constructor(t)}function it(t){let e=f(t);return this.forEach((n,s)=>{if(n instanceof Element){let o=s<this.length-1?e.cloneNode(!0):e;n.appendChild(o)}}),this}function at(t){let e=f(t);return this.forEach((n,s)=>{if(n instanceof Element){let o=s<this.length-1?e.cloneNode(!0):e;n.prepend(o)}}),this}function ct(t){let e=f(t);return this.forEach((n,s)=>{if(n instanceof Element){let o=s<this.length-1?e.cloneNode(!0):e;n.before(o)}}),this}function ut(t){let e=f(t);return this.forEach((n,s)=>{if(n instanceof Element){let o=s<this.length-1?e.cloneNode(!0):e;n.after(o)}}),this}function ft(t){let e=f(t);return this.forEach((n,s)=>{if(n instanceof Element){let o=s<this.length-1?e.cloneNode(!0):e;n.replaceWith(o)}}),this}function ht(t){let e=typeof t=="string"?document.querySelector(t):t;if(e instanceof Element){let n=document.createDocumentFragment();this.forEach(s=>{s instanceof Node&&n.appendChild(s)}),e.appendChild(n)}return this}function lt(t){let e=typeof t=="string"?document.querySelector(t):t;if(e instanceof Element){let n=document.createDocumentFragment();this.forEach(s=>{s instanceof Node&&n.appendChild(s)}),e.prepend(n)}return this}function dt(t){let e=typeof t=="string"?document.querySelector(t):t;if(e instanceof Element){let n=document.createDocumentFragment();this.forEach(s=>{s instanceof Node&&n.appendChild(s)}),e.before(n)}return this}function pt(t){let e=typeof t=="string"?document.querySelector(t):t;if(e instanceof Element){let n=document.createDocumentFragment();this.forEach(s=>{s instanceof Node&&n.appendChild(s)}),e.after(n)}return this}function mt(t){return this.forEach(e=>{if(e instanceof Element){let n=nt(t);e.parentNode&&e.parentNode.insertBefore(n,e),n.appendChild(e)}}),this}function Bt(){return this.forEach(t=>{if(t instanceof Element&&t.parentElement){let e=t.parentElement,n=document.createDocumentFragment();for(;e.firstChild;)n.appendChild(e.firstChild);e.replaceWith(n)}}),this}var R=i(()=>{"use strict";d();});var w={};a(w,{children:()=>gt,closest:()=>jt,descendants:()=>yt,descendantsUntil:()=>Tt,eq:()=>_t,filterBy:()=>Jt,findAll:()=>vt,first:()=>Kt,last:()=>It,next:()=>wt,nextAll:()=>kt,nextSibling:()=>Lt,nextUntil:()=>At,not:()=>Wt,parent:()=>Et,parents:()=>xt,parentsUntil:()=>bt,prev:()=>Mt,prevAll:()=>Ht,prevSibling:()=>St,prevUntil:()=>Nt,sibling:()=>Ct,siblings:()=>Ot});function jt(t){let e=[];this.forEach(s=>{if(s instanceof Element){let o=s.closest(t);o&&e.push(o)}});let n=this.constructor;return new n([...new Set(e)])}function Et(){let t=[];this.forEach(n=>{n instanceof Element&&n.parentElement&&t.push(n.parentElement)});let e=this.constructor;return new e([...new Set(t)])}function gt(t){let e=[];this.forEach(s=>{if(s instanceof Element){let o=Array.from(s.children);e=e.concat(o)}}),t&&(e=e.filter(s=>s.matches(t)));let n=this.constructor;return new n(e)}function vt(t){let e=[];this.forEach(s=>{(s instanceof Element||s instanceof Document)&&s.querySelectorAll(t).forEach(r=>e.push(r))});let n=this.constructor;return new n([...new Set(e)])}function yt(){return this.findAll("*")}function xt(t){let e=[];this.forEach(s=>{if(s instanceof Element){let o=s.parentElement;for(;o;)(!t||o.matches(t))&&e.push(o),o=o.parentElement}});let n=this.constructor;return new n([...new Set(e)])}function bt(t,e){let n=[];this.forEach(o=>{if(o instanceof Element){let r=o.parentElement;for(;r&&!r.matches(t);)(!e||r.matches(e))&&n.push(r),r=r.parentElement}});let s=this.constructor;return new s([...new Set(n)])}function Tt(t,e){let n=[],s=r=>{let _=r.children;for(let l=0;l<_.length;l++){let h=_[l];h.matches(t)||((!e||h.matches(e))&&n.push(h),s(h))}};this.forEach(r=>{r instanceof Element&&s(r)});let o=this.constructor;return new o([...new Set(n)])}function wt(t){let e=[];this.forEach(s=>{if(s instanceof Element&&s.nextElementSibling){let o=s.nextElementSibling;(!t||o.matches(t))&&e.push(o)}});let n=this.constructor;return new n([...new Set(e)])}function Mt(t){let e=[];this.forEach(s=>{if(s instanceof Element&&s.previousElementSibling){let o=s.previousElementSibling;(!t||o.matches(t))&&e.push(o)}});let n=this.constructor;return new n([...new Set(e)])}function Lt(t){return this.next(t)}function St(t){return this.prev(t)}function Ct(t){return this.next(t)}function kt(t){let e=[];this.forEach(s=>{if(s instanceof Element){let o=s.nextElementSibling;for(;o;)(!t||o.matches(t))&&e.push(o),o=o.nextElementSibling}});let n=this.constructor;return new n([...new Set(e)])}function Ht(t){let e=[];this.forEach(s=>{if(s instanceof Element){let o=s.previousElementSibling;for(;o;)(!t||o.matches(t))&&e.push(o),o=o.previousElementSibling}});let n=this.constructor;return new n([...new Set(e)])}function Ot(t){let e=[];this.forEach(s=>{s instanceof Element&&s.parentElement&&Array.from(s.parentElement.children).forEach(r=>{r!==s&&(!t||r.matches(t))&&e.push(r)})});let n=this.constructor;return new n([...new Set(e)])}function At(t,e){let n=[];this.forEach(o=>{if(o instanceof Element){let r=o.nextElementSibling;for(;r&&!r.matches(t);)(!e||r.matches(e))&&n.push(r),r=r.nextElementSibling}});let s=this.constructor;return new s([...new Set(n)])}function Nt(t,e){let n=[];this.forEach(o=>{if(o instanceof Element){let r=o.previousElementSibling;for(;r&&!r.matches(t);)(!e||r.matches(e))&&n.push(r),r=r.previousElementSibling}});let s=this.constructor;return new s([...new Set(n)])}function _t(t){let e=this.length,n=t<0?e+t:t,s=this[n],o=this.constructor;return new o(s?[s]:[])}function Kt(){return this.eq(0)}function It(){return this.eq(-1)}function Jt(t){let e=[];this.forEach((s,o)=>{s instanceof Element&&(typeof t=="string"?s.matches(t)&&e.push(s):typeof t=="function"&&t.call(s,o,s)&&e.push(s))});let n=this.constructor;return new n(e)}function Wt(t){let e=[];this.forEach((s,o)=>{s instanceof Element&&(typeof t=="string"?s.matches(t)||e.push(s):typeof t=="function"&&(t.call(s,o,s)||e.push(s)))});let n=this.constructor;return new n(e)}var Q=i(()=>{"use strict";});var M={};a(M,{checked:()=>qt,disabled:()=>$t,selected:()=>Pt});function qt(t){if(t===void 0){let e=this[0];return e instanceof HTMLInputElement?e.checked:!1}return this.forEach(e=>{e instanceof HTMLInputElement&&(e.checked=t)}),this}function Pt(t){if(t===void 0){let e=this[0];return e instanceof HTMLOptionElement?e.selected:!1}return this.forEach(e=>{e instanceof HTMLOptionElement&&(e.selected=t)}),this}function $t(t){if(t===void 0){let e=this[0];return e instanceof HTMLElement&&"disabled"in e?e.disabled:!1}return this.forEach(e=>{e instanceof HTMLElement&&"disabled"in e&&(e.disabled=t,t?e.classList.add("disabled"):e.classList.remove("disabled"))}),this}var Y=i(()=>{"use strict";});var Z,ee=i(()=>{"use strict";X();G();R();Q();Y();Z={...x,...b,...T,...w,...M}});var L={};a(L,{slideIn:()=>Dt,slideOut:()=>Ft,slideToggle:()=>Ut});function Dt(t={}){let{duration:e=300}=t;return this.forEach(n=>{n instanceof HTMLElement&&(n.style.willChange="transform",n.style.transition=`transform ${e}ms cubic-bezier(0.4, 0.0, 0.2, 1)`,requestAnimationFrame(()=>{n.style.transform="translateX(0%)"}),n.setAttribute("data-slide-state","open"))}),this}function Ft(t={}){let{direction:e="left",duration:n=300}=t,s=e==="left"?"-100%":"100%";return this.forEach(o=>{o instanceof HTMLElement&&(o.style.willChange="transform",o.style.transition=`transform ${n}ms cubic-bezier(0.4, 0.0, 0.2, 1)`,requestAnimationFrame(()=>{o.style.transform=`translateX(${s})`}),o.setAttribute("data-slide-state","closed"))}),this}function Ut(t={}){return this.forEach(e=>{if(e instanceof HTMLElement){let n=e.getAttribute("data-slide-state"),s=e.style.transform;n==="open"||s==="translateX(0%)"||window.getComputedStyle(e).display!=="none"?new this.constructor(e).slideOut(t):new this.constructor(e).slideIn(t)}}),this}var te=i(()=>{"use strict";});var S={};a(S,{slideDown:()=>Vt,slideToggleBox:()=>Xt,slideUp:()=>zt});function Vt(t={}){let{duration:e=300,displayType:n="block"}=t;return this.forEach(s=>{if(s instanceof HTMLElement){if(window.getComputedStyle(s).display!=="none")return;s.style.display=n;let o=s.scrollHeight;s.style.height="0px",s.style.overflow="hidden",s.style.transition=`height ${e}ms ease-in-out`,s.offsetHeight,s.style.height=o+"px",setTimeout(()=>{s.style.height="auto",s.style.overflow="visible",s.style.transition=""},e)}}),this}function zt(t={}){let{duration:e=300}=t;return this.forEach(n=>{n instanceof HTMLElement&&(n.style.height=n.scrollHeight+"px",n.style.overflow="hidden",n.style.transition=`height ${e}ms ease-in-out`,n.offsetHeight,n.style.height="0px",setTimeout(()=>{n.style.display="none",n.style.height="",n.style.overflow="",n.style.transition=""},e))}),this}function Xt(t={}){return this.forEach(e=>{if(e instanceof HTMLElement){let n=window.getComputedStyle(e).display,s=new this.constructor(e);n==="none"?s.slideDown(t):s.slideUp(t)}}),this}var ne=i(()=>{"use strict";});var C={};a(C,{fadeIn:()=>Gt,fadeOut:()=>Rt,fadeToggle:()=>Qt});function Gt(t={}){let{duration:e=300,displayType:n="block"}=t;return this.forEach(s=>{s instanceof HTMLElement&&(s.style.opacity="0",s.style.display=n,s.style.transition=`opacity ${e}ms ease-in-out`,s.offsetHeight,requestAnimationFrame(()=>{s.style.opacity="1"}),setTimeout(()=>{s.style.transition=""},e))}),this}function Rt(t={}){let{duration:e=300}=t;return this.forEach(n=>{n instanceof HTMLElement&&(n.style.opacity="1",n.style.transition=`opacity ${e}ms ease-in-out`,n.offsetHeight,requestAnimationFrame(()=>{n.style.opacity="0"}),setTimeout(()=>{n.style.display="none",n.style.transition=""},e))}),this}function Qt(t={}){return this.forEach(e=>{if(e instanceof HTMLElement){let n=window.getComputedStyle(e).display,s=new this.constructor(e);n==="none"?s.fadeIn(t):s.fadeOut(t)}}),this}var se=i(()=>{"use strict";});var oe,re=i(()=>{"use strict";te();ne();se();oe={...L,...S,...C}});var k=i(()=>{"use strict";});var H={};a(H,{get:()=>Yt,getText:()=>Zt});async function Yt(t){let e=await fetch(t,{signal:AbortSignal.timeout(5e3)});if(!e.ok)throw new Error(`HTTP Error: ${e.status}`);return await e.json()}async function Zt(t){let e=await fetch(t);if(!e.ok)throw new Error(`HTTP Error: ${e.status}`);return await e.text()}var ie=i(()=>{"use strict";});var O={};a(O,{post:()=>en});async function en(t,e={}){let n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(n.status===204){let s=await n.text();return s?JSON.parse(s):{}}if(!n.ok)throw new Error(`HTTP Error: ${n.status}`);return await n.json()}var ae=i(()=>{"use strict";});var A,ce=i(()=>{"use strict";ie();ae();A={...H,...O}});var N=i(()=>{"use strict";});var ue=i(()=>{"use strict";N();});var fe=i(()=>{"use strict";N();});var he=i(()=>{"use strict";ue();fe();});var u,le,de,pe,me,Be,je,Ee,ge=i(()=>{"use strict";d();W();z();ee();re();k();k();ce();he();Object.assign(c.prototype,J);Object.assign(c.prototype,V);Object.assign(c.prototype,Z);Object.assign(c.prototype,oe);u=t=>new c(t),le=u,de=u,pe=u,me=u,Be=u,je=u,Ee=u});var on=ye(()=>{ge();window.$=le;window.jBase=Ee;window.jB=de;window._jB=pe;window.__jB=me;window._jBase=Be;window.__jBase=je;window.http=A;console.log("jBase initialized and ready!")});on();})();
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file src/modules/css/classes.ts
|
|
3
|
+
* @version 2.0.0
|
|
4
|
+
* @since 2.0.0
|
|
5
|
+
* @license GPL-3.0-or-later
|
|
6
|
+
* @copyright Sven Minio 2026
|
|
7
|
+
* @author Sven Minio <https://sven-minio.de>
|
|
8
|
+
* @category CSS
|
|
9
|
+
* @description
|
|
10
|
+
* * π¬π§: Methods for manipulating CSS classes (add, remove, toggle, has).
|
|
11
|
+
* * π©πͺ: Methoden zur Manipulation von CSS-Klassen (add, remove, toggle, has).
|
|
12
|
+
* @requires ../../core
|
|
13
|
+
* * π¬π§: Depends on the core jBase class for type definitions.
|
|
14
|
+
* * π©πͺ: HΓ€ngt von der Core-jBase-Klasse fΓΌr Typ-Definitionen ab.
|
|
15
|
+
*/
|
|
16
|
+
import { jBase } from '../../core';
|
|
17
|
+
/**
|
|
18
|
+
* * π¬π§: Adds one or more CSS classes to each element in the collection.
|
|
19
|
+
* * π©πͺ: FΓΌgt jedem Element in der Sammlung eine oder mehrere CSS-Klassen hinzu.
|
|
20
|
+
* @param classNames
|
|
21
|
+
* * π¬π§: One or more class names to be added
|
|
22
|
+
* * π©πͺ: Eine oder mehrere Klassennamen, die hinzugefΓΌgt werden sollen
|
|
23
|
+
* @returns
|
|
24
|
+
* * π¬π§: The current jBase instance for method chaining
|
|
25
|
+
* * π©πͺ: Die aktuelle jBase-Instanz fΓΌr Method-Chaining
|
|
26
|
+
*/
|
|
27
|
+
export declare function addClass(this: jBase, ...classNames: string[]): jBase;
|
|
28
|
+
/**
|
|
29
|
+
* * π¬π§: Removes one or more CSS classes from each element in the collection.
|
|
30
|
+
* * π©πͺ: Entfernt eine oder mehrere CSS-Klassen von jedem Element in der Sammlung.
|
|
31
|
+
* @param classNames
|
|
32
|
+
* * π¬π§: One or more class names to be removed
|
|
33
|
+
* * π©πͺ: Eine oder mehrere Klassennamen, die entfernt werden sollen
|
|
34
|
+
* @returns
|
|
35
|
+
* * π¬π§: The current jBase instance for method chaining
|
|
36
|
+
* * π©πͺ: Die aktuelle jBase-Instanz fΓΌr Method-Chaining
|
|
37
|
+
*/
|
|
38
|
+
export declare function removeClass(this: jBase, ...classNames: string[]): jBase;
|
|
39
|
+
/**
|
|
40
|
+
* * π¬π§: Toggles a CSS class (adds if missing, removes if present) for each element.
|
|
41
|
+
* * π©πͺ: Wechselt eine CSS-Klasse (fΓΌgt hinzu wenn fehlt, entfernt wenn vorhanden).
|
|
42
|
+
* @param className
|
|
43
|
+
* * π¬π§: The class name to toggle.
|
|
44
|
+
* * π©πͺ: Der Klassenname, der gewechselt werden soll.
|
|
45
|
+
* @returns
|
|
46
|
+
* * π¬π§: The current jBase instance for method chaining.
|
|
47
|
+
* * π©πͺ: Die aktuelle jBase-Instanz fΓΌr Method-Chaining.
|
|
48
|
+
*/
|
|
49
|
+
export declare function toggleClass(this: jBase, className: string): jBase;
|
|
50
|
+
/**
|
|
51
|
+
* * π¬π§: Checks if at least one element in the collection has the specified class.
|
|
52
|
+
* * π©πͺ: PrΓΌft, ob mindestens ein Element in der Sammlung die angegebene Klasse besitzt.
|
|
53
|
+
* @param className
|
|
54
|
+
* * π¬π§: The class name to check for.
|
|
55
|
+
* * π©πͺ: Der Klassenname, nach dem gesucht werden soll.
|
|
56
|
+
* @returns
|
|
57
|
+
* * π¬π§: True if the class exists on at least one element, otherwise false.
|
|
58
|
+
* * π©πͺ: True, wenn die Klasse bei mindestens einem Element existiert, sonst False.
|
|
59
|
+
*/
|
|
60
|
+
export declare function hasClass(this: jBase, className: string): boolean;
|
|
61
|
+
//# sourceMappingURL=classes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classes.d.ts","sourceRoot":"","sources":["../../../src/modules/css/classes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,UAAU,EAAE,MAAM,EAAE,GAAG,KAAK,CAKpE;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,UAAU,EAAE,MAAM,EAAE,GAAG,KAAK,CAKvE;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,GAAG,KAAK,CAKjE;AAED;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAIhE"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file src/modules/css/classes.ts
|
|
4
|
+
* @version 2.0.0
|
|
5
|
+
* @since 2.0.0
|
|
6
|
+
* @license GPL-3.0-or-later
|
|
7
|
+
* @copyright Sven Minio 2026
|
|
8
|
+
* @author Sven Minio <https://sven-minio.de>
|
|
9
|
+
* @category CSS
|
|
10
|
+
* @description
|
|
11
|
+
* * π¬π§: Methods for manipulating CSS classes (add, remove, toggle, has).
|
|
12
|
+
* * π©πͺ: Methoden zur Manipulation von CSS-Klassen (add, remove, toggle, has).
|
|
13
|
+
* @requires ../../core
|
|
14
|
+
* * π¬π§: Depends on the core jBase class for type definitions.
|
|
15
|
+
* * π©πͺ: HΓ€ngt von der Core-jBase-Klasse fΓΌr Typ-Definitionen ab.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.addClass = addClass;
|
|
19
|
+
exports.removeClass = removeClass;
|
|
20
|
+
exports.toggleClass = toggleClass;
|
|
21
|
+
exports.hasClass = hasClass;
|
|
22
|
+
/**
|
|
23
|
+
* * π¬π§: Adds one or more CSS classes to each element in the collection.
|
|
24
|
+
* * π©πͺ: FΓΌgt jedem Element in der Sammlung eine oder mehrere CSS-Klassen hinzu.
|
|
25
|
+
* @param classNames
|
|
26
|
+
* * π¬π§: One or more class names to be added
|
|
27
|
+
* * π©πͺ: Eine oder mehrere Klassennamen, die hinzugefΓΌgt werden sollen
|
|
28
|
+
* @returns
|
|
29
|
+
* * π¬π§: The current jBase instance for method chaining
|
|
30
|
+
* * π©πͺ: Die aktuelle jBase-Instanz fΓΌr Method-Chaining
|
|
31
|
+
*/
|
|
32
|
+
function addClass(...classNames) {
|
|
33
|
+
this.forEach(el => {
|
|
34
|
+
if (el instanceof Element)
|
|
35
|
+
el.classList.add(...classNames);
|
|
36
|
+
});
|
|
37
|
+
return this;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* * π¬π§: Removes one or more CSS classes from each element in the collection.
|
|
41
|
+
* * π©πͺ: Entfernt eine oder mehrere CSS-Klassen von jedem Element in der Sammlung.
|
|
42
|
+
* @param classNames
|
|
43
|
+
* * π¬π§: One or more class names to be removed
|
|
44
|
+
* * π©πͺ: Eine oder mehrere Klassennamen, die entfernt werden sollen
|
|
45
|
+
* @returns
|
|
46
|
+
* * π¬π§: The current jBase instance for method chaining
|
|
47
|
+
* * π©πͺ: Die aktuelle jBase-Instanz fΓΌr Method-Chaining
|
|
48
|
+
*/
|
|
49
|
+
function removeClass(...classNames) {
|
|
50
|
+
this.forEach(el => {
|
|
51
|
+
if (el instanceof Element)
|
|
52
|
+
el.classList.remove(...classNames);
|
|
53
|
+
});
|
|
54
|
+
return this;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* * π¬π§: Toggles a CSS class (adds if missing, removes if present) for each element.
|
|
58
|
+
* * π©πͺ: Wechselt eine CSS-Klasse (fΓΌgt hinzu wenn fehlt, entfernt wenn vorhanden).
|
|
59
|
+
* @param className
|
|
60
|
+
* * π¬π§: The class name to toggle.
|
|
61
|
+
* * π©πͺ: Der Klassenname, der gewechselt werden soll.
|
|
62
|
+
* @returns
|
|
63
|
+
* * π¬π§: The current jBase instance for method chaining.
|
|
64
|
+
* * π©πͺ: Die aktuelle jBase-Instanz fΓΌr Method-Chaining.
|
|
65
|
+
*/
|
|
66
|
+
function toggleClass(className) {
|
|
67
|
+
this.forEach(el => {
|
|
68
|
+
if (el instanceof Element)
|
|
69
|
+
el.classList.toggle(className);
|
|
70
|
+
});
|
|
71
|
+
return this;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* * π¬π§: Checks if at least one element in the collection has the specified class.
|
|
75
|
+
* * π©πͺ: PrΓΌft, ob mindestens ein Element in der Sammlung die angegebene Klasse besitzt.
|
|
76
|
+
* @param className
|
|
77
|
+
* * π¬π§: The class name to check for.
|
|
78
|
+
* * π©πͺ: Der Klassenname, nach dem gesucht werden soll.
|
|
79
|
+
* @returns
|
|
80
|
+
* * π¬π§: True if the class exists on at least one element, otherwise false.
|
|
81
|
+
* * π©πͺ: True, wenn die Klasse bei mindestens einem Element existiert, sonst False.
|
|
82
|
+
*/
|
|
83
|
+
function hasClass(className) {
|
|
84
|
+
return this.some(el => {
|
|
85
|
+
return (el instanceof Element) && el.classList.contains(className);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=classes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classes.js","sourceRoot":"","sources":["../../../src/modules/css/classes.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAcH,4BAKC;AAYD,kCAKC;AAYD,kCAKC;AAYD,4BAIC;AAjED;;;;;;;;;GASG;AACH,SAAgB,QAAQ,CAAc,GAAG,UAAoB;IACzD,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;QACd,IAAI,EAAE,YAAY,OAAO;YAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AAChB,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,WAAW,CAAc,GAAG,UAAoB;IAC5D,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;QACd,IAAI,EAAE,YAAY,OAAO;YAAE,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AAChB,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,WAAW,CAAc,SAAiB;IACtD,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;QACd,IAAI,EAAE,YAAY,OAAO;YAAE,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AAChB,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,QAAQ,CAAc,SAAiB;IACnD,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;QAClB,OAAO,CAAC,EAAE,YAAY,OAAO,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file src/modules/css/index.ts
|
|
3
|
+
* @version 2.0.0
|
|
4
|
+
* @since 2.0.0
|
|
5
|
+
* @license GPL-3.0-or-later
|
|
6
|
+
* @copyright Sven Minio 2026
|
|
7
|
+
* @author Sven Minio <https://sven-minio.de>
|
|
8
|
+
* @category CSS
|
|
9
|
+
* @description
|
|
10
|
+
* * π¬π§: Central entry point for CSS operations. Aggregates class and style manipulation methods.
|
|
11
|
+
* * π©πͺ: Zentraler Einstiegspunkt fΓΌr CSS-Operationen. Aggregiert Methoden zur Klassen- und Style-Manipulation.
|
|
12
|
+
* @requires ./classes
|
|
13
|
+
* * π¬π§: Class manipulation methods (addClass, removeClass, etc.).
|
|
14
|
+
* * π©πͺ: Methoden zur Klassen-Manipulation (addClass, removeClass, etc.).
|
|
15
|
+
* @requires ./styles
|
|
16
|
+
* * π¬π§: Style manipulation methods (css).
|
|
17
|
+
* * π©πͺ: Methoden zur Style-Manipulation (css).
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* * π¬π§: Aggregation of all CSS methods. This object bundles functions for class manipulation and style manipulation. It is exported to extend the jBase prototype centrally via Object.assign.
|
|
21
|
+
* * π©πͺ: Aggregation aller CSS-Methoden. Dieses Objekt bΓΌndelt die Funktionen fΓΌr Klassen- und Style-Manipulation. Es wird exportiert, um via Object.assign den jBase-Prototyp zentral zu erweitern.
|
|
22
|
+
*/
|
|
23
|
+
export declare const cssMethods: {
|
|
24
|
+
css(this: import("../..").JBaseClass, property: string, value?: string | number): string | import("../..").JBaseClass;
|
|
25
|
+
addClass(this: import("../..").JBaseClass, ...classNames: string[]): import("../..").JBaseClass;
|
|
26
|
+
removeClass(this: import("../..").JBaseClass, ...classNames: string[]): import("../..").JBaseClass;
|
|
27
|
+
toggleClass(this: import("../..").JBaseClass, className: string): import("../..").JBaseClass;
|
|
28
|
+
hasClass(this: import("../..").JBaseClass, className: string): boolean;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/css/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH;;;GAGG;AACH,eAAO,MAAM,UAAU;;;;;;CAGtB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file src/modules/css/index.ts
|
|
4
|
+
* @version 2.0.0
|
|
5
|
+
* @since 2.0.0
|
|
6
|
+
* @license GPL-3.0-or-later
|
|
7
|
+
* @copyright Sven Minio 2026
|
|
8
|
+
* @author Sven Minio <https://sven-minio.de>
|
|
9
|
+
* @category CSS
|
|
10
|
+
* @description
|
|
11
|
+
* * π¬π§: Central entry point for CSS operations. Aggregates class and style manipulation methods.
|
|
12
|
+
* * π©πͺ: Zentraler Einstiegspunkt fΓΌr CSS-Operationen. Aggregiert Methoden zur Klassen- und Style-Manipulation.
|
|
13
|
+
* @requires ./classes
|
|
14
|
+
* * π¬π§: Class manipulation methods (addClass, removeClass, etc.).
|
|
15
|
+
* * π©πͺ: Methoden zur Klassen-Manipulation (addClass, removeClass, etc.).
|
|
16
|
+
* @requires ./styles
|
|
17
|
+
* * π¬π§: Style manipulation methods (css).
|
|
18
|
+
* * π©πͺ: Methoden zur Style-Manipulation (css).
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.cssMethods = void 0;
|
|
22
|
+
const tslib_1 = require("tslib");
|
|
23
|
+
const classMethods = tslib_1.__importStar(require("./classes"));
|
|
24
|
+
const styleMethods = tslib_1.__importStar(require("./styles"));
|
|
25
|
+
/**
|
|
26
|
+
* * π¬π§: Aggregation of all CSS methods. This object bundles functions for class manipulation and style manipulation. It is exported to extend the jBase prototype centrally via Object.assign.
|
|
27
|
+
* * π©πͺ: Aggregation aller CSS-Methoden. Dieses Objekt bΓΌndelt die Funktionen fΓΌr Klassen- und Style-Manipulation. Es wird exportiert, um via Object.assign den jBase-Prototyp zentral zu erweitern.
|
|
28
|
+
*/
|
|
29
|
+
exports.cssMethods = {
|
|
30
|
+
...classMethods,
|
|
31
|
+
...styleMethods
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/css/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;AAEH,gEAA0C;AAC1C,+DAAyC;AAEzC;;;GAGG;AACU,QAAA,UAAU,GAAG;IACtB,GAAG,YAAY;IACf,GAAG,YAAY;CAClB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file src/modules/css/styles.ts
|
|
3
|
+
* @version 2.0.0
|
|
4
|
+
* @since 2.0.0
|
|
5
|
+
* @license GPL-3.0-or-later
|
|
6
|
+
* @copyright Sven Minio 2026
|
|
7
|
+
* @author Sven Minio <https://sven-minio.de>
|
|
8
|
+
* @category CSS
|
|
9
|
+
* @description
|
|
10
|
+
* * π¬π§: Methods for getting and setting inline CSS styles.
|
|
11
|
+
* * π©πͺ: Methoden zum Lesen und Setzen von Inline-CSS-Styles.
|
|
12
|
+
* @requires ../../core
|
|
13
|
+
* * π¬π§: Depends on the core jBase class for type definitions.
|
|
14
|
+
* * π©πͺ: HΓ€ngt von der Core-jBase-Klasse fΓΌr Typ-Definitionen ab.
|
|
15
|
+
*/
|
|
16
|
+
import { jBase } from '../../core';
|
|
17
|
+
/**
|
|
18
|
+
* * π¬π§: Sets or gets the value of a style property for the selected elements.
|
|
19
|
+
* * π©πͺ: Setzt oder liest den Wert einer Stileigenschaft fΓΌr die ausgewΓ€hlten Elemente.
|
|
20
|
+
* @param property
|
|
21
|
+
* * π¬π§: The CSS property name (camelCase).
|
|
22
|
+
* * π©πͺ: Der Name der CSS-Eigenschaft (camelCase).
|
|
23
|
+
* @param value
|
|
24
|
+
* * π¬π§: (Optional) The value to set. If undefined, the method acts as a getter.
|
|
25
|
+
* * π©πͺ: (Optional) Der zu setzende Wert. Wenn undefined, fungiert die Methode als Getter.
|
|
26
|
+
* @returns
|
|
27
|
+
* * π¬π§: The computed style value (string) if acting as a getter, or the current jBase instance if setting.
|
|
28
|
+
* * π©πͺ: Der berechnete Stilwert (String) wenn als Getter genutzt, sonst die aktuelle jBase-Instanz.
|
|
29
|
+
*/
|
|
30
|
+
export declare function css(this: jBase, property: string, value?: string | number): string | jBase;
|
|
31
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/modules/css/styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC;;;;;;;;;;;;GAYG;AACH,wBAAgB,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAiB1F"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file src/modules/css/styles.ts
|
|
4
|
+
* @version 2.0.0
|
|
5
|
+
* @since 2.0.0
|
|
6
|
+
* @license GPL-3.0-or-later
|
|
7
|
+
* @copyright Sven Minio 2026
|
|
8
|
+
* @author Sven Minio <https://sven-minio.de>
|
|
9
|
+
* @category CSS
|
|
10
|
+
* @description
|
|
11
|
+
* * π¬π§: Methods for getting and setting inline CSS styles.
|
|
12
|
+
* * π©πͺ: Methoden zum Lesen und Setzen von Inline-CSS-Styles.
|
|
13
|
+
* @requires ../../core
|
|
14
|
+
* * π¬π§: Depends on the core jBase class for type definitions.
|
|
15
|
+
* * π©πͺ: HΓ€ngt von der Core-jBase-Klasse fΓΌr Typ-Definitionen ab.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.css = css;
|
|
19
|
+
/**
|
|
20
|
+
* * π¬π§: Sets or gets the value of a style property for the selected elements.
|
|
21
|
+
* * π©πͺ: Setzt oder liest den Wert einer Stileigenschaft fΓΌr die ausgewΓ€hlten Elemente.
|
|
22
|
+
* @param property
|
|
23
|
+
* * π¬π§: The CSS property name (camelCase).
|
|
24
|
+
* * π©πͺ: Der Name der CSS-Eigenschaft (camelCase).
|
|
25
|
+
* @param value
|
|
26
|
+
* * π¬π§: (Optional) The value to set. If undefined, the method acts as a getter.
|
|
27
|
+
* * π©πͺ: (Optional) Der zu setzende Wert. Wenn undefined, fungiert die Methode als Getter.
|
|
28
|
+
* @returns
|
|
29
|
+
* * π¬π§: The computed style value (string) if acting as a getter, or the current jBase instance if setting.
|
|
30
|
+
* * π©πͺ: Der berechnete Stilwert (String) wenn als Getter genutzt, sonst die aktuelle jBase-Instanz.
|
|
31
|
+
*/
|
|
32
|
+
function css(property, value) {
|
|
33
|
+
// GETTER
|
|
34
|
+
if (value === undefined) {
|
|
35
|
+
const el = this[0];
|
|
36
|
+
if (el instanceof HTMLElement || el instanceof SVGElement) {
|
|
37
|
+
return window.getComputedStyle(el)[property];
|
|
38
|
+
}
|
|
39
|
+
return '';
|
|
40
|
+
}
|
|
41
|
+
// SETTER
|
|
42
|
+
this.forEach(el => {
|
|
43
|
+
if (el instanceof HTMLElement || el instanceof SVGElement) {
|
|
44
|
+
el.style[property] = value;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/modules/css/styles.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAiBH,kBAiBC;AA9BD;;;;;;;;;;;;GAYG;AACH,SAAgB,GAAG,CAAc,QAAgB,EAAE,KAAuB;IACtE,SAAS;IACT,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACtB,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACnB,IAAI,EAAE,YAAY,WAAW,IAAI,EAAE,YAAY,UAAU,EAAE,CAAC;YACxD,OAAO,MAAM,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC,QAAe,CAAC,CAAC;QACxD,CAAC;QACD,OAAO,EAAE,CAAC;IACd,CAAC;IAED,SAAS;IACT,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;QACd,IAAI,EAAE,YAAY,WAAW,IAAI,EAAE,YAAY,UAAU,EAAE,CAAC;YACvD,EAAE,CAAC,KAAa,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC;QACxC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file src/modules/data/arrays.ts
|
|
3
|
+
* @version 2.0.0
|
|
4
|
+
* @since 2.0.0
|
|
5
|
+
* @license GPL-3.0-or-later
|
|
6
|
+
* @copyright Sven Minio 2026
|
|
7
|
+
* @author Sven Minio <https://sven-minio.de>
|
|
8
|
+
* @category Data
|
|
9
|
+
* @description
|
|
10
|
+
* * π¬π§: Utility functions for array manipulation and data processing.
|
|
11
|
+
* * π©πͺ: Hilfsfunktionen fΓΌr Array-Manipulation und Datenverarbeitung.
|
|
12
|
+
* @requires ./types
|
|
13
|
+
* * π¬π§: Depends on match logic and types.
|
|
14
|
+
* * π©πͺ: HΓ€ngt von Match-Logik und Typen ab.
|
|
15
|
+
*/
|
|
16
|
+
import { MatchMode } from './types';
|
|
17
|
+
/**
|
|
18
|
+
* * π¬π§: Splits an array into smaller groups (chunks). Ideal for pagination or grid layouts.
|
|
19
|
+
* * π©πͺ: Teilt ein Array in kleinere Gruppen (Chunks) auf. Ideal fΓΌr Pagination oder Grid-Layouts.
|
|
20
|
+
* @example
|
|
21
|
+
* chunk([1, 2, 3, 4, 5], 2) // => [[1, 2], [3, 4], [5]]
|
|
22
|
+
* @param array
|
|
23
|
+
* * π¬π§: The source array.
|
|
24
|
+
* * π©πͺ: Das Ursprungs-Array.
|
|
25
|
+
* @param size
|
|
26
|
+
* * π¬π§: The size of each chunk.
|
|
27
|
+
* * π©πͺ: Die GrΓΆΓe jedes Chunks.
|
|
28
|
+
* @returns
|
|
29
|
+
* * π¬π§: An array of arrays.
|
|
30
|
+
* * π©πͺ: Ein Array aus Arrays.
|
|
31
|
+
*/
|
|
32
|
+
export declare function chunk<T>(array: T[], size: number): T[][];
|
|
33
|
+
/**
|
|
34
|
+
* * π¬π§: Merges multiple arrays into a single flat array.
|
|
35
|
+
* * π©πͺ: FΓΌhrt mehrere Arrays zu einem einzigen flachen Array zusammen.
|
|
36
|
+
* @param arrays
|
|
37
|
+
* * π¬π§: A list of arrays.
|
|
38
|
+
* * π©πͺ: Eine Liste von Arrays.
|
|
39
|
+
* @returns
|
|
40
|
+
* * π¬π§: A new, merged array.
|
|
41
|
+
* * π©πͺ: Ein neues, zusammengefΓΌgtes Array.
|
|
42
|
+
*/
|
|
43
|
+
export declare function merge<T>(...arrays: T[][]): T[];
|
|
44
|
+
/**
|
|
45
|
+
* * π¬π§: Safely adds an element at a specific position without mutating the original array (Immutable).
|
|
46
|
+
* * π©πͺ: FΓΌgt ein Element sicher an einer bestimmten Position hinzu, ohne das Original-Array zu mutieren (Immutable).
|
|
47
|
+
* @param array
|
|
48
|
+
* * π¬π§: The array.
|
|
49
|
+
* * π©πͺ: Das Array.
|
|
50
|
+
* @param item
|
|
51
|
+
* * π¬π§: The item to add.
|
|
52
|
+
* * π©πͺ: Das hinzuzufΓΌgende Element.
|
|
53
|
+
* @param index
|
|
54
|
+
* * π¬π§: The position (default: end). Negative values count from the back (-1 = before the last one).
|
|
55
|
+
* * π©πͺ: Die Position (Standard: Ende). Negative Werte zΓ€hlen von hinten (-1 = vor dem letzten).
|
|
56
|
+
* @returns
|
|
57
|
+
* * π¬π§: A new array including the element.
|
|
58
|
+
* * π©πͺ: Ein neues Array inklusive dem Element.
|
|
59
|
+
*/
|
|
60
|
+
export declare function add<T>(array: T[], item: T, index?: number): T[];
|
|
61
|
+
/**
|
|
62
|
+
* * π¬π§: Removes elements based on index or match logic.
|
|
63
|
+
* * π©πͺ: Entfernt Elemente basierend auf Index oder Match-Logik.
|
|
64
|
+
*/
|
|
65
|
+
export declare const remove: {
|
|
66
|
+
/**
|
|
67
|
+
* * π¬π§: Removes an element at a specific index.
|
|
68
|
+
* * π©πͺ: Entfernt ein Element an einem spezifischen Index.
|
|
69
|
+
* @param array
|
|
70
|
+
* * π¬π§: The array.
|
|
71
|
+
* * π©πͺ: Das Array.
|
|
72
|
+
* @param index
|
|
73
|
+
* * π¬π§: The index (negative values allowed).
|
|
74
|
+
* * π©πͺ: Der Index (negativ mΓΆglich).
|
|
75
|
+
*/
|
|
76
|
+
at<T>(array: T[], index: number): T[];
|
|
77
|
+
/**
|
|
78
|
+
* * π¬π§: Removes the first element.
|
|
79
|
+
* * π©πͺ: Entfernt das erste Element.
|
|
80
|
+
*/
|
|
81
|
+
first<T>(array: T[]): T[];
|
|
82
|
+
/**
|
|
83
|
+
* * π¬π§: Removes the last element.
|
|
84
|
+
* * π©πͺ: Entfernt das letzte Element.
|
|
85
|
+
*/
|
|
86
|
+
last<T>(array: T[]): T[];
|
|
87
|
+
/**
|
|
88
|
+
* * π¬π§: Removes all elements matching a query condition.
|
|
89
|
+
* * π©πͺ: Entfernt alle Elemente, die einer Suchbedingung entsprechen.
|
|
90
|
+
* @example
|
|
91
|
+
* remove.byMatch(users, 'Admin', 'exact', 'role')
|
|
92
|
+
* @param array
|
|
93
|
+
* * π¬π§: The array.
|
|
94
|
+
* * π©πͺ: Das Array.
|
|
95
|
+
* @param query
|
|
96
|
+
* * π¬π§: The search query.
|
|
97
|
+
* * π©πͺ: Der Suchbegriff.
|
|
98
|
+
* @param mode
|
|
99
|
+
* * π¬π§: The comparison mode ('exact', 'contains', 'startsWith', 'endsWith').
|
|
100
|
+
* * π©πͺ: Der Vergleichsmodus ('exact', 'contains', 'startsWith', 'endsWith').
|
|
101
|
+
* @param key
|
|
102
|
+
* * π¬π§: (Optional) The object key if it is an array of objects.
|
|
103
|
+
* * π©πͺ: (Optional) Der ObjektschlΓΌssel, falls es ein Array von Objekten ist.
|
|
104
|
+
*/
|
|
105
|
+
byMatch<T>(array: T[], query: string | number, mode?: MatchMode, key?: keyof T): T[];
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* * π¬π§: Searches for elements in the array.
|
|
109
|
+
* * π©πͺ: Sucht Elemente im Array.
|
|
110
|
+
*/
|
|
111
|
+
export declare const find: {
|
|
112
|
+
/**
|
|
113
|
+
* * π¬π§: Finds the index of the first match.
|
|
114
|
+
* * π©πͺ: Findet den Index des ersten Treffers.
|
|
115
|
+
* @returns
|
|
116
|
+
* * π¬π§: Index or -1.
|
|
117
|
+
* * π©πͺ: Index oder -1.
|
|
118
|
+
*/
|
|
119
|
+
index<T>(array: T[], query: string | number, mode?: MatchMode, key?: keyof T): number;
|
|
120
|
+
/**
|
|
121
|
+
* * π¬π§: Returns all elements matching the condition (Filter).
|
|
122
|
+
* * π©πͺ: Gibt alle Elemente zurΓΌck, die der Bedingung entsprechen (Filter).
|
|
123
|
+
*/
|
|
124
|
+
all<T>(array: T[], query: string | number, mode?: MatchMode, key?: keyof T): T[];
|
|
125
|
+
/**
|
|
126
|
+
* * π¬π§: Returns the first matching element (or undefined).
|
|
127
|
+
* * π©πͺ: Gibt das erste gefundene Element zurΓΌck (oder undefined).
|
|
128
|
+
*/
|
|
129
|
+
first<T>(array: T[], query: string | number, mode?: MatchMode, key?: keyof T): T | undefined;
|
|
130
|
+
};
|
|
131
|
+
//# sourceMappingURL=arrays.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrays.d.ts","sourceRoot":"","sources":["../../../src/modules/data/arrays.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAc,MAAM,SAAS,CAAC;AAEhD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,EAAE,EAAE,CAMxD;AAED;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,CAE9C;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,GAAE,MAAqB,GAAG,CAAC,EAAE,CAK7E;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM;IACf;;;;;;;;;OASG;OACA,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,GAAG,CAAC,EAAE;IASrC;;;OAGG;UACG,CAAC,SAAS,CAAC,EAAE,GAAG,CAAC,EAAE;IAEzB;;;OAGG;SACE,CAAC,SAAS,CAAC,EAAE,GAAG,CAAC,EAAE;IAExB;;;;;;;;;;;;;;;;;OAiBG;YACK,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,GAAG,MAAM,SAAQ,SAAS,QAAkB,MAAM,CAAC,GAAG,CAAC,EAAE;CAMhG,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,IAAI;IACb;;;;;;OAMG;UACG,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,GAAG,MAAM,SAAQ,SAAS,QAAkB,MAAM,CAAC,GAAG,MAAM;IAO9F;;;OAGG;QACC,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,GAAG,MAAM,SAAQ,SAAS,QAAkB,MAAM,CAAC,GAAG,CAAC,EAAE;IAOzF;;;OAGG;UACG,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,GAAG,MAAM,SAAQ,SAAS,QAAkB,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS;CAMxG,CAAC"}
|