@vanelsas/baredom 2.6.0 → 2.8.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/CHANGELOG.md +34 -0
- package/README.md +12 -41
- package/custom-elements.json +344 -5
- package/dist/baredom.d.ts +4 -0
- package/dist/base.js +451 -421
- package/dist/integrity.json +97 -93
- package/dist/x-alert.js +17 -19
- package/dist/x-avatar-group.js +9 -11
- package/dist/x-avatar.js +15 -15
- package/dist/x-badge.js +9 -11
- package/dist/x-bento-grid.js +5 -5
- package/dist/x-bento-item.js +4 -4
- package/dist/x-breadcrumbs.js +13 -14
- package/dist/x-button.js +16 -16
- package/dist/x-cancel-dialogue.js +13 -17
- package/dist/x-card.js +7 -7
- package/dist/x-carousel.js +33 -34
- package/dist/x-chart.d.ts +26 -0
- package/dist/x-chart.js +47 -48
- package/dist/x-checkbox.js +11 -11
- package/dist/x-chip.js +1 -9
- package/dist/x-collapse.js +10 -12
- package/dist/x-color-picker.js +44 -45
- package/dist/x-combobox.js +26 -27
- package/dist/x-command-palette.js +26 -27
- package/dist/x-container.js +5 -6
- package/dist/x-context-menu.d.ts +31 -2
- package/dist/x-context-menu.js +20 -18
- package/dist/x-copy.js +20 -23
- package/dist/x-currency-field.js +23 -25
- package/dist/x-date-picker.d.ts +27 -0
- package/dist/x-date-picker.js +42 -42
- package/dist/x-divider.js +9 -10
- package/dist/x-drawer.js +10 -12
- package/dist/x-dropdown.js +11 -11
- package/dist/x-fieldset.js +5 -6
- package/dist/x-file-download.js +7 -8
- package/dist/x-file-upload.js +22 -25
- package/dist/x-form-field.js +15 -17
- package/dist/x-form.js +9 -10
- package/dist/x-gaussian-blur.js +13 -19
- package/dist/x-grid.js +6 -6
- package/dist/x-i18n-provider.d.ts +43 -0
- package/dist/x-i18n-provider.js +8 -0
- package/dist/x-i18n.d.ts +14 -0
- package/dist/x-i18n.js +5 -0
- package/dist/x-icon.js +6 -7
- package/dist/x-image.js +18 -19
- package/dist/x-kinetic-canvas.d.ts +18 -0
- package/dist/x-kinetic-canvas.js +26 -0
- package/dist/x-kinetic-font.js +27 -29
- package/dist/x-kinetic-typography.js +33 -39
- package/dist/x-liquid-dock.js +39 -39
- package/dist/x-liquid-fill.js +45 -45
- package/dist/x-liquid-glass.js +47 -47
- package/dist/x-menu-item.js +8 -10
- package/dist/x-menu.js +10 -11
- package/dist/x-metaball-cursor.js +27 -27
- package/dist/x-modal.js +11 -13
- package/dist/x-morph-stack.js +37 -39
- package/dist/x-multi-combobox.d.ts +50 -0
- package/dist/x-multi-combobox.js +37 -0
- package/dist/x-navbar.js +12 -13
- package/dist/x-neural-glow.js +33 -34
- package/dist/x-notification-center.js +9 -10
- package/dist/x-organic-divider.js +17 -19
- package/dist/x-organic-progress.js +38 -39
- package/dist/x-organic-shape.js +13 -14
- package/dist/x-pagination.js +15 -17
- package/dist/x-particle-button.js +51 -52
- package/dist/x-popover.js +26 -25
- package/dist/x-progress-circle.js +9 -11
- package/dist/x-progress.js +10 -11
- package/dist/x-radio.js +11 -12
- package/dist/x-ripple-effect.js +11 -12
- package/dist/x-scroll-parallax.js +18 -19
- package/dist/x-scroll-stack.js +17 -18
- package/dist/x-scroll-story.js +34 -36
- package/dist/x-scroll-timeline.js +45 -47
- package/dist/x-scroll.js +40 -42
- package/dist/x-search-field.js +15 -17
- package/dist/x-select.js +11 -11
- package/dist/x-sidebar.js +17 -17
- package/dist/x-skeleton-group.js +12 -14
- package/dist/x-skeleton.js +1 -1
- package/dist/x-slider.js +15 -18
- package/dist/x-soft-body.js +22 -22
- package/dist/x-spacer.js +4 -5
- package/dist/x-spinner.js +4 -6
- package/dist/x-splash.js +12 -13
- package/dist/x-stat.js +10 -12
- package/dist/x-stepper.js +14 -15
- package/dist/x-switch.js +10 -11
- package/dist/x-tab.js +7 -8
- package/dist/x-table-cell.js +20 -24
- package/dist/x-table-row.js +8 -10
- package/dist/x-table.js +12 -16
- package/dist/x-tabs.js +11 -11
- package/dist/x-text-area.js +19 -21
- package/dist/x-theme.d.ts +1 -1
- package/dist/x-theme.js +25 -25
- package/dist/x-timeline-item.js +21 -23
- package/dist/x-timeline.js +8 -9
- package/dist/x-toast.js +22 -24
- package/dist/x-toaster.js +8 -8
- package/dist/x-tooltip.js +12 -13
- package/dist/x-typography.js +9 -11
- package/dist/x-welcome-tour.js +60 -65
- package/package.json +201 -181
package/dist/x-carousel.js
CHANGED
|
@@ -1,35 +1,34 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
$APP.
|
|
5
|
-
$APP.
|
|
6
|
-
"__xCarouselPaused")))?(c=$APP.
|
|
7
|
-
q=$APP.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"flex";
|
|
11
|
-
""+$APP.
|
|
12
|
-
return null},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
switch(
|
|
16
|
-
$APP.
|
|
17
|
-
!0;a.__xCarouselDragStart=
|
|
18
|
-
h);
|
|
19
|
-
"dots");c=$APP.k(c,"viewport");d.removeEventListener("pointerdown",$APP.k(b,"down"));d.removeEventListener("pointermove",$APP.k(b,"move"));d.removeEventListener("pointerup",$APP.k(b,"up"));c.removeEventListener("keydown",$APP.k(b,"key"));l.removeEventListener("click",$APP.k(b,"dot"));
|
|
20
|
-
$APP.k(b,"leave"));a.removeEventListener("focusin",$APP.k(b,"focusin"));a.removeEventListener("focusout",$APP.k(b,"focusout"))}a.__xCarouselHandlers=null},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
set:function(m){return
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
$APP.
|
|
34
|
-
|
|
35
|
-
var Ew=new $APP.S(null,new $APP.Q(null,2,["slide",null,"fade",null],null),null),Gw=new $APP.S(null,new $APP.Q(null,2,["vertical",null,"horizontal",null],null),null),Iw=/^\d+(\.\d+)?(px|rem|em|%)$/,ax=new $APP.S(null,new $APP.Q(null,1,["ArrowLeft",null],null),null),cx=new $APP.S(null,new $APP.Q(null,1,["ArrowRight",null],null),null),$w=new $APP.S(null,new $APP.Q(null,1,["ArrowUp",null],null),null),bx=new $APP.S(null,new $APP.Q(null,1,["ArrowDown",null],null),null);$APP.ha("baredom.exports.x_carousel.init",jx);export const init=jx;
|
|
2
|
+
var kz=function(a){return a==null?!0:$APP.M((""+$APP.Q.g(a)).trim().toLowerCase(),"false")},lz=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),$APP.p(isNaN(a))&&a>=0?a:0):0},mz=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),$APP.p(isNaN(a))&&a>=100?a:5E3):5E3},oz=function(a){return typeof a==="string"?(a=a.trim().toLowerCase(),$APP.Zc(nz,a)?a:"slide"):"slide"},qz=function(a){return typeof a==="string"?(a=a.trim().toLowerCase(),$APP.Zc(pz,a)?a:"horizontal"):"horizontal"},
|
|
3
|
+
sz=function(a){var b=(b=typeof a==="string")?rz.test(a.trim()):b;return $APP.n(b)?a.trim():"0px"},tz=function(a,b){return b<=0?0:a<0?0:a>=b?b-1:a},vz=function(a){var b=$APP.J(a);a=$APP.C(b,$APP.pj);var c=$APP.C(b,$APP.Im);b=$APP.C(b,uz);var d=a+1;return d>=b?$APP.n(c)?0:a:d},wz=function(a){var b=$APP.J(a);a=$APP.C(b,$APP.pj);var c=$APP.C(b,$APP.Im);b=$APP.C(b,uz);var d=a-1;return d<0?$APP.n(c)?b-1:a:d},Ez=function(a){var b=$APP.k(a,"__xCarouselSlideCount");a=$APP.Lf([$APP.Fh,uz,xz,yz,$APP.xn,zz,$APP.rj,
|
|
4
|
+
$APP.fl,Az,$APP.jo,$APP.gk,Bz],[a.hasAttribute("disabled"),$APP.n(b)?b:0,a.getAttribute("transition"),a.getAttribute("arrows"),a.getAttribute("peek"),a.hasAttribute("loop"),a.getAttribute("interval"),a.getAttribute("aria-label"),a.hasAttribute("autoplay"),a.getAttribute("current"),a.getAttribute("direction"),a.getAttribute("dots")]);var c=$APP.J(a);a=$APP.C(c,$APP.fl);b=$APP.C(c,Az);var d=$APP.C(c,$APP.rj),e=$APP.C(c,$APP.jo),f=$APP.C(c,$APP.gk),h=$APP.C(c,Bz),l=$APP.C(c,$APP.Fh),m=$APP.C(c,uz),q=
|
|
5
|
+
$APP.C(c,xz),r=$APP.C(c,yz),v=$APP.C(c,$APP.xn);c=$APP.C(c,zz);m=$APP.n(m)?m:0;e=tz(lz(e),m);return $APP.Lf([Cz,Dz,$APP.fm,uz,$APP.pj,$APP.Im,$APP.gm,$APP.gn,$APP.jk,$APP.Y,$APP.Gk,$APP.Vj],[kz(r),oz(q),kz(h),m,e,$APP.E(c),mz(d),$APP.th(a)?a:null,sz(v),$APP.E(l),qz(f),$APP.E(b)])},Fz=function(a){var b=$APP.k(a,"__xCarouselAutoTimer");$APP.n(b)&&(clearInterval(b),a.__xCarouselAutoTimer=null)},Hz=function(a){Fz(a);var b=Ez(a);$APP.n(function(){var c=$APP.Vj.g(b);return $APP.n(c)?(c=$APP.p($APP.k(a,
|
|
6
|
+
"__xCarouselPaused")))?(c=$APP.p($APP.Y.g(b)))?(c=uz.g(b)>1)?a.isConnected:c:c:c:c}())&&$APP.Zg(a,"__xCarouselAutoTimer",setInterval(function(){if($APP.n(a.isConnected)){var c=Ez(a);c=vz(c);return Gz.l?Gz.l(a,c,"autoplay"):Gz.call(null,a,c,"autoplay")}return null},$APP.gm.g(b)))},Iz=function(a){if($APP.$g(a,"__xCarouselInit")){var b=Ez(a);if($APP.M(b,$APP.k(a,"__xCarouselModel"))){a.__xCarouselModel=b;var c=$APP.k(a,"__xCarouselRefs"),d=$APP.k(c,"track"),e=$APP.k(c,"prev"),f=$APP.k(c,"next"),h=$APP.k(c,
|
|
7
|
+
"dots");c=$APP.k(c,"live");var l=$APP.pj.g(b),m=uz.g(b),q=Dz.g(b),r=$APP.Gk.g(b),v=$APP.jk.g(b),x=$APP.B.i(r,"vertical");a.setAttribute("data-direction",r);a.setAttribute("data-transition",q);a.setAttribute("role","region");a.setAttribute("aria-roledescription","carousel");var y=$APP.gn.g(b);$APP.n(y)?a.setAttribute("aria-label",y):$APP.n(a.hasAttribute("aria-label"))||a.setAttribute("aria-label","Carousel");h.setAttribute("aria-orientation",r);a.style.setProperty("--_peek",v);if($APP.B.i(q,"slide"))for(q=
|
|
8
|
+
x?"Y":"X",$APP.B.i(v,"0px")?d.style.transform="translate"+$APP.Q.g(q)+"("+$APP.Q.g(l*-100)+"%)":d.style.transform="translate"+$APP.Q.g(q)+"(calc("+$APP.Q.g(l*-1)+" * (100% - "+$APP.Q.g(v)+" * 2) + "+$APP.Q.g(v)+"))",d=$APP.k($APP.k(a,"__xCarouselRefs"),"slot").assignedElements(),v=d.length,q=0;;)if(q<v)d[q].style.opacity="",q+=1;else break;else for(d.style.transform="",d=$APP.k($APP.k(a,"__xCarouselRefs"),"slot").assignedElements(),v=d.length,q=0;;)if(q<v)d[q].style.opacity=$APP.B.i(q,l)?"1":"0",
|
|
9
|
+
q+=1;else break;v=$APP.J(b);d=$APP.C(v,Cz);v=$APP.C(v,uz);$APP.n($APP.n(d)?v>1:d)?(e.style.display="flex",f.style.display="flex",r=$APP.J(b),d=$APP.C(r,$APP.pj),v=$APP.C(r,$APP.Im),q=$APP.C(r,uz),r=$APP.C(r,$APP.Y),d=(r=$APP.p(r))?(q=q>1)?$APP.n(v)?v:d>0:q:r,e.disabled=$APP.p(d),q=$APP.J(b),e=$APP.C(q,$APP.pj),d=$APP.C(q,$APP.Im),v=$APP.C(q,uz),q=$APP.C(q,$APP.Y),e=(q=$APP.p(q))?(q=v>1)?$APP.n(d)?d:e<v-1:q:q,f.disabled=$APP.p(e)):(e.style.display="none",f.style.display="none");e=$APP.J(b);f=$APP.C(e,
|
|
10
|
+
$APP.fm);e=$APP.C(e,uz);if($APP.n($APP.n(f)?e>1:f)){h.style.display="flex";f=$APP.k(a,"__xCarouselDotCount");if($APP.M($APP.n(f)?f:-1,m)){h.innerHTML="";for(f=0;;)if(f<m)e=document.createElement("button"),e.setAttribute("part","dot"),e.setAttribute("type","button"),e.setAttribute("role","tab"),e.setAttribute("aria-label","Go to slide "+$APP.Q.g(f+1)),e.setAttribute("data-index",""+$APP.Q.g(f)),h.appendChild(e),f+=1;else break;a.__xCarouselDotCount=m}a=h.children;h=a.length;for(f=0;;)if(f<h)e=a[f],
|
|
11
|
+
e.setAttribute("aria-current",""+$APP.Q.g($APP.B.i(f,l))),e.setAttribute("aria-selected",""+$APP.Q.g($APP.B.i(f,l))),f+=1;else break}else h.style.display="none";m>0&&(c.textContent="Slide "+$APP.Q.g(l+1)+" of "+$APP.Q.g(m));$APP.n($APP.Vj.g(b))?c.setAttribute("aria-live","off"):c.setAttribute("aria-live","polite")}}},Gz=function(a,b,c){var d=Ez(a),e=uz.g(d);b=tz(b,e);d=$APP.pj.g(d);$APP.M(b,d)&&e>0&&$APP.ch(a,"x-carousel-change",{index:b,previousIndex:d,reason:c})&&a.setAttribute("current",""+$APP.Q.g(b));
|
|
12
|
+
return null},Oz=function(a){function b(K){$APP.n(a.contains(K.relatedTarget))||(a.__xCarouselPaused=!1,Hz(a));return null}function c(){a.__xCarouselPaused=!0;Fz(a);return null}function d(){a.__xCarouselPaused=!1;Hz(a);return null}function e(){a.__xCarouselPaused=!0;Fz(a);return null}function f(){var K=$APP.k($APP.k(a,"__xCarouselRefs"),"slot").assignedElements().length;a.__xCarouselSlideCount=K;var W=Ez(a);K=tz($APP.pj.g(W),K);$APP.M(K,$APP.pj.g(W))&&a.setAttribute("current",""+$APP.Q.g(K));Iz(a);
|
|
13
|
+
Hz(a);return null}function h(){var K=Ez(a);Gz(a,vz(K),"arrow");return null}function l(){var K=Ez(a);Gz(a,wz(K),"arrow");return null}function m(K){K=K.target.getAttribute("data-index");$APP.n(K)&&(K=parseInt(K,10),$APP.n(isNaN(K))||Gz(a,K,"dot"));return null}function q(K){var W=Ez(a),ea=K.key,va=$APP.Gk.g(W);$APP.p($APP.Y.g(W))&&uz.g(W)>1&&($APP.Zc($APP.B.i(va,"vertical")?Jz:Kz,ea)?(K.preventDefault(),Gz(a,wz(W),"keyboard")):$APP.Zc($APP.B.i(va,"vertical")?Lz:Mz,ea)?(K.preventDefault(),Gz(a,vz(W),
|
|
14
|
+
"keyboard")):$APP.B.i(ea,"Home")?(K.preventDefault(),Gz(a,0,"keyboard")):$APP.B.i(ea,"End")&&(K.preventDefault(),Gz(a,uz.g(W)-1,"keyboard")));return null}function r(){if($APP.n($APP.k(a,"__xCarouselDragging"))){a.__xCarouselDragging=!1;var K=$APP.k($APP.k(a,"__xCarouselRefs"),"track"),W=$APP.k(a,"__xCarouselDragCurrent")-$APP.k(a,"__xCarouselDragStart"),ea=Date.now()-$APP.k(a,"__xCarouselDragStartT");ea=ea>0?W/ea:0;W=ea>.3?$APP.Zk:ea<-.3?$APP.el:W>40?$APP.Zk:W<-40?$APP.el:Nz;ea=Ez(a);K.classList.remove("dragging");
|
|
15
|
+
switch(W instanceof $APP.F?W.qa:null){case "prev":Gz(a,wz(ea),"drag");break;case "next":Gz(a,vz(ea),"drag");break;default:Iz(a)}a.__xCarouselPaused=!1;Hz(a)}return null}function v(K){if($APP.n($APP.k(a,"__xCarouselDragging"))){var W=Ez(a),ea=$APP.B.i($APP.Gk.g(W),"vertical");K=ea?K.clientY:K.clientX;var va=K-$APP.k(a,"__xCarouselDragStart"),Pa=$APP.k($APP.k(a,"__xCarouselRefs"),"track"),eb=$APP.pj.g(W);ea=ea?"Y":"X";W=$APP.jk.g(W);a.__xCarouselDragCurrent=K;$APP.B.i(W,"0px")?Pa.style.transform="translate"+
|
|
16
|
+
$APP.Q.g(ea)+"(calc("+$APP.Q.g(eb*-100)+"% + "+$APP.Q.g(va)+"px))":Pa.style.transform="translate"+$APP.Q.g(ea)+"(calc("+$APP.Q.g(eb*-1)+" * (100% - "+$APP.Q.g(W)+" * 2) + "+$APP.Q.g(W)+" + "+$APP.Q.g(va)+"px))"}return null}function x(K){var W=Ez(a);if($APP.p($APP.Y.g(W))&&$APP.B.i(Dz.g(W),"slide")&&uz.g(W)>1){K.preventDefault();var ea=$APP.k($APP.k(a,"__xCarouselRefs"),"track");W=$APP.B.i($APP.Gk.g(W),"vertical")?K.clientY:K.clientX;ea.setPointerCapture(K.pointerId);ea.classList.add("dragging");a.__xCarouselDragging=
|
|
17
|
+
!0;a.__xCarouselDragStart=W;K=Date.now();a.__xCarouselDragStartT=K;a.__xCarouselDragCurrent=W;a.__xCarouselPaused=!0;Fz(a)}return null}var y=$APP.k(a,"__xCarouselRefs"),A=$APP.k(y,"track"),D=$APP.k(y,"slot"),G=$APP.k(y,"prev"),I=$APP.k(y,"next"),H=$APP.k(y,"dots");y=$APP.k(y,"viewport");A.addEventListener("pointerdown",x);A.addEventListener("pointermove",v);A.addEventListener("pointerup",r);y.addEventListener("keydown",q);H.addEventListener("click",m);G.addEventListener("click",l);I.addEventListener("click",
|
|
18
|
+
h);D.addEventListener("slotchange",f);a.addEventListener("pointerenter",e);a.addEventListener("pointerleave",d);a.addEventListener("focusin",c);a.addEventListener("focusout",b);$APP.Zg(a,"__xCarouselHandlers",{next:h,up:r,slot:f,dot:m,key:q,prev:l,focusin:c,leave:d,move:v,down:x,enter:e,focusout:b})},Pz=function(a){Fz(a);var b=$APP.k(a,"__xCarouselHandlers"),c=$APP.k(a,"__xCarouselRefs");if($APP.n($APP.n(b)?c:b)){var d=$APP.k(c,"track"),e=$APP.k(c,"slot"),f=$APP.k(c,"prev"),h=$APP.k(c,"next"),l=$APP.k(c,
|
|
19
|
+
"dots");c=$APP.k(c,"viewport");d.removeEventListener("pointerdown",$APP.k(b,"down"));d.removeEventListener("pointermove",$APP.k(b,"move"));d.removeEventListener("pointerup",$APP.k(b,"up"));c.removeEventListener("keydown",$APP.k(b,"key"));l.removeEventListener("click",$APP.k(b,"dot"));f.removeEventListener("click",$APP.k(b,"prev"));h.removeEventListener("click",$APP.k(b,"next"));e.removeEventListener("slotchange",$APP.k(b,"slot"));a.removeEventListener("pointerenter",$APP.k(b,"enter"));a.removeEventListener("pointerleave",
|
|
20
|
+
$APP.k(b,"leave"));a.removeEventListener("focusin",$APP.k(b,"focusin"));a.removeEventListener("focusout",$APP.k(b,"focusout"))}a.__xCarouselHandlers=null},Qz=function(a){for(var b=$APP.t(new $APP.De(null,3,5,$APP.Ee,["autoplay","loop","disabled"],null)),c=null,d=0,e=0;;)if(e<d){var f=c.F(null,e);$APP.dh(a,f,f);e+=1}else if(b=$APP.t(b))c=b,$APP.Vc(c)?(b=$APP.Db(c),e=$APP.Eb(c),c=b,d=$APP.z(b),b=e):(b=$APP.u(c),$APP.dh(a,b,b),b=$APP.w(c),c=null,d=0),e=0;else break;b=$APP.t(new $APP.De(null,2,5,$APP.Ee,
|
|
21
|
+
["arrows","dots"],null));c=null;for(e=d=0;;)if(e<d)f=c.F(null,e),Object.defineProperty(a,f,{get:function(m,q,r,v,x){return function(){return kz(this.getAttribute(x))}}(b,c,d,e,f),set:function(m,q,r,v,x){return function(y){return $APP.n(y)?this.removeAttribute(x):this.setAttribute(x,"false")}}(b,c,d,e,f),enumerable:!0,configurable:!0}),e+=1;else{var h=$APP.t(b);if(h){f=h;if($APP.Vc(f))b=$APP.Db(f),e=$APP.Eb(f),c=b,d=$APP.z(b),b=e;else{var l=$APP.u(f);Object.defineProperty(a,l,{get:function(m,q,r,v,
|
|
22
|
+
x){return function(){return kz(this.getAttribute(x))}}(b,c,d,e,l,f,h),set:function(m,q,r,v,x){return function(y){return $APP.n(y)?this.removeAttribute(x):this.setAttribute(x,"false")}}(b,c,d,e,l,f,h),enumerable:!0,configurable:!0});b=$APP.w(f);c=null;d=0}e=0}else break}Object.defineProperty(a,"currentSlide",{get:function(){return lz(this.getAttribute("current"))},set:function(m){return this.setAttribute("current",""+$APP.Q.g(m|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"interval",
|
|
23
|
+
{get:function(){return mz(this.getAttribute("interval"))},set:function(m){return m==null?this.removeAttribute("interval"):this.setAttribute("interval",""+$APP.Q.g(m|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"transition",{get:function(){return oz(this.getAttribute("transition"))},set:function(m){return $APP.n(m)?this.setAttribute("transition",""+$APP.Q.g(m)):this.removeAttribute("transition")},enumerable:!0,configurable:!0});Object.defineProperty(a,"direction",{get:function(){return qz(this.getAttribute("direction"))},
|
|
24
|
+
set:function(m){return $APP.n(m)?this.setAttribute("direction",""+$APP.Q.g(m)):this.removeAttribute("direction")},enumerable:!0,configurable:!0});Object.defineProperty(a,"peek",{get:function(){return sz(this.getAttribute("peek"))},set:function(m){return $APP.n(m)?this.setAttribute("peek",""+$APP.Q.g(m)):this.removeAttribute("peek")},enumerable:!0,configurable:!0});Object.defineProperty(a,"slideCount",{get:function(){var m=$APP.k(this,"__xCarouselSlideCount");return $APP.n(m)?m:0},enumerable:!0,configurable:!0});
|
|
25
|
+
$APP.fa(a,"next",function(){var m=Ez(this);return Gz(this,vz(m),"api")});$APP.fa(a,"previous",function(){var m=Ez(this);return Gz(this,wz(m),"api")});return $APP.fa(a,"goTo",function(m){return Gz(this,m,"api")})},Rz=function(a){if(!$APP.$g(a,"__xCarouselInit")){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("div"),f=document.createElement("slot"),h=document.createElement("button"),l=document.createElement("button"),m=
|
|
26
|
+
document.createElement("div"),q=document.createElement("div");c.textContent=":host{display:block;color-scheme:light dark;position:relative;--x-carousel-height:300px;--x-carousel-arrow-size:40px;--x-carousel-arrow-bg:var(--x-color-surface,rgba(255,255,255,0.9));--x-carousel-arrow-color:var(--x-color-text,#1e293b);--x-carousel-arrow-hover-bg:var(--x-color-surface-hover,rgba(255,255,255,1));--x-carousel-dot-size:10px;--x-carousel-dot-color:var(--x-color-border,#cbd5e1);--x-carousel-dot-active-color:var(--x-color-primary,#3b82f6);--x-carousel-transition-duration:var(--x-transition-duration,300ms);--x-carousel-radius:var(--x-radius-md,8px);--x-carousel-gap:16px;--x-carousel-focus-ring:var(--x-color-focus-ring,#60a5fa);--x-carousel-disabled-opacity:0.5;}@media(prefers-color-scheme:dark){:host{--x-carousel-arrow-bg:var(--x-color-surface,rgba(30,41,59,0.9));--x-carousel-arrow-color:var(--x-color-text,#f1f5f9);--x-carousel-arrow-hover-bg:var(--x-color-surface-hover,rgba(30,41,59,1));--x-carousel-dot-color:var(--x-color-border,#475569);--x-carousel-dot-active-color:var(--x-color-primary,#60a5fa);--x-carousel-focus-ring:var(--x-color-focus-ring,#93c5fd);}}[part\x3dviewport]{position:relative;overflow:hidden;height:var(--x-carousel-height);border-radius:var(--x-carousel-radius);}[part\x3dviewport]:focus{outline:none;}[part\x3dviewport]:focus-visible{outline:2px solid var(--x-carousel-focus-ring);outline-offset:2px;}[part\x3dtrack]{display:flex;flex-direction:row;height:100%;transition:transform var(--x-carousel-transition-duration) ease;will-change:transform;touch-action:pan-y pinch-zoom;}[part\x3dtrack].dragging{transition:none !important;cursor:grabbing;}:host([data-direction\x3dvertical]) [part\x3dtrack]{flex-direction:column;touch-action:pan-x pinch-zoom;}::slotted(*){min-width:calc(100% - var(--_peek,0px) * 2);max-width:calc(100% - var(--_peek,0px) * 2);flex-shrink:0;box-sizing:border-box;overflow:hidden;}:host([data-direction\x3dvertical]) ::slotted(*){min-width:auto;max-width:none;min-height:calc(100% - var(--_peek,0px) * 2);max-height:calc(100% - var(--_peek,0px) * 2);}:host([data-transition\x3dfade]) [part\x3dtrack]{display:grid;grid-template-columns:1fr;grid-template-rows:1fr;transition:none;}:host([data-transition\x3dfade]) ::slotted(*){grid-area:1/1;min-width:100%;max-width:100%;transition:opacity var(--x-carousel-transition-duration) ease;}[part\x3dprev-btn],[part\x3dnext-btn]{position:absolute;top:50%;transform:translateY(-50%);width:var(--x-carousel-arrow-size);height:var(--x-carousel-arrow-size);border-radius:50%;border:none;background:var(--x-carousel-arrow-bg);color:var(--x-carousel-arrow-color);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;z-index:1;box-shadow:var(--x-shadow-sm,0 1px 3px rgba(0,0,0,0.1));transition:background 150ms ease,opacity 150ms ease,transform 150ms ease;opacity:0.85;}[part\x3dprev-btn]:hover,[part\x3dnext-btn]:hover{background:var(--x-carousel-arrow-hover-bg);opacity:1;}[part\x3dprev-btn]:active,[part\x3dnext-btn]:active{transform:translateY(-50%) scale(0.95);}[part\x3dprev-btn]:focus,[part\x3dnext-btn]:focus{outline:none;}[part\x3dprev-btn]:focus-visible,[part\x3dnext-btn]:focus-visible{outline:2px solid var(--x-carousel-focus-ring);outline-offset:2px;}[part\x3dprev-btn]:disabled,[part\x3dnext-btn]:disabled{opacity:0.3;cursor:default;pointer-events:none;}[part\x3dprev-btn]{left:8px;}[part\x3dnext-btn]{right:8px;}[part\x3dprev-btn] svg,[part\x3dnext-btn] svg{width:60%;height:60%;pointer-events:none;}:host([data-direction\x3dvertical]) [part\x3dprev-btn],:host([data-direction\x3dvertical]) [part\x3dnext-btn]{top:auto;left:50%;right:auto;transform:translateX(-50%) rotate(90deg);}:host([data-direction\x3dvertical]) [part\x3dprev-btn]{top:8px;bottom:auto;}:host([data-direction\x3dvertical]) [part\x3dnext-btn]{bottom:8px;top:auto;}:host([data-direction\x3dvertical]) [part\x3dprev-btn]:active{transform:translateX(-50%) rotate(90deg) scale(0.95);}:host([data-direction\x3dvertical]) [part\x3dnext-btn]:active{transform:translateX(-50%) rotate(90deg) scale(0.95);}[part\x3ddots]{display:flex;justify-content:center;align-items:center;gap:8px;padding:12px 0;}[part\x3ddot]{all:unset;width:var(--x-carousel-dot-size);height:var(--x-carousel-dot-size);border-radius:50%;background:var(--x-carousel-dot-color);cursor:pointer;transition:background 150ms ease,transform 150ms ease;}[part\x3ddot]:hover{transform:scale(1.3);}[part\x3ddot]:focus-visible{outline:2px solid var(--x-carousel-focus-ring);outline-offset:2px;}[part\x3ddot][aria-current\x3dtrue]{background:var(--x-carousel-dot-active-color);}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}:host([disabled]){opacity:var(--x-carousel-disabled-opacity);pointer-events:none;}@media(prefers-reduced-motion:reduce){[part\x3dtrack]{transition-duration:0ms !important;}:host([data-transition\x3dfade]) ::slotted(*){transition-duration:0ms !important;}[part\x3dprev-btn],[part\x3dnext-btn],[part\x3ddot]{transition:none !important;}}@media(pointer:coarse){[part\x3dprev-btn],[part\x3dnext-btn]{width:max(var(--x-carousel-arrow-size),44px);height:max(var(--x-carousel-arrow-size),44px);}[part\x3ddot]{width:max(var(--x-carousel-dot-size),44px);height:max(var(--x-carousel-dot-size),44px);background-clip:content-box;padding:calc((44px - var(--x-carousel-dot-size)) / 2);box-sizing:content-box;}}";
|
|
27
|
+
d.setAttribute("part","viewport");d.setAttribute("tabindex","0");e.setAttribute("part","track");e.appendChild(f);h.setAttribute("part","prev-btn");h.setAttribute("type","button");h.setAttribute("aria-label","Previous slide");h.innerHTML='\x3csvg viewBox\x3d"0 0 24 24" fill\x3d"none" stroke\x3d"currentColor" stroke-width\x3d"2" stroke-linecap\x3d"round" stroke-linejoin\x3d"round"\x3e\x3cpolyline points\x3d"15 18 9 12 15 6"\x3e\x3c/polyline\x3e\x3c/svg\x3e';l.setAttribute("part","next-btn");l.setAttribute("type",
|
|
28
|
+
"button");l.setAttribute("aria-label","Next slide");l.innerHTML='\x3csvg viewBox\x3d"0 0 24 24" fill\x3d"none" stroke\x3d"currentColor" stroke-width\x3d"2" stroke-linecap\x3d"round" stroke-linejoin\x3d"round"\x3e\x3cpolyline points\x3d"9 6 15 12 9 18"\x3e\x3c/polyline\x3e\x3c/svg\x3e';d.appendChild(e);d.appendChild(h);d.appendChild(l);m.setAttribute("part","dots");m.setAttribute("role","tablist");m.setAttribute("aria-label","Slide indicators");q.setAttribute("aria-live","polite");q.setAttribute("aria-atomic",
|
|
29
|
+
"true");q.className="sr-only";b.appendChild(c);b.appendChild(d);b.appendChild(m);b.appendChild(q);a.__xCarouselRefs={root:b,viewport:d,track:e,slot:f,prev:h,next:l,dots:m,live:q};a.__xCarouselInit=!0}Pz(a);Oz(a);b=$APP.k($APP.k(a,"__xCarouselRefs"),"slot").assignedElements();a.__xCarouselSlideCount=b.length;Iz(a);Hz(a);return null},Sz=function(a){Pz(a);return null},Tz=function(a){$APP.$g(a,"__xCarouselInit")&&(Iz(a),$APP.n(a.isConnected)&&Hz(a));return null},Vz=function(){return $APP.Yg("x-carousel",
|
|
30
|
+
new $APP.N(null,5,[$APP.Pg,Uz,$APP.Qg,Rz,$APP.Rg,Sz,$APP.Sg,Tz,$APP.Wg,Qz],null))},yz=new $APP.F(null,"arrows-raw","arrows-raw",-1077955796),Dz=new $APP.F(null,"transition","transition",765692007),Cz=new $APP.F(null,"arrows?","arrows?",-1692502811),xz=new $APP.F(null,"transition-raw","transition-raw",-1184759092),Az=new $APP.F(null,"autoplay-present?","autoplay-present?",-1468092647),uz=new $APP.F(null,"slide-count","slide-count",1368058827),Bz=new $APP.F(null,"dots-raw","dots-raw",-1711545603),zz=
|
|
31
|
+
new $APP.F(null,"loop-present?","loop-present?",1373422006),Nz=new $APP.F(null,"stay","stay",-1240327234);var Uz="autoplay interval loop arrows dots disabled current transition direction peek aria-label".split(" ");
|
|
32
|
+
$APP.Lf([new $APP.F(null,"arrows","arrows",-1209622014),new $APP.F(null,"slideCount","slideCount",-1489337180),$APP.al,Dz,$APP.Vn,$APP.gm,$APP.Pl,$APP.jk,$APP.dm,new $APP.F(null,"currentSlide","currentSlide",-417438499),$APP.Gk],[new $APP.N(null,1,[$APP.R,$APP.T],null),new $APP.N(null,2,[$APP.R,$APP.V,$APP.El,!0],null),new $APP.N(null,1,[$APP.R,$APP.T],null),new $APP.N(null,1,[$APP.R,$APP.U],null),new $APP.N(null,1,[$APP.R,$APP.T],null),new $APP.N(null,1,[$APP.R,$APP.V],null),new $APP.N(null,1,[$APP.R,
|
|
33
|
+
$APP.T],null),new $APP.N(null,1,[$APP.R,$APP.U],null),new $APP.N(null,1,[$APP.R,$APP.T],null),new $APP.N(null,1,[$APP.R,$APP.V],null),new $APP.N(null,1,[$APP.R,$APP.U],null)]);$APP.Yd(["x-carousel-change",new $APP.N(null,2,[$APP.Z,new $APP.N(null,3,[$APP.qj,$APP.V,$APP.kl,$APP.V,$APP.Yj,$APP.U],null),$APP.Fn,!0],null)]);
|
|
34
|
+
var nz=new $APP.O(null,new $APP.N(null,2,["slide",null,"fade",null],null),null),pz=new $APP.O(null,new $APP.N(null,2,["vertical",null,"horizontal",null],null),null),rz=/^\d+(\.\d+)?(px|rem|em|%)$/,Kz=new $APP.O(null,new $APP.N(null,1,["ArrowLeft",null],null),null),Mz=new $APP.O(null,new $APP.N(null,1,["ArrowRight",null],null),null),Jz=new $APP.O(null,new $APP.N(null,1,["ArrowUp",null],null),null),Lz=new $APP.O(null,new $APP.N(null,1,["ArrowDown",null],null),null);$APP.ca("baredom.exports.x_carousel.init",Vz);export const init=Vz;
|
package/dist/x-chart.d.ts
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
export function init(): void;
|
|
4
4
|
|
|
5
|
+
export interface XChartEventMap {
|
|
6
|
+
"x-chart-select": CustomEvent<{ seriesId: string; index: number; x: number; y: number; value: number }>;
|
|
7
|
+
"x-chart-hover": CustomEvent<{ seriesId: string; index: number; x: number; y: number; value: number }>;
|
|
8
|
+
}
|
|
9
|
+
|
|
5
10
|
export interface XChart extends HTMLElement {
|
|
6
11
|
selected: string;
|
|
7
12
|
disabled: boolean;
|
|
@@ -14,6 +19,27 @@ export interface XChart extends HTMLElement {
|
|
|
14
19
|
tooltip: boolean;
|
|
15
20
|
height: number;
|
|
16
21
|
data: any;
|
|
22
|
+
|
|
23
|
+
addEventListener<K extends keyof XChartEventMap>(
|
|
24
|
+
type: K,
|
|
25
|
+
listener: (this: XChart, ev: XChartEventMap[K]) => any,
|
|
26
|
+
options?: boolean | AddEventListenerOptions
|
|
27
|
+
): void;
|
|
28
|
+
addEventListener(
|
|
29
|
+
type: string,
|
|
30
|
+
listener: EventListenerOrEventListenerObject,
|
|
31
|
+
options?: boolean | AddEventListenerOptions
|
|
32
|
+
): void;
|
|
33
|
+
removeEventListener<K extends keyof XChartEventMap>(
|
|
34
|
+
type: K,
|
|
35
|
+
listener: (this: XChart, ev: XChartEventMap[K]) => any,
|
|
36
|
+
options?: boolean | EventListenerOptions
|
|
37
|
+
): void;
|
|
38
|
+
removeEventListener(
|
|
39
|
+
type: string,
|
|
40
|
+
listener: EventListenerOrEventListenerObject,
|
|
41
|
+
options?: boolean | EventListenerOptions
|
|
42
|
+
): void;
|
|
17
43
|
}
|
|
18
44
|
|
|
19
45
|
declare global {
|