@vanelsas/baredom 2.2.0 → 2.3.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 +12 -0
- package/README.md +3 -3
- package/dist/base.js +402 -393
- package/dist/x-alert.js +17 -17
- package/dist/x-avatar-group.js +11 -11
- package/dist/x-avatar.js +14 -14
- package/dist/x-badge.js +11 -11
- package/dist/x-bento-grid.js +5 -5
- package/dist/x-bento-item.js +4 -4
- package/dist/x-breadcrumbs.js +14 -14
- package/dist/x-button.js +15 -15
- package/dist/x-cancel-dialogue.js +16 -16
- package/dist/x-card.js +7 -7
- package/dist/x-carousel.js +29 -29
- package/dist/x-chart.js +46 -46
- package/dist/x-checkbox.js +11 -11
- package/dist/x-chip.js +8 -8
- package/dist/x-collapse.js +10 -10
- package/dist/x-color-picker.js +41 -41
- package/dist/x-combobox.js +28 -0
- package/dist/x-command-palette.js +25 -25
- package/dist/x-container.js +6 -6
- package/dist/x-context-menu.js +18 -18
- package/dist/x-copy.js +22 -22
- package/dist/x-currency-field.js +21 -21
- package/dist/x-date-picker.js +37 -37
- package/dist/x-divider.js +8 -8
- package/dist/x-drawer.js +11 -11
- package/dist/x-dropdown.js +9 -9
- package/dist/x-fieldset.js +5 -5
- package/dist/x-file-download.js +7 -7
- package/dist/x-form-field.js +15 -15
- package/dist/x-form.js +9 -9
- package/dist/x-gaussian-blur.js +18 -18
- package/dist/x-grid.js +6 -6
- package/dist/x-icon.js +7 -7
- package/dist/x-image.js +18 -18
- package/dist/x-kinetic-font.js +28 -28
- package/dist/x-kinetic-typography.js +37 -37
- package/dist/x-liquid-dock.js +35 -35
- package/dist/x-liquid-fill.js +40 -40
- package/dist/x-liquid-glass.js +36 -36
- package/dist/x-menu-item.js +10 -10
- package/dist/x-menu.js +10 -10
- package/dist/x-metaball-cursor.js +25 -25
- package/dist/x-modal.js +12 -12
- package/dist/x-morph-stack.js +39 -39
- package/dist/x-navbar.js +12 -12
- package/dist/x-neural-glow.js +31 -31
- package/dist/x-notification-center.js +10 -10
- package/dist/x-organic-divider.js +15 -15
- package/dist/x-organic-progress.js +35 -35
- package/dist/x-organic-shape.js +12 -12
- package/dist/x-pagination.js +16 -16
- package/dist/x-particle-button.js +47 -47
- package/dist/x-popover.js +14 -14
- package/dist/x-progress-circle.js +7 -7
- package/dist/x-progress.js +7 -7
- package/dist/x-radio.js +11 -11
- package/dist/x-ripple-effect.js +11 -11
- package/dist/x-scroll-parallax.js +17 -17
- package/dist/x-scroll-stack.js +18 -18
- package/dist/x-scroll-story.js +34 -34
- package/dist/x-scroll-timeline.js +45 -45
- package/dist/x-scroll.js +40 -40
- package/dist/x-search-field.js +14 -14
- package/dist/x-select.js +9 -9
- package/dist/x-sidebar.js +16 -16
- package/dist/x-skeleton-group.js +15 -0
- package/dist/x-skeleton.js +1 -6
- package/dist/x-slider.js +16 -16
- package/dist/x-soft-body.js +20 -20
- package/dist/x-spacer.js +5 -5
- package/dist/x-spinner.js +5 -5
- package/dist/x-splash.js +13 -13
- package/dist/x-stat.js +9 -9
- package/dist/x-stepper.js +15 -16
- package/dist/x-switch.js +10 -10
- package/dist/x-tab.js +7 -7
- package/dist/x-table-cell.js +19 -19
- package/dist/x-table-row.js +10 -10
- package/dist/x-table.js +13 -13
- package/dist/x-tabs.js +11 -11
- package/dist/x-text-area.js +17 -17
- package/dist/x-theme.js +25 -25
- package/dist/x-timeline-item.js +20 -20
- package/dist/x-timeline.js +9 -9
- package/dist/x-toast.js +21 -21
- package/dist/x-toaster.js +8 -8
- package/dist/x-tooltip.js +14 -0
- package/dist/x-typography.js +8 -8
- package/package.json +13 -1
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
e:g;var h=$APP.
|
|
4
|
-
e+1),m=$APP.
|
|
2
|
+
var ex=function(a){return typeof a==="string"?(a=parseFloat(a.trim()),$APP.n(isNaN(a))?.5:$APP.nh.i(0,$APP.oh.i(1,a))):.5},fx=function(a){return typeof a==="string"?(a=parseFloat(a.trim()),$APP.n(isNaN(a))?50:$APP.nh.i(1,$APP.oh.i(1E3,a))):50},gx=function(a,b){switch(a){case "alternating":return $APP.fd(b,2)===0?"left":"right";case "left":return"right";case "right":return"left";default:return"right"}},hx=function(a,b){var c=$APP.z(a);if(c===0)return-1;for(var d=0,e=-1,g=-1;;){if(d>=c)return e>=0?
|
|
3
|
+
e:g;var h=$APP.pc(a,d),l=$APP.M(h);h=$APP.D(l,$APP.mi);l=$APP.D(l,$APP.xk);e=h<=b&&l>b?d:e;g=h<=b?d:g;d+=1}},ix=function(a,b,c){return b<=0?0:$APP.nh.i(0,$APP.oh.i(1,(c-a)/b))},kx=function(a,b,c){var d=$APP.z(a);if(d===0)return"";if($APP.C.i(d,1))return a=$APP.u(a),a=$APP.M(a),a=$APP.D(a,$APP.ql),"M "+$APP.T.g(c)+" "+$APP.T.g(a);var e=$APP.u(a),g=$APP.ql.g(e);e=0;for(g=new $APP.O(null,1,5,$APP.P,["M "+$APP.T.g(c)+" "+$APP.T.g(g)],null);;){if(e>=d-1)return $APP.Gg(g);var h=$APP.pc(a,e),l=$APP.pc(a,
|
|
4
|
+
e+1),m=$APP.ql.g(h),p=$APP.ql.g(l);h=jx.g(h);var q=jx.g(l);l=$APP.C.i(h,"left")?-b:b;q=$APP.C.i(q,"left")?-b:b;h=m+(p-m)*.33;q=c+q;m+=(p-m)*.66;var v=c;e+=1;g=$APP.ld.i(g,"C "+$APP.T.g(c+l)+" "+$APP.T.g(h)+" "+$APP.T.g(q)+" "+$APP.T.g(m)+" "+$APP.T.g(v)+" "+$APP.T.g(p))}},sx=function(a){var b=$APP.k(a,"__xScrollTimelineRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("div"),g=document.createElement("div"),
|
|
5
5
|
h=document.createElement("div"),l=document.createElementNS("http://www.w3.org/2000/svg","svg"),m=document.createElementNS("http://www.w3.org/2000/svg","path"),p=document.createElementNS("http://www.w3.org/2000/svg","path"),q=document.createElement("div"),v=document.createElement("slot"),x=document.createElement("div"),y=document.createElement("div");c.textContent=":host{display:block;position:relative;color-scheme:light dark;--x-scroll-timeline-track-color:rgba(0,0,0,0.12);--x-scroll-timeline-track-fill-color:var(--x-color-primary,#3b82f6);--x-scroll-timeline-track-width:3px;--x-scroll-timeline-marker-size:14px;--x-scroll-timeline-marker-color:rgba(0,0,0,0.15);--x-scroll-timeline-marker-active-color:var(--x-color-primary,#3b82f6);--x-scroll-timeline-marker-border-color:var(--x-color-primary,#3b82f6);--x-scroll-timeline-entry-gap:2rem;--x-scroll-timeline-date-color:rgba(0,0,0,0.5);--x-scroll-timeline-date-font-size:0.8125rem;--x-scroll-timeline-transition-duration:300ms;--x-scroll-timeline-curve-amplitude:60;--x-scroll-timeline-disabled-opacity:0.55;}@media (prefers-color-scheme:dark){:host{--x-scroll-timeline-track-color:rgba(255,255,255,0.12);--x-scroll-timeline-marker-color:rgba(255,255,255,0.18);--x-scroll-timeline-date-color:rgba(255,255,255,0.5);}}[part\x3dcontainer]{position:relative;padding:0;}[part\x3dtrack]{position:absolute;top:0;bottom:0;left:50%;transform:translateX(-50%);width:var(--x-scroll-timeline-track-width);pointer-events:none;z-index:1;}:host([data-layout\x3dleft]) [part\x3dtrack]{left:calc(var(--x-scroll-timeline-marker-size) / 2);transform:none;}:host([data-layout\x3dright]) [part\x3dtrack]{left:auto;right:calc(var(--x-scroll-timeline-marker-size) / 2);transform:none;}[part\x3dtrack-line]{position:absolute;top:0;bottom:0;left:0;right:0;background:var(--x-scroll-timeline-track-color);border-radius:999px;}[part\x3dtrack-fill]{position:absolute;top:0;left:0;right:0;height:0%;background:var(--x-scroll-timeline-track-fill-color);border-radius:999px;transition:height 60ms linear;}[part\x3dtrack-svg]{display:none;position:absolute;top:0;left:0;width:100%;height:100%;overflow:visible;pointer-events:none;z-index:1;}:host([data-track\x3dcurved]) [part\x3dtrack-line],:host([data-track\x3dcurved]) [part\x3dtrack-fill]{display:none;}:host([data-track\x3dcurved]) [part\x3dtrack-svg]{display:block;}[part\x3dtrack-path]{fill:none;stroke:var(--x-scroll-timeline-track-color);stroke-width:3px;stroke-linecap:round;}[part\x3dtrack-fill-path]{fill:none;stroke:var(--x-scroll-timeline-track-fill-color);stroke-width:3px;stroke-linecap:round;transition:stroke-dashoffset 60ms linear;}[part\x3dentries]{position:relative;z-index:2;}::slotted(*){display:block;margin-bottom:var(--x-scroll-timeline-entry-gap);opacity:0.4;transition:opacity var(--x-scroll-timeline-transition-duration) ease;}::slotted(:last-child){margin-bottom:0;}::slotted([data-active]){opacity:1;}:host([data-layout\x3dalternating]) ::slotted(*){width:calc(50% - var(--x-scroll-timeline-marker-size));}:host([data-layout\x3dalternating]) ::slotted([data-side\x3dleft]){margin-left:0;margin-right:auto;text-align:right;padding-right:1.5rem;}:host([data-layout\x3dalternating]) ::slotted([data-side\x3dright]){margin-left:auto;margin-right:0;text-align:left;padding-left:1.5rem;}:host([data-layout\x3dleft]) ::slotted(*){margin-left:calc(var(--x-scroll-timeline-marker-size) + 1.5rem);width:auto;}:host([data-layout\x3dright]) ::slotted(*){margin-right:calc(var(--x-scroll-timeline-marker-size) + 1.5rem);width:auto;text-align:right;}.tl-marker{position:absolute;z-index:3;width:var(--x-scroll-timeline-marker-size);height:var(--x-scroll-timeline-marker-size);border-radius:50%;background:var(--x-scroll-timeline-marker-color);border:2px solid transparent;transform:translate(-50%,-50%);transition:background var(--x-scroll-timeline-transition-duration) ease,border-color var(--x-scroll-timeline-transition-duration) ease,box-shadow var(--x-scroll-timeline-transition-duration) ease;}.tl-marker[data-active]{background:var(--x-scroll-timeline-marker-active-color);border-color:var(--x-scroll-timeline-marker-active-color);box-shadow:0 0 0 3px rgba(59,130,246,0.25);}:host([data-marker\x3dring]) .tl-marker{background:transparent;border:2px solid var(--x-scroll-timeline-marker-color);}:host([data-marker\x3dring]) .tl-marker[data-active]{background:var(--x-scroll-timeline-marker-active-color);border-color:var(--x-scroll-timeline-marker-active-color);}:host([data-marker\x3dnone]) .tl-marker{display:none;}.tl-marker{left:50%;}:host([data-layout\x3dleft]) .tl-marker{left:calc(var(--x-scroll-timeline-marker-size) / 2);}:host([data-layout\x3dright]) .tl-marker{left:auto;right:calc(var(--x-scroll-timeline-marker-size) / 2);transform:translate(50%,-50%);}.tl-date{position:absolute;z-index:3;font-size:var(--x-scroll-timeline-date-font-size);color:var(--x-scroll-timeline-date-color);white-space:nowrap;transform:translateY(-50%);transition:color var(--x-scroll-timeline-transition-duration) ease;}.tl-date[data-active]{color:var(--x-scroll-timeline-marker-active-color);font-weight:600;}:host([data-layout\x3dalternating]) .tl-date[data-side\x3dleft]{left:calc(50% + var(--x-scroll-timeline-marker-size));padding-left:0.5rem;}:host([data-layout\x3dalternating]) .tl-date[data-side\x3dright]{right:calc(50% + var(--x-scroll-timeline-marker-size));padding-right:0.5rem;text-align:right;}:host([data-layout\x3dleft]) .tl-date{left:calc(var(--x-scroll-timeline-marker-size) + 0.5rem);}:host([data-layout\x3dright]) .tl-date{right:calc(var(--x-scroll-timeline-marker-size) + 0.5rem);text-align:right;}:host([disabled]){opacity:var(--x-scroll-timeline-disabled-opacity);}[part\x3dlive]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;}[part\x3dindicator]{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);pointer-events:none;width:48px;height:48px;opacity:0.7;z-index:4;}[part\x3dindicator]::before,[part\x3dindicator]::after{content:'';position:absolute;top:8px;width:12px;height:32px;background:rgba(255,255,255,0.9);border-radius:3px;}[part\x3dindicator]::before{left:8px;}[part\x3dindicator]::after{right:8px;}:host([data-autoplay-paused][autoplay-indicator]) [part\x3dindicator]{display:block;}@media (pointer:coarse){:host{--x-scroll-timeline-marker-size:44px;}}@media (prefers-reduced-motion:reduce){::slotted(*){transition:none !important;}.tl-marker{transition:none !important;}.tl-date{transition:none !important;}[part\x3dtrack-fill]{transition:none !important;}[part\x3dtrack-fill-path]{transition:none !important;}}";
|
|
6
6
|
d.setAttribute("part","container");d.setAttribute("role","feed");e.setAttribute("part","track");g.setAttribute("part","track-line");h.setAttribute("part","track-fill");l.setAttribute("part","track-svg");l.setAttribute("aria-hidden","true");l.setAttribute("focusable","false");m.setAttribute("part","track-path");p.setAttribute("part","track-fill-path");p.setAttribute("pathLength","1");l.appendChild(m);l.appendChild(p);e.appendChild(g);e.appendChild(h);q.setAttribute("part","entries");q.appendChild(v);
|
|
7
|
-
x.setAttribute("part","indicator");d.appendChild(e);d.appendChild(q);d.appendChild(l);d.appendChild(x);y.setAttribute("part","live");y.setAttribute("aria-live","polite");y.setAttribute("aria-atomic","true");b.appendChild(c);b.appendChild(d);b.appendChild(y);b=$APP.
|
|
8
|
-
|
|
9
|
-
$APP.
|
|
10
|
-
[p,g,c!=null,d!=null,m,e,q!=null,a!=null,h,b,l!=null])},
|
|
11
|
-
$APP.
|
|
12
|
-
var d=$APP.k(a,"__xScrollTimelineMarkerEls");d=$APP.n(d)?d:[];b=b.length;for(var e=d.length,g=0;;)if(g<e)d[g].remove(),g+=1;else break;d=Array(b);for(e=0;;)if(e<b)g=document.createElement("div"),g.classList.add("tl-marker"),c.appendChild(g),d[e]=g,e+=1;else break;a.__xScrollTimelineMarkerEls=d},
|
|
13
|
-
l.remove();h+=1}else break;e=Array(d);for(g=0;;)if(g<d)h=b[g].getAttribute("data-date"),typeof h==="string"&&$APP.N(h,"")?(l=document.createElement("span"),l.classList.add("tl-date"),l.textContent=h,c.appendChild(l),e[g]=l):e[g]=null,g+=1;else break;a.__xScrollTimelineDateEls=e},
|
|
14
|
-
$APP.
|
|
15
|
-
7:E/2}(),y=function(){switch(l){case "left":return x;case "right":return p-x;default:return p*.5}}(),A=b.length;if(A>0){var B=function(){for(var E=0,H=$APP.
|
|
16
|
-
|
|
17
|
-
e[d].removeAttribute("data-active"),c>=0&&c<e.length&&e[c].setAttribute("data-active",""));$APP.n(g)&&(d>=0&&d<g.length&&(e=g[d],$APP.n(e)&&e.removeAttribute("data-active")),c>=0&&c<g.length&&(g=g[c],$APP.n(g)&&g.setAttribute("data-active","")));c>=0?a.setAttribute("data-active-index",""+$APP.T.g(c)):a.removeAttribute("data-active-index");a.__xScrollTimelineActiveIndex=c;g=d>=0&&d<b.length?
|
|
18
|
-
previousId:g});
|
|
19
|
-
{index:h,id:v,progress:m})):$APP.n($APP.n(q)?!l:q)&&(g[h]=!1,
|
|
20
|
-
l=
|
|
21
|
-
1);return($APP
|
|
22
|
-
$APP.n(h)?$APP.r($APP.k(a,"__xScrollTimelineAutoplayPaused")):h):h}())){var e=$APP.k(a,"__xScrollTimelineModel");if($APP.n(function(){if($APP.n(e)){var h=$APP.
|
|
23
|
-
g,window.scrollTo(0,$APP
|
|
24
|
-
return $APP.n(e)?e:0}();var c=function(){var e=$APP.k(a,"__xScrollTimelineActiveIndex");return $APP.n(e)?e:-1}(),d=
|
|
25
|
-
function(){var e=$APP.k(a,"__xScrollTimelineLastProg");return $APP.n(e)?e:0}(),c=function(){var e=$APP.k(a,"__xScrollTimelineActiveIndex");return $APP.n(e)?e:-1}(),d=
|
|
26
|
-
$APP.k(b,"pointerdown")),a.removeEventListener("pointerup",$APP.k(b,"pointerup")),a.removeEventListener("pointerleave",$APP.k(b,"pointerleave")),a.removeEventListener("keydown",$APP.k(b,"keydown")),a.removeEventListener("keyup",$APP.k(b,"keyup")),a.__xScrollTimelineAutoplayHandlers=null);a.removeAttribute("data-autoplay-paused");a.removeAttribute("tabindex");a.__xScrollTimelineAutoplayPaused=!1;a.__xScrollTimelineAutoplayLast=null},
|
|
27
|
-
$APP.k(a,"__xScrollTimelineModel");if($APP.n(function(){if($APP.n(b)){var l=$APP.
|
|
28
|
-
|
|
29
|
-
$APP.
|
|
30
|
-
!0)},
|
|
31
|
-
return $APP.n($APP.n(b)?$APP.
|
|
32
|
-
"__xScrollTimelineDateEls"),h=$APP.M($APP.k(a,"__xScrollTimelineRefs"));h=$APP.D(h,$APP.
|
|
33
|
-
|
|
34
|
-
$APP.k(a,"__xScrollTimelineHandlers");if($APP.n(b)){
|
|
35
|
-
c)},{threshold:[0]});b.observe(a);a.__xScrollTimelineIO=b},
|
|
36
|
-
b;$APP.n(e)?(
|
|
37
|
-
return $APP.n(e)?e:d},set:function(e){return $APP.n(e)?this.setAttribute(c,""+$APP.T.g(e)):this.removeAttribute(c)},enumerable:!0,configurable:!0})}
|
|
38
|
-
set:function(d){return $APP.n(d)?this.setAttribute(c,""):this.removeAttribute(c)},enumerable:!0,configurable:!0})},
|
|
39
|
-
|
|
40
|
-
!1)},
|
|
41
|
-
this.__xScrollTimelineVisible=!1;this.__xScrollTimelineActiveIndex=-1;return this.__xScrollTimelineEntryStates=this.__xScrollTimelineLastProg=null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.N(c,d)&&
|
|
42
|
-
"marker-raw","marker-raw",2140891555),
|
|
43
|
-
"track-line","track-line",1370628624);var
|
|
44
|
-
$APP.
|
|
45
|
-
new $APP.
|
|
46
|
-
$APP.
|
|
47
|
-
2,[$APP.
|
|
48
|
-
new $APP.
|
|
7
|
+
x.setAttribute("part","indicator");d.appendChild(e);d.appendChild(q);d.appendChild(l);d.appendChild(x);y.setAttribute("part","live");y.setAttribute("aria-live","polite");y.setAttribute("aria-atomic","true");b.appendChild(c);b.appendChild(d);b.appendChild(y);b=$APP.zf([$APP.bj,lx,mx,nx,ox,px,$APP.yi,$APP.xj,qx,$APP.wi,rx,$APP.Vi],[v,l,p,q,m,g,b,d,x,y,h,e]);a.__xScrollTimelineRefs=b;return $APP.k(a,"__xScrollTimelineRefs")},Ax=function(a){a=$APP.zf([$APP.ki,tx,$APP.Oj,$APP.Nl,$APP.Vh,$APP.Uk,$APP.Ii,
|
|
8
|
+
ux,$APP.Wi,$APP.Ll,vx],[a.getAttribute("label"),a.getAttribute("marker"),a.getAttribute("autoplay-speed"),$APP.n(a.hasAttribute("autoplay"))?"":null,a.getAttribute("threshold"),a.getAttribute("layout"),$APP.n(a.hasAttribute("autoplay-indicator"))?"":null,a.getAttribute("track"),$APP.n(a.hasAttribute("disabled"))?"":null,$APP.n(a.hasAttribute("autoplay-loop"))?"":null,$APP.n(a.hasAttribute("no-progress"))?"":null]);var b=$APP.M(a);a=$APP.D(b,$APP.Wi);var c=$APP.D(b,$APP.Ll),d=$APP.D(b,vx),e=$APP.D(b,
|
|
9
|
+
$APP.ki),g=$APP.D(b,tx),h=$APP.D(b,$APP.Oj),l=$APP.D(b,$APP.Nl),m=$APP.D(b,$APP.Vh),p=$APP.D(b,$APP.Uk),q=$APP.D(b,$APP.Ii);b=$APP.D(b,ux);p=typeof p==="string"?p.trim().toLowerCase():null;p=$APP.I(wx,p)?p:"alternating";g=typeof g==="string"?g.trim().toLowerCase():null;g=$APP.I(xx,g)?g:"dot";m=ex(m);e=$APP.n(e)?e:"";h=fx(h);b=typeof b==="string"?b.trim().toLowerCase():null;b=$APP.I(yx,b)?b:"straight";return $APP.zf([$APP.fk,$APP.Ek,$APP.si,zx,$APP.Al,$APP.U,$APP.Bi,$APP.X,$APP.Pj,$APP.Vi,$APP.Ei],
|
|
10
|
+
[p,g,c!=null,d!=null,m,e,q!=null,a!=null,h,b,l!=null])},Bx=function(a){a=sx(a);a=$APP.M(a);return $APP.D(a,$APP.bj).assignedElements()},Cx=function(){return $APP.F(window.matchMedia("(prefers-reduced-motion:reduce)").matches)},Dx=function(a){a=a.getAttribute("id");return typeof a==="string"&&$APP.N(a,"")?a:null},Ex=function(a,b,c){b=new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:!1});return a.dispatchEvent(b)},Fx=function(a,b){a=$APP.M($APP.k(a,"__xScrollTimelineRefs"));var c=$APP.D(a,
|
|
11
|
+
$APP.wi);c.textContent=b;setTimeout(function(){return c.textContent=""},1E3)},Gx=function(a,b){for(var c=a.length,d=0;;)if(d<c){var e=a[d];e.setAttribute("data-side",gx(b,d));e.setAttribute("data-index",""+$APP.T.g(d));d+=1}else break},Hx=function(a){a=Bx(a);for(var b=a.length,c=0;;)if(c<b){var d=a[c];d.removeAttribute("data-active");d.removeAttribute("data-side");d.removeAttribute("data-index");c+=1}else break},Ix=function(a,b){var c=$APP.M($APP.k(a,"__xScrollTimelineRefs"));c=$APP.D(c,$APP.xj);
|
|
12
|
+
var d=$APP.k(a,"__xScrollTimelineMarkerEls");d=$APP.n(d)?d:[];b=b.length;for(var e=d.length,g=0;;)if(g<e)d[g].remove(),g+=1;else break;d=Array(b);for(e=0;;)if(e<b)g=document.createElement("div"),g.classList.add("tl-marker"),c.appendChild(g),d[e]=g,e+=1;else break;a.__xScrollTimelineMarkerEls=d},Jx=function(a,b){var c=$APP.M($APP.k(a,"__xScrollTimelineRefs"));c=$APP.D(c,$APP.xj);var d=$APP.k(a,"__xScrollTimelineDateEls");var e=$APP.n(d)?d:[];d=b.length;for(var g=e.length,h=0;;)if(h<g){var l=e[h];$APP.n(l)&&
|
|
13
|
+
l.remove();h+=1}else break;e=Array(d);for(g=0;;)if(g<d)h=b[g].getAttribute("data-date"),typeof h==="string"&&$APP.N(h,"")?(l=document.createElement("span"),l.classList.add("tl-date"),l.textContent=h,c.appendChild(l),e[g]=l):e[g]=null,g+=1;else break;a.__xScrollTimelineDateEls=e},Kx=function(a,b,c){a=$APP.M($APP.k(a,"__xScrollTimelineRefs"));a=$APP.D(a,rx);$APP.n(c)?a.style.height="0%":a.style.height=""+$APP.T.g(b*100)+"%"},Lx=function(a,b){var c=$APP.M($APP.k(a,"__xScrollTimelineRefs")),d=$APP.D(c,
|
|
14
|
+
$APP.xj),e=$APP.D(c,lx),g=$APP.D(c,ox);c=$APP.D(c,mx);var h=function(){var E=$APP.k(a,"__xScrollTimelineModel");return $APP.n(E)?E:Ax(a)}(),l=$APP.fk.g(h);h=d.getBoundingClientRect();var m=h.top;d=h.height;var p=h.width,q=window.getComputedStyle(a).getPropertyValue("--x-scroll-timeline-curve-amplitude");h=function(){var E=parseFloat(q);return $APP.n(isNaN(E))?60:E}();var v=window.getComputedStyle(a).getPropertyValue("--x-scroll-timeline-marker-size"),x=function(){var E=parseFloat(v);return $APP.n(isNaN(E))?
|
|
15
|
+
7:E/2}(),y=function(){switch(l){case "left":return x;case "right":return p-x;default:return p*.5}}(),A=b.length;if(A>0){var B=function(){for(var E=0,H=$APP.fe;;){if(E>=A)return H;var G=b[E].getBoundingClientRect(),J=E+1;H=$APP.ld.i(H,new $APP.Q(null,2,[$APP.ql,G.top+G.height/2-m,jx,gx(l,E)],null));E=J}}();h=kx(B,h,y);e.setAttribute("viewBox","0 0 "+$APP.T.g(p)+" "+$APP.T.g(d));g.setAttribute("d",h);c.setAttribute("d",h);c.setAttribute("stroke-dasharray","1");c.setAttribute("stroke-dashoffset","1")}},
|
|
16
|
+
Mx=function(a,b,c){a=$APP.M($APP.k(a,"__xScrollTimelineRefs"));a=$APP.D(a,mx);$APP.n(c)?a.setAttribute("stroke-dashoffset","1"):a.setAttribute("stroke-dashoffset",""+$APP.T.g(1-b))},Nx=function(a,b,c){var d=$APP.k(a,"__xScrollTimelineActiveIndex");d=$APP.n(d)?d:-1;if($APP.N(d,c)){d>=0&&d<b.length&&b[d].removeAttribute("data-active");c>=0&&c<b.length&&b[c].setAttribute("data-active","");var e=$APP.k(a,"__xScrollTimelineMarkerEls"),g=$APP.k(a,"__xScrollTimelineDateEls");$APP.n(e)&&(d>=0&&d<e.length&&
|
|
17
|
+
e[d].removeAttribute("data-active"),c>=0&&c<e.length&&e[c].setAttribute("data-active",""));$APP.n(g)&&(d>=0&&d<g.length&&(e=g[d],$APP.n(e)&&e.removeAttribute("data-active")),c>=0&&c<g.length&&(g=g[c],$APP.n(g)&&g.setAttribute("data-active","")));c>=0?a.setAttribute("data-active-index",""+$APP.T.g(c)):a.removeAttribute("data-active-index");a.__xScrollTimelineActiveIndex=c;g=d>=0&&d<b.length?Dx(b[d]):null;b=c>=0&&c<b.length?Dx(b[c]):null;Ex(a,"x-scroll-timeline-entry-change",{index:c,id:b,previousIndex:d,
|
|
18
|
+
previousId:g});Fx(a,"Entry "+$APP.T.g(c+1)+" active")}},Ox=function(a,b,c,d){var e=b.length;var g=$APP.k(a,"__xScrollTimelineEntryStates");if(!$APP.n($APP.n(g)?$APP.C.i(g.length,e):g)){for(var h=Array(e),l=0;;)if(l<e)h[l]=$APP.n($APP.n(g)?l<g.length:g)?g[l]:!1,l+=1;else break;g=a.__xScrollTimelineEntryStates=h}for(h=0;;)if(h<e){if(h<$APP.z(c)){l=$APP.pc(c,h);l=$APP.M(l);var m=$APP.D(l,$APP.mi),p=$APP.D(l,$APP.xk),q=g[h];l=m<=d&&p>d;var v=Dx(b[h]);m=ix(m,p-m,d);$APP.r(q)&&l?(g[h]=!0,Ex(a,"x-scroll-timeline-entry-enter",
|
|
19
|
+
{index:h,id:v,progress:m})):$APP.n($APP.n(q)?!l:q)&&(g[h]=!1,Ex(a,"x-scroll-timeline-entry-leave",{index:h,id:v,progress:m}))}h+=1}else break},Px=function(a){var b=function(){var q=$APP.k(a,"__xScrollTimelineModel");return $APP.n(q)?q:Ax(a)}();if(!$APP.n($APP.X.g(b))){var c=Bx(a),d=c.length,e=window.innerHeight,g=e*$APP.Al.g(b),h=function(){for(var q=0,v=$APP.fe;;){if(q>=d)return v;var x=c[q].getBoundingClientRect();q+=1;v=$APP.ld.i(v,new $APP.Q(null,2,[$APP.mi,x.top,$APP.xk,x.top+x.height],null))}}(),
|
|
20
|
+
l=hx(h,g),m=$APP.M($APP.k(a,"__xScrollTimelineRefs"));m=$APP.D(m,$APP.xj).getBoundingClientRect();e=$APP.nh.i(0,$APP.oh.i(1,(e-m.top)/(e+m.height)));m=$APP.k(a,"__xScrollTimelineLastProg");var p=d<2||l<0?0:function(){var q=function(){var B=$APP.pc(h,0);return($APP.mi.g(B)+$APP.xk.g(B))/2}(),v=function(){var B=$APP.pc(h,d-1);return($APP.mi.g(B)+$APP.xk.g(B))/2}()-q,x=$APP.pc(h,l),y=($APP.mi.g(x)+$APP.xk.g(x))/2;x=ix($APP.mi.g(x),$APP.xk.g(x)-$APP.mi.g(x),g);var A=l<d-1?function(){var B=$APP.pc(h,l+
|
|
21
|
+
1);return($APP.mi.g(B)+$APP.xk.g(B))/2}():y;return v<=0?1:$APP.nh.i(0,$APP.oh.i(1,(y+x*(A-y)-q)/v))}();Nx(a,c,l);Ox(a,c,h,g);$APP.C.i($APP.Vi.g(b),"curved")?Mx(a,p,zx.g(b)):Kx(a,p,zx.g(b));if(m==null||Math.abs(e-m)>.001)a.__xScrollTimelineLastProg=e,b=l>=0&&l<d?Dx(c[l]):null,Ex(a,"x-scroll-timeline-progress",{progress:e,activeIndex:l,activeId:b})}a.__xScrollTimelineRAF=null},Qx=function(a){return function d(c){if($APP.n(function(){var h=a.isConnected;return $APP.n(h)?(h=$APP.k(a,"__xScrollTimelineVisible"),
|
|
22
|
+
$APP.n(h)?$APP.r($APP.k(a,"__xScrollTimelineAutoplayPaused")):h):h}())){var e=$APP.k(a,"__xScrollTimelineModel");if($APP.n(function(){if($APP.n(e)){var h=$APP.Ei.g(e);return $APP.n(h)?$APP.r($APP.X.g(e)):h}return e}())){var g=$APP.k(a,"__xScrollTimelineAutoplayLast");g=$APP.n(g)?(c-g)/1E3:0;a.__xScrollTimelineAutoplayLast=c;g>0&&(window.scrollBy(0,$APP.Pj.g(e)*g),$APP.n($APP.si.g(e))&&(g=window.scrollY,c=window.innerHeight,g+c>=document.documentElement.scrollHeight-1&&(g=a.getBoundingClientRect().top+
|
|
23
|
+
g,window.scrollTo(0,$APP.nh.i(0,g-c)),a.__xScrollTimelineAutoplayLast=null)));return $APP.ja(a,"__xScrollTimelineAutoplayRAF",requestAnimationFrame(d))}}return null}},Rx=function(a){if($APP.n($APP.k(a,"__xScrollTimelineAutoplayPaused")))return null;a.__xScrollTimelineAutoplayPaused=!0;var b=$APP.k(a,"__xScrollTimelineAutoplayRAF");$APP.n(b)&&(cancelAnimationFrame(b),a.__xScrollTimelineAutoplayRAF=null);a.setAttribute("data-autoplay-paused","");b=function(){var e=$APP.k(a,"__xScrollTimelineLastProg");
|
|
24
|
+
return $APP.n(e)?e:0}();var c=function(){var e=$APP.k(a,"__xScrollTimelineActiveIndex");return $APP.n(e)?e:-1}(),d=Bx(a);d=c>=0&&c<d.length?Dx(d[c]):null;return Ex(a,"x-scroll-timeline-autoplay-pause",{progress:b,activeIndex:c,activeId:d})},Sx=function(a){if($APP.n($APP.k(a,"__xScrollTimelineAutoplayPaused"))){a.__xScrollTimelineAutoplayPaused=!1;a.removeAttribute("data-autoplay-paused");a.__xScrollTimelineAutoplayLast=null;$APP.ja(a,"__xScrollTimelineAutoplayRAF",requestAnimationFrame(Qx(a)));var b=
|
|
25
|
+
function(){var e=$APP.k(a,"__xScrollTimelineLastProg");return $APP.n(e)?e:0}(),c=function(){var e=$APP.k(a,"__xScrollTimelineActiveIndex");return $APP.n(e)?e:-1}(),d=Bx(a);d=c>=0&&c<d.length?Dx(d[c]):null;return Ex(a,"x-scroll-timeline-autoplay-resume",{progress:b,activeIndex:c,activeId:d})}return null},Tx=function(a){var b=$APP.k(a,"__xScrollTimelineAutoplayRAF");$APP.n(b)&&(cancelAnimationFrame(b),a.__xScrollTimelineAutoplayRAF=null);b=$APP.k(a,"__xScrollTimelineAutoplayHandlers");$APP.n(b)&&(a.removeEventListener("pointerdown",
|
|
26
|
+
$APP.k(b,"pointerdown")),a.removeEventListener("pointerup",$APP.k(b,"pointerup")),a.removeEventListener("pointerleave",$APP.k(b,"pointerleave")),a.removeEventListener("keydown",$APP.k(b,"keydown")),a.removeEventListener("keyup",$APP.k(b,"keyup")),a.__xScrollTimelineAutoplayHandlers=null);a.removeAttribute("data-autoplay-paused");a.removeAttribute("tabindex");a.__xScrollTimelineAutoplayPaused=!1;a.__xScrollTimelineAutoplayLast=null},Ux=function(a){if($APP.k(a,"__xScrollTimelineAutoplayRAF")==null){var b=
|
|
27
|
+
$APP.k(a,"__xScrollTimelineModel");if($APP.n(function(){if($APP.n(b)){var l=$APP.Ei.g(b);return $APP.n(l)?(l=$APP.r($APP.X.g(b)))?(l=$APP.k(a,"__xScrollTimelineVisible"),$APP.n(l)?!Cx():l):l:l}return b}())){a.setAttribute("tabindex","0");a.__xScrollTimelineAutoplayPaused=!1;a.__xScrollTimelineAutoplayLast=null;var c=function(){return Rx(a)},d=function(){return Sx(a)},e=function(){return $APP.n($APP.k(a,"__xScrollTimelineAutoplayPaused"))?Sx(a):null},g=function(l){return $APP.C.i(l.code,"Space")?(l.preventDefault(),
|
|
28
|
+
Rx(a)):null},h=function(l){return $APP.C.i(l.code,"Space")?Sx(a):null};a.addEventListener("pointerdown",c);a.addEventListener("pointerup",d);a.addEventListener("pointerleave",e);a.addEventListener("keydown",g);a.addEventListener("keyup",h);$APP.ja(a,"__xScrollTimelineAutoplayHandlers",{pointerdown:c,pointerup:d,pointerleave:e,keydown:g,keyup:h});$APP.ja(a,"__xScrollTimelineAutoplayRAF",requestAnimationFrame(Qx(a)))}}return null},Vx=function(a){a=$APP.k(a,"__xScrollTimelineModel");return $APP.n(a)?
|
|
29
|
+
$APP.X.g(a):a},Wx=function(a){return $APP.n(function(){var b=a.isConnected;return $APP.n(b)?(b=$APP.k(a,"__xScrollTimelineVisible"),$APP.n(b)?$APP.r(Vx(a))&&!Cx():b):b}())?$APP.n($APP.k(a,"__xScrollTimelineRAF"))?null:$APP.ja(a,"__xScrollTimelineRAF",requestAnimationFrame(function(){return Px(a)})):null},Xx=function(a){a=$APP.k(a,"__xScrollTimelineHandlers");$APP.n($APP.n(a)?$APP.r($APP.k(a,"scrollAttached")):a)&&(window.addEventListener("scroll",$APP.k(a,"scroll"),{passive:!0}),a.scrollAttached=
|
|
30
|
+
!0)},Yx=function(a){a=$APP.k(a,"__xScrollTimelineHandlers");$APP.n($APP.n(a)?$APP.k(a,"scrollAttached"):a)&&(window.removeEventListener("scroll",$APP.k(a,"scroll")),a.scrollAttached=!1)},Zx=function(a,b){b=b[0].isIntersecting;a.__xScrollTimelineVisible=b;if($APP.n(b)){if($APP.n(Vx(a)))return null;Xx(a);Px(a);Fx(a,"Timeline entered viewport");Ex(a,"x-scroll-timeline-enter",{progress:function(){var c=$APP.k(a,"__xScrollTimelineLastProg");return $APP.n(c)?c:0}()});b=$APP.k(a,"__xScrollTimelineModel");
|
|
31
|
+
return $APP.n($APP.n(b)?$APP.Ei.g(b):b)?Ux(a):null}Yx(a);Tx(a);if($APP.n(Vx(a)))return null;Fx(a,"Timeline left viewport");return Ex(a,"x-scroll-timeline-leave",{progress:function(){var c=$APP.k(a,"__xScrollTimelineLastProg");return $APP.n(c)?c:0}()})},$x=function(a){var b=function(){var d=$APP.k(a,"__xScrollTimelineModel");return $APP.n(d)?d:Ax(a)}(),c=Bx(a);Gx(c,$APP.fk.g(b));Ix(a,c);Jx(a,c);return requestAnimationFrame(function(){var d=Bx(a),e=$APP.k(a,"__xScrollTimelineMarkerEls"),g=$APP.k(a,
|
|
32
|
+
"__xScrollTimelineDateEls"),h=$APP.M($APP.k(a,"__xScrollTimelineRefs"));h=$APP.D(h,$APP.xj).getBoundingClientRect().top;var l=$APP.k(a,"__xScrollTimelineModel");l=$APP.n(l)?l:Ax(a);l=$APP.fk.g(l);for(var m=d.length,p=0;;)if(p<m){var q=d[p].getBoundingClientRect();q=q.top+q.height/2-h;var v=gx(l,p),x=$APP.n(e)?e[p]:e;$APP.n(x)&&(x.style.top=""+$APP.T.g(q)+"px");x=$APP.n(g)?g[p]:g;$APP.n(x)&&(x.style.top=""+$APP.T.g(q)+"px",x.setAttribute("data-side",v));p+=1}else break;$APP.C.i($APP.Vi.g(b),"curved")&&
|
|
33
|
+
Lx(a,d);return $APP.n($APP.k(a,"__xScrollTimelineVisible"))?Px(a):null})},ay=function(a){function b(){return $APP.n($APP.k(a,"__xScrollTimelineVisible"))?(a.__xScrollTimelineEntryStates=null,$x(a)):null}function c(){a.__xScrollTimelineEntryStates=null;return $x(a)}var d=sx(a);d=$APP.M(d);$APP.D(d,$APP.bj).addEventListener("slotchange",c);window.addEventListener("resize",b);$APP.ja(a,"__xScrollTimelineHandlers",{scroll:function(){return Wx(a)},slot:c,resize:b,scrollAttached:!1})},by=function(a){var b=
|
|
34
|
+
$APP.k(a,"__xScrollTimelineHandlers");if($APP.n(b)){Yx(a);var c=$APP.k(a,"__xScrollTimelineRefs");if($APP.n(c)){c=$APP.bj.g(c);var d=$APP.k(b,"slot");$APP.n(d)&&c.removeEventListener("slotchange",d)}b=$APP.k(b,"resize");$APP.n(b)&&window.removeEventListener("resize",b)}b=$APP.k(a,"__xScrollTimelineRAF");$APP.n(b)&&(cancelAnimationFrame(b),a.__xScrollTimelineRAF=null);a.__xScrollTimelineHandlers=null},cy=function(a){var b=$APP.k(a,"__xScrollTimelineIO");$APP.n(b)&&b.disconnect();b=new IntersectionObserver(function(c){return Zx(a,
|
|
35
|
+
c)},{threshold:[0]});b.observe(a);a.__xScrollTimelineIO=b},dy=function(a){var b=Ax(a);if($APP.N($APP.k(a,"__xScrollTimelineModel"),b)){b=$APP.M(b);var c=$APP.D(b,$APP.fk),d=$APP.D(b,$APP.Vi),e=$APP.D(b,$APP.X),g=$APP.D(b,$APP.U),h=$APP.D(b,$APP.Ek),l=sx(a);l=$APP.M(l);l=$APP.D(l,$APP.xj);var m=$APP.k(a,"__xScrollTimelineModel");a.setAttribute("data-layout",c);a.setAttribute("data-track",d);a.setAttribute("data-marker",h);$APP.t(g)?l.setAttribute("aria-label",g):l.removeAttribute("aria-label");a.__xScrollTimelineModel=
|
|
36
|
+
b;$APP.n(e)?(Hx(a),a.__xScrollTimelineActiveIndex=-1,a.__xScrollTimelineEntryStates=null,Yx(a),Tx(a)):$APP.n(m)&&($APP.N($APP.fk.g(m),c)||$APP.N($APP.Vi.g(m),d)||$APP.N($APP.Ek.g(m),h)||$APP.N($APP.X.g(m),e)?$x(a):($APP.N($APP.Al.g(m),$APP.Al.g(b))||$APP.N(zx.g(m),zx.g(b)))&&$APP.n($APP.k(a,"__xScrollTimelineVisible"))&&Px(a));$APP.n(e)||(b=$APP.Ei.g(b),$APP.n($APP.n(b)?$APP.k(a,"__xScrollTimelineVisible"):b)?Ux(a):Tx(a))}},ey=function(a,b,c,d){Object.defineProperty(a,b,{get:function(){var e=this.getAttribute(c);
|
|
37
|
+
return $APP.n(e)?e:d},set:function(e){return $APP.n(e)?this.setAttribute(c,""+$APP.T.g(e)):this.removeAttribute(c)},enumerable:!0,configurable:!0})},fy=function(a){Object.defineProperty(a,"label",{get:function(){var b=this.getAttribute("label");return $APP.n(b)?b:""},set:function(b){return $APP.n($APP.n(b)?$APP.N(b,""):b)?this.setAttribute("label",""+$APP.T.g(b)):this.removeAttribute("label")},enumerable:!0,configurable:!0})},gy=function(a,b,c){Object.defineProperty(a,b,{get:function(){return this.hasAttribute(c)},
|
|
38
|
+
set:function(d){return $APP.n(d)?this.setAttribute(c,""):this.removeAttribute(c)},enumerable:!0,configurable:!0})},hy=function(a,b,c,d){Object.defineProperty(a,b,{get:function(){var e=this.getAttribute(c);return d.g?d.g(e):d.call(null,e)},set:function(e){return e!=null?this.setAttribute(c,""+$APP.T.g(e)):this.removeAttribute(c)},enumerable:!0,configurable:!0})},iy=function(a,b,c,d){Object.defineProperty(a,b,{get:function(){var e=$APP.k(this,c);return e!=null?e:d},enumerable:!0,configurable:!0})},
|
|
39
|
+
jy=function(a){ey(a,"layout","layout","alternating");ey(a,"track","track","straight");ey(a,"marker","marker","dot");fy(a);hy(a,"threshold","threshold",ex);gy(a,"noProgress","no-progress");gy(a,"disabled","disabled");gy(a,"autoplay","autoplay");hy(a,"autoplaySpeed","autoplay-speed",fx);gy(a,"autoplayLoop","autoplay-loop");gy(a,"autoplayIndicator","autoplay-indicator");iy(a,"activeIndex","__xScrollTimelineActiveIndex",-1);iy(a,"progress","__xScrollTimelineLastProg",0);iy(a,"autoplayPaused","__xScrollTimelineAutoplayPaused",
|
|
40
|
+
!1)},ly=function(){var a=class extends HTMLElement{};a.observedAttributes=ky;a.prototype.connectedCallback=function(){sx(this);by(this);ay(this);cy(this);dy(this);return null};a.prototype.disconnectedCallback=function(){Tx(this);Hx(this);if($APP.n($APP.k(this,"__xScrollTimelineVisible"))){var b=$APP.k(this,"__xScrollTimelineLastProg");Ex(this,"x-scroll-timeline-leave",{progress:$APP.n(b)?b:0})}by(this);b=$APP.k(this,"__xScrollTimelineIO");$APP.n(b)&&(b.disconnect(),this.__xScrollTimelineIO=null);
|
|
41
|
+
this.__xScrollTimelineVisible=!1;this.__xScrollTimelineActiveIndex=-1;return this.__xScrollTimelineEntryStates=this.__xScrollTimelineLastProg=null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.N(c,d)&&dy(this);return null};jy(a.prototype);return a},my=function(){$APP.n(customElements.get("x-scroll-timeline"))||customElements.define("x-scroll-timeline",ly());return null},rx=new $APP.K(null,"track-fill","track-fill",1852369499),nx=new $APP.K(null,"entries","entries",-86943161),tx=new $APP.K(null,
|
|
42
|
+
"marker-raw","marker-raw",2140891555),qx=new $APP.K(null,"indicator","indicator",1928219637),zx=new $APP.K(null,"no-progress?","no-progress?",-1599319890),ux=new $APP.K(null,"track-raw","track-raw",751958776),ox=new $APP.K(null,"track-path","track-path",-1838135442),mx=new $APP.K(null,"fill-path","fill-path",-792439899),vx=new $APP.K(null,"no-progress-attr","no-progress-attr",115951679),lx=new $APP.K(null,"track-svg","track-svg",-556455964),jx=new $APP.K(null,"side","side",389652279),px=new $APP.K(null,
|
|
43
|
+
"track-line","track-line",1370628624);var ky="layout track threshold no-progress disabled label marker autoplay autoplay-speed autoplay-loop autoplay-indicator".split(" ");
|
|
44
|
+
$APP.zf([$APP.al,$APP.Fh,$APP.Bk,$APP.Fj,$APP.fk,$APP.hk,$APP.Ek,$APP.Al,$APP.qm,$APP.U,$APP.uk,$APP.Il,new $APP.K(null,"noProgress","noProgress",-2114530658),$APP.Vi],[new $APP.Q(null,1,[$APP.Z,$APP.Sj],null),new $APP.Q(null,1,[$APP.Z,$APP.W],null),new $APP.Q(null,1,[$APP.Z,$APP.Sj],null),new $APP.Q(null,1,[$APP.Z,$APP.Sj],null),new $APP.Q(null,1,[$APP.Z,$APP.Y],null),new $APP.Q(null,2,[$APP.Z,$APP.W,$APP.kk,!0],null),new $APP.Q(null,1,[$APP.Z,$APP.Y],null),new $APP.Q(null,1,[$APP.Z,$APP.W],null),
|
|
45
|
+
new $APP.Q(null,2,[$APP.Z,$APP.Sj,$APP.kk,!0],null),new $APP.Q(null,1,[$APP.Z,$APP.Y],null),new $APP.Q(null,1,[$APP.Z,$APP.Sj],null),new $APP.Q(null,2,[$APP.Z,$APP.W,$APP.kk,!0],null),new $APP.Q(null,1,[$APP.Z,$APP.Sj],null),new $APP.Q(null,1,[$APP.Z,$APP.Y],null)]);
|
|
46
|
+
$APP.Qd(["x-scroll-timeline-entry-change",new $APP.Q(null,2,[$APP.V,new $APP.Q(null,4,[$APP.$h,$APP.W,$APP.fl,$APP.Y,$APP.Tj,$APP.W,$APP.Km,$APP.Y],null),$APP.Rl,!1],null),"x-scroll-timeline-entry-enter",new $APP.Q(null,2,[$APP.V,new $APP.Q(null,3,[$APP.$h,$APP.W,$APP.fl,$APP.Y,$APP.Il,$APP.W],null),$APP.Rl,!1],null),"x-scroll-timeline-entry-leave",new $APP.Q(null,2,[$APP.V,new $APP.Q(null,3,[$APP.$h,$APP.W,$APP.fl,$APP.Y,$APP.Il,$APP.W],null),$APP.Rl,!1],null),"x-scroll-timeline-progress",new $APP.Q(null,
|
|
47
|
+
2,[$APP.V,new $APP.Q(null,3,[$APP.Il,$APP.W,$APP.hk,$APP.W,$APP.ml,$APP.Y],null),$APP.Rl,!1],null),"x-scroll-timeline-enter",new $APP.Q(null,2,[$APP.V,new $APP.Q(null,1,[$APP.Il,$APP.W],null),$APP.Rl,!1],null),"x-scroll-timeline-leave",new $APP.Q(null,2,[$APP.V,new $APP.Q(null,1,[$APP.Il,$APP.W],null),$APP.Rl,!1],null),"x-scroll-timeline-autoplay-pause",new $APP.Q(null,2,[$APP.V,new $APP.Q(null,3,[$APP.Il,$APP.W,$APP.hk,$APP.W,$APP.ml,$APP.Y],null),$APP.Rl,!1],null),"x-scroll-timeline-autoplay-resume",
|
|
48
|
+
new $APP.Q(null,2,[$APP.V,new $APP.Q(null,3,[$APP.Il,$APP.W,$APP.hk,$APP.W,$APP.ml,$APP.Y],null),$APP.Rl,!1],null)]);var wx=new $APP.S(null,new $APP.Q(null,3,["right",null,"left",null,"alternating",null],null),null),yx=new $APP.S(null,new $APP.Q(null,2,["curved",null,"straight",null],null),null),xx=new $APP.S(null,new $APP.Q(null,3,["ring",null,"none",null,"dot",null],null),null);$APP.ha("baredom.exports.x_scroll_timeline.init",my);export const init=my;
|
package/dist/x-scroll.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
$APP.M(a);a=$APP.D(c,$APP.
|
|
2
|
+
var Q3=function(a){return a==null?!0:$APP.N((""+$APP.T.g(a)).trim().toLowerCase(),"false")},R3=function(a,b){if(typeof a==="string"){a=parseInt(a.trim(),10);var c=isNaN(a);return $APP.n($APP.n(c)?c:a<0)?b:a}return b},S3=function(a,b){return $APP.n(a)?b>=3:a},T3=function(a,b,c,d){a+=b;return $APP.n(S3(d,c))?c<=0?0:$APP.fd($APP.fd(a,c)+c,c):c<=0?0:$APP.nh.i(0,$APP.oh.i(a,c-1))},U3=function(a,b){var c=$APP.M(a);a=$APP.D(c,$APP.Wj);c=$APP.D(c,$APP.cl);return $APP.n(S3(c,b))?b>0:a>0},V3=function(a,b){var c=
|
|
3
|
+
$APP.M(a);a=$APP.D(c,$APP.Wj);c=$APP.D(c,$APP.cl);return $APP.n(S3(c,b))?b>0:a<b-1},X3=function(a){var b=$APP.k(a,"__xScrollRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("div"),g=document.createElement("slot"),h=document.createElement("button"),l=document.createElement("button"),m=document.createElement("div"),p=document.createElement("div");c.textContent=":host{display:block;position:relative;overflow:hidden;color-scheme:light dark;--x-scroll-gap:0px;--x-scroll-padding:0px;--x-scroll-border-radius:0px;--x-scroll-bg:transparent;--x-scroll-control-size:36px;--x-scroll-control-bg:var(--x-color-bg,rgba(255,255,255,0.9));--x-scroll-control-color:var(--x-color-text,rgba(0,0,0,0.7));--x-scroll-control-hover-bg:var(--x-color-bg,rgba(255,255,255,1));--x-scroll-control-border-radius:50%;--x-scroll-control-shadow:var(--x-shadow-md,0 2px 8px rgba(0,0,0,.15));--x-scroll-indicator-size:8px;--x-scroll-indicator-gap:6px;--x-scroll-indicator-color:var(--x-color-text-muted,rgba(0,0,0,0.25));--x-scroll-indicator-active-color:var(--x-color-text,rgba(0,0,0,0.7));--x-scroll-transition-duration:var(--x-transition-duration,300ms);--x-scroll-slide-size:100%;--x-scroll-disabled-opacity:0.55;--x-scroll-focus-ring:var(--x-color-focus-ring,rgba(0,102,204,0.6));}@media (prefers-color-scheme:dark){:host{--x-scroll-control-bg:var(--x-color-bg,rgba(40,40,40,0.9));--x-scroll-control-color:var(--x-color-text,rgba(255,255,255,0.8));--x-scroll-control-hover-bg:var(--x-color-bg,rgba(50,50,50,1));--x-scroll-control-shadow:var(--x-shadow-md,0 2px 8px rgba(0,0,0,.4));--x-scroll-indicator-color:var(--x-color-text-muted,rgba(255,255,255,0.3));--x-scroll-indicator-active-color:var(--x-color-text,rgba(255,255,255,0.8));--x-scroll-focus-ring:var(--x-color-focus-ring,rgba(100,180,255,0.7));}}[part\x3dviewport]{position:relative;overflow:hidden;width:100%;height:100%;border-radius:var(--x-scroll-border-radius);background:var(--x-scroll-bg);padding:var(--x-scroll-padding);}[part\x3dtrack]{display:flex;position:relative;will-change:transform;transition:transform var(--x-scroll-transition-duration) cubic-bezier(0.25,0.1,0.25,1);touch-action:none;user-select:none;}:host([data-mode\x3dhorizontal]) [part\x3dtrack]{flex-direction:row;}:host([data-mode\x3dvertical]) [part\x3dtrack]{flex-direction:column;}::slotted(*){flex:0 0 var(--x-scroll-slide-size);min-width:0;min-height:0;box-sizing:border-box;}[part\x3dprev],[part\x3dnext]{position:absolute;top:50%;z-index:2;appearance:none;border:0;margin:0;padding:0;width:var(--x-scroll-control-size);height:var(--x-scroll-control-size);border-radius:var(--x-scroll-control-border-radius);background:var(--x-scroll-control-bg);color:var(--x-scroll-control-color);box-shadow:var(--x-scroll-control-shadow);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:calc(var(--x-scroll-control-size) * 0.5);line-height:1;transform:translateY(-50%);transition:background 120ms ease,opacity 120ms ease;}[part\x3dprev]{left:8px;}[part\x3dnext]{right:8px;}:host([data-mode\x3dvertical]) [part\x3dprev],:host([data-mode\x3dvertical]) [part\x3dnext]{top:auto;left:50%;transform:translateX(-50%);}:host([data-mode\x3dvertical]) [part\x3dprev]{top:8px;}:host([data-mode\x3dvertical]) [part\x3dnext]{bottom:8px;top:auto;}[part\x3dprev]:hover,[part\x3dnext]:hover{background:var(--x-scroll-control-hover-bg);}[part\x3dprev]:focus,[part\x3dnext]:focus{outline:none;}[part\x3dprev]:focus-visible,[part\x3dnext]:focus-visible{outline:2px solid var(--x-scroll-focus-ring);outline-offset:2px;}[part\x3dprev]:disabled,[part\x3dnext]:disabled{opacity:0.3;cursor:default;pointer-events:none;}[data-hide-controls] [part\x3dprev],[data-hide-controls] [part\x3dnext]{display:none;}[part\x3dindicators]{display:flex;justify-content:center;gap:var(--x-scroll-indicator-gap);position:absolute;bottom:12px;left:50%;transform:translateX(-50%);z-index:2;}:host([data-mode\x3dvertical]) [part\x3dindicators]{flex-direction:column;bottom:auto;left:auto;right:12px;top:50%;transform:translateY(-50%);}[part\x3dindicator]{appearance:none;border:0;margin:0;padding:0;width:var(--x-scroll-indicator-size);height:var(--x-scroll-indicator-size);border-radius:50%;background:var(--x-scroll-indicator-color);cursor:pointer;transition:background 120ms ease;}[part\x3dindicator]:focus{outline:none;}[part\x3dindicator]:focus-visible{outline:2px solid var(--x-scroll-focus-ring);outline-offset:2px;}[part\x3dindicator][aria-selected\x3dtrue]{background:var(--x-scroll-indicator-active-color);}[part\x3dlive]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;}:host([disabled]){opacity:var(--x-scroll-disabled-opacity);pointer-events:none;}@media (prefers-reduced-motion:reduce){[part\x3dtrack]{transition:none !important;}}";
|
|
4
4
|
d.setAttribute("part","viewport");d.setAttribute("role","region");d.setAttribute("aria-roledescription","carousel");e.setAttribute("part","track");e.appendChild(g);d.appendChild(e);h.setAttribute("part","prev");h.setAttribute("type","button");h.setAttribute("aria-label","Previous slide");h.textContent="‹";l.setAttribute("part","next");l.setAttribute("type","button");l.setAttribute("aria-label","Next slide");l.textContent="›";m.setAttribute("part","indicators");m.setAttribute("role","tablist");m.setAttribute("aria-label",
|
|
5
|
-
"Slide indicators");p.setAttribute("part","live");p.setAttribute("aria-live","polite");p.setAttribute("aria-atomic","true");b.appendChild(c);b.appendChild(d);b.appendChild(h);b.appendChild(l);b.appendChild(m);b.appendChild(p);a.__xScrollRefs=new $APP.
|
|
6
|
-
$APP.n(a.hasAttribute("auto-play"))?"":null,a.getAttribute("mode"),$APP.n(a.hasAttribute("loop"))?"":null,a.getAttribute("gap"),$APP.n(a.hasAttribute("show-indicators"))?"":null,a.getAttribute("interval"),$APP.n(a.hasAttribute("disabled"))?"":null,a.getAttribute("snap"),a.getAttribute("active-index")]);var b=$APP.M(a),c=$APP.D(b,
|
|
7
|
-
b=$APP.D(b,
|
|
8
|
-
|
|
9
|
-
"translateY("+$APP.T.g(-a)+"px)"},
|
|
10
|
-
"",a+=1;else break;a=m*(h+l)-d;return
|
|
11
|
-
g)?(g.removeEventListener("transitionend",A),g.style.transition="none",
|
|
12
|
-
l.addEventListener("click",function(m){return function(){return d.g?d.g(m):d.call(null,m)}}(h,l,b,a,e,g,g));g.appendChild(l);h+=1}else break},
|
|
13
|
-
$APP.n(b)&&(clearInterval(b),a.__xScrollAutoplayTid=null);return null},
|
|
14
|
-
g:
|
|
15
|
-
$APP.k(a,"__xScrollChildCount");return $APP.n(v)?v:
|
|
16
|
-
d=$APP.
|
|
17
|
-
function y(x){return $APP.C.i(x.target,q)?(q.removeEventListener("transitionend",y),
|
|
18
|
-
c=function(){var d=$APP.k(a,"__xScrollChildCount");return $APP.n(d)?d:
|
|
19
|
-
p);return
|
|
20
|
-
($APP.n(d)?$APP.k(c,"startX"):$APP.k(c,"startY"));$APP.r($APP.k(c,"isDragging"))&&Math.abs(e)>3&&(c.isDragging=!0);if($APP.n($APP.k(c,"isDragging"))){c.lastX=b.clientX;c.lastY=b.clientY;$APP.
|
|
21
|
-
c);g=
|
|
22
|
-
"startX"):$APP.k(c,"startY"));c=Date.now()-$APP.k(c,"lastTime");var e=c>0?Math.abs(b)/c:0;c=function(){var l=$APP.k(a,"__xScrollModel");return $APP.n(l)?l:
|
|
23
|
-
e:
|
|
24
|
-
h:
|
|
25
|
-
1)+" of "+$APP.T.g(c));return
|
|
26
|
-
p);a.addEventListener("keydown",m);x.addEventListener("pointerdown",l);A.addEventListener("slotchange",h);document.addEventListener("visibilitychange",g);a.addEventListener("pointerenter",e);a.addEventListener("pointerleave",d);a.addEventListener("focusin",c);a.addEventListener("focusout",b);$APP.
|
|
27
|
-
c:b)){var d=$APP.
|
|
28
|
-
c),a.__xScrollDragState=null);c=$APP.k(b,"slot");$APP.n(c)&&g.removeEventListener("slotchange",c);g=$APP.k(b,"vis");$APP.n(g)&&document.removeEventListener("visibilitychange",g);g=$APP.k(b,"enter");$APP.n(g)&&a.removeEventListener("pointerenter",g);g=$APP.k(b,"leave");$APP.n(g)&&a.removeEventListener("pointerleave",g);g=$APP.k(b,"focusin");$APP.n(g)&&a.removeEventListener("focusin",g);b=$APP.k(b,"focusout");$APP.n(b)&&a.removeEventListener("focusout",b)}a.__xScrollHandlers=null},
|
|
29
|
-
$APP.k(a,"__xScrollResizeObs");$APP.n(b)&&b.disconnect();b=
|
|
30
|
-
m=$APP.D(m,$APP.
|
|
31
|
-
"Slide "+$APP.T.g(l+1)+" of "+$APP.T.g(x));
|
|
5
|
+
"Slide indicators");p.setAttribute("part","live");p.setAttribute("aria-live","polite");p.setAttribute("aria-atomic","true");b.appendChild(c);b.appendChild(d);b.appendChild(h);b.appendChild(l);b.appendChild(m);b.appendChild(p);a.__xScrollRefs=new $APP.Q(null,8,[$APP.yi,b,$APP.dj,d,$APP.Vi,e,$APP.bj,g,$APP.Zi,h,$APP.Nh,l,W3,m,$APP.wi,p],null);return $APP.k(a,"__xScrollRefs")},i4=function(a){a=$APP.zf([Y3,$APP.ki,Z3,$APP.dl,$3,$APP.Ni,a4,$APP.ai,$APP.Wi,b4,$APP.Wk],[a.getAttribute("show-controls"),a.getAttribute("label"),
|
|
6
|
+
$APP.n(a.hasAttribute("auto-play"))?"":null,a.getAttribute("mode"),$APP.n(a.hasAttribute("loop"))?"":null,a.getAttribute("gap"),$APP.n(a.hasAttribute("show-indicators"))?"":null,a.getAttribute("interval"),$APP.n(a.hasAttribute("disabled"))?"":null,a.getAttribute("snap"),a.getAttribute("active-index")]);var b=$APP.M(a),c=$APP.D(b,b4);a=$APP.D(b,$APP.ai);var d=$APP.D(b,$APP.Wi),e=$APP.D(b,$APP.Wk),g=$APP.D(b,Y3),h=$APP.D(b,$APP.ki),l=$APP.D(b,Z3),m=$APP.D(b,$APP.dl),p=$APP.D(b,$3),q=$APP.D(b,$APP.Ni);
|
|
7
|
+
b=$APP.D(b,a4);e=R3(e,0);g=Q3(g);c=typeof c==="string"?c.trim().toLowerCase():null;c=$APP.I(c4,c)?c:"none";m=typeof m==="string"?m.trim().toLowerCase():null;m=$APP.I(d4,m)?m:"horizontal";return $APP.zf([$APP.Wj,e4,f4,$APP.mj,g4,h4,$APP.U,$APP.Rj,$APP.cl,$APP.Hk,$APP.X],[e,g,c,m,b!=null,l!=null,$APP.n(h)?h:"",R3(q,0),p!=null,$APP.nh.i(500,R3(a,5E3)),d!=null])},j4=function(a){a=X3(a);a=$APP.M(a);return $APP.D(a,$APP.bj).assignedElements()},k4=function(){return $APP.F(window.matchMedia("(prefers-reduced-motion:reduce)").matches)},
|
|
8
|
+
l4=function(a){return $APP.C.i("horizontal",$APP.mj.g(a))},m4=function(a,b){a=j4(a);return a.length>0?(a=a[0].getBoundingClientRect(),l4(b)?a.width:a.height):0},n4=function(a,b){return a.style.transform=b},o4=function(a,b){a=a.getBoundingClientRect();return $APP.C.i("horizontal",$APP.mj.g(b))?a.width:a.height},p4=function(a,b,c){switch(a){case "center":return(b-c)/2;case "end":return b-c;default:return 0}},q4=function(a,b,c,d,e){a=$APP.gd(a)*(b+c)-d;return $APP.n(e)?"translateX("+$APP.T.g(-a)+"px)":
|
|
9
|
+
"translateY("+$APP.T.g(-a)+"px)"},r4=function(a,b,c){for(var d=0;;)if(d<b){var e=$APP.gd(b);a[d].style.order=""+$APP.T.g($APP.fd(d-c+e+b,b)-e);d+=1}else break},s4=function(a,b){var c=X3(a);c=$APP.M(c);var d=$APP.D(c,$APP.dj);c=$APP.D(c,$APP.Vi);var e=j4(a),g=e.length,h=m4(a,b),l=$APP.Rj.g(b),m=$APP.Wj.g(b),p=S3($APP.cl.g(b),g);d=o4(d,b);d=p4(f4.g(b),d,h);a.__xScrollChildCount=g;if(g>0){c.style.gap=""+$APP.T.g(l)+"px";if($APP.n(p))return r4(e,g,m),n4(c,q4(g,h,l,d,l4(b)));for(a=0;;)if(a<g)e[a].style.order=
|
|
10
|
+
"",a+=1;else break;a=m*(h+l)-d;return n4(c,l4(b)?"translateX("+$APP.T.g(-a)+"px)":"translateY("+$APP.T.g(-a)+"px)")}return null},t4=function(a,b,c){var d=X3(a);d=$APP.M(d);var e=$APP.D(d,$APP.dj),g=$APP.D(d,$APP.Vi),h=j4(a),l=h.length,m=m4(a,b),p=$APP.Rj.g(b),q=l4(b);a=o4(e,b);var v=p4(f4.g(b),a,m);c=-($APP.gd(l)*(m+p)-v+c*(m+p));n4(g,q?"translateX("+$APP.T.g(c)+"px)":"translateY("+$APP.T.g(c)+"px)");k4()?(r4(h,l,$APP.Wj.g(b)),n4(g,q4(l,m,p,v,q))):g.addEventListener("transitionend",function A(y){return $APP.C.i(y.target,
|
|
11
|
+
g)?(g.removeEventListener("transitionend",A),g.style.transition="none",r4(h,l,$APP.Wj.g(b)),n4(g,q4(l,m,p,v,q)),g.offsetHeight,g.style.transition=""):null})},u4=function(a,b,c,d){a=X3(a);var e=$APP.M(a),g=$APP.D(e,W3);g.innerHTML="";for(var h=0;;)if(h<b){var l=document.createElement("button");l.setAttribute("part","indicator");l.setAttribute("type","button");l.setAttribute("role","tab");l.setAttribute("aria-label","Slide "+$APP.T.g(h+1));l.setAttribute("aria-selected",""+$APP.T.g($APP.C.i(h,c)));
|
|
12
|
+
l.addEventListener("click",function(m){return function(){return d.g?d.g(m):d.call(null,m)}}(h,l,b,a,e,g,g));g.appendChild(l);h+=1}else break},v4=function(a,b){a=X3(a);a=$APP.M(a);a=$APP.D(a,W3).children;for(var c=a.length,d=0;;)if(d<c)a[d].setAttribute("aria-selected",""+$APP.T.g($APP.C.i(d,b))),d+=1;else break},w4=function(a,b,c,d){b=new CustomEvent(b,{detail:$APP.Dh(c),bubbles:!0,composed:!0,cancelable:$APP.F(d)});return a.dispatchEvent(b)},x4=function(a){var b=$APP.k(a,"__xScrollAutoplayTid");
|
|
13
|
+
$APP.n(b)&&(clearInterval(b),a.__xScrollAutoplayTid=null);return null},A4=function(a){x4(a);var b=function(){var c=$APP.k(a,"__xScrollModel");return $APP.n(c)?c:i4(a)}();$APP.n(function(){var c=h4.g(b);return $APP.n(c)?$APP.r($APP.X.g(b)):c}())&&$APP.ja(a,"__xScrollAutoplayTid",setInterval(function(){if($APP.n(a.isConnected)){var c=j4(a).length;if(c>0){var d=$APP.Wj.g(function(){var g=$APP.k(a,"__xScrollModel");return $APP.n(g)?g:i4(a)}()),e=function(){var g=$APP.k(a,"__xScrollModel");return $APP.n(g)?
|
|
14
|
+
g:i4(a)}();c=T3(d,1,c,$APP.cl.g(e));return $APP.N(d,c)?y4?y4(a,c,1):z4.call(null,a,c,1):null}}return null},$APP.Hk.g(b)));return null},B4=function(a){x4(a);return A4(a)},z4=function(a){switch(arguments.length){case 2:return y4(arguments[0],arguments[1],null);case 3:return y4(arguments[0],arguments[1],arguments[2]);default:throw Error(["Invalid arity: ",arguments.length].join(""));}},y4=function(a,b,c){var d=function(){var v=$APP.k(a,"__xScrollModel");return $APP.n(v)?v:i4(a)}(),e=function(){var v=
|
|
15
|
+
$APP.k(a,"__xScrollChildCount");return $APP.n(v)?v:j4(a).length}(),g=$APP.Wj.g(d);if(e>0&&$APP.r($APP.X.g(d))){var h=S3($APP.cl.g(d),e),l=$APP.n(h)?e<=0?0:$APP.fd($APP.fd(b,e)+e,e):e<=0?0:$APP.nh.i(0,$APP.oh.i(b,e-1));b=l-g;if($APP.N(l,g)){c=$APP.n(c)?c:b>0?1:-1;var m=e>0&&(c>0&&l<g||c<0&&l>g),p=c>0?"forward":"backward";if($APP.n(function(){var v=!m;return v?v:w4(a,"x-scroll-loop",new $APP.Q(null,1,[$APP.jj,p],null),!0)}())){w4(a,"x-scroll-start",new $APP.Q(null,2,[$APP.jj,p,$APP.hk,g],null),!1);
|
|
16
|
+
d=$APP.lh.m(d,$APP.Wj,l);a.__xScrollModel=d;a.setAttribute("active-index",""+$APP.T.g(l));$APP.n(h)?t4(a,d,c):s4(a,d);v4(a,l);h=X3(a);b=$APP.M(h);h=$APP.D(b,$APP.Zi);c=$APP.D(b,$APP.Nh);b=$APP.D(b,$APP.wi);h.disabled=!U3(d,e);c.disabled=!V3(d,e);b.textContent="Slide "+$APP.T.g(l+1)+" of "+$APP.T.g(e);w4(a,"x-scroll-change",new $APP.Q(null,2,[$APP.hk,l,$APP.Tj,g],null),!1);if(k4())w4(a,"x-scroll-end",new $APP.Q(null,1,[$APP.hk,l],null),!1);else{e=X3(a);e=$APP.M(e);var q=$APP.D(e,$APP.Vi);q.addEventListener("transitionend",
|
|
17
|
+
function y(x){return $APP.C.i(x.target,q)?(q.removeEventListener("transitionend",y),w4(a,"x-scroll-end",new $APP.Q(null,1,[$APP.hk,l],null),!1)):null})}return B4(a)}}}return null},C4=function(a){var b=function(){var d=$APP.k(a,"__xScrollModel");return $APP.n(d)?d:i4(a)}(),c=function(){var d=$APP.k(a,"__xScrollChildCount");return $APP.n(d)?d:j4(a).length}();b=T3($APP.Wj.g(b),1,c,$APP.cl.g(b));return y4(a,b,1)},D4=function(a){var b=function(){var d=$APP.k(a,"__xScrollModel");return $APP.n(d)?d:i4(a)}(),
|
|
18
|
+
c=function(){var d=$APP.k(a,"__xScrollChildCount");return $APP.n(d)?d:j4(a).length}();b=T3($APP.Wj.g(b),-1,c,$APP.cl.g(b));return y4(a,b,-1)},G4=function(a,b){function c(l){return E4.i?E4.i(a,l):E4.call(null,a,l)}var d=function(){var l=$APP.k(a,"__xScrollModel");return $APP.n(l)?l:i4(a)}();if($APP.n($APP.X.g(d)))return null;var e=X3(a);e=$APP.M(e);e=$APP.D(e,$APP.Vi);var g=l4(d);e.style.transition="none";x4(a);var h=function p(m){window.removeEventListener("pointermove",c);window.removeEventListener("pointerup",
|
|
19
|
+
p);return F4.i?F4.i(a,m):F4.call(null,a,m)};window.addEventListener("pointermove",c);window.addEventListener("pointerup",h);return $APP.ja(a,"__xScrollDragState",function(){var m={};m.startX=b.clientX;m.startTime=Date.now();m.startY=b.clientY;m.upH=h;m.moveH=c;m.isDragging=!1;m.lastY=b.clientY;m.lastTime=Date.now();m.horiz=g;m.lastX=b.clientX;return m}())},E4=function(a,b){var c=$APP.k(a,"__xScrollDragState");if($APP.n(c)){b.preventDefault();var d=$APP.k(c,"horiz"),e=($APP.n(d)?b.clientX:b.clientY)-
|
|
20
|
+
($APP.n(d)?$APP.k(c,"startX"):$APP.k(c,"startY"));$APP.r($APP.k(c,"isDragging"))&&Math.abs(e)>3&&(c.isDragging=!0);if($APP.n($APP.k(c,"isDragging"))){c.lastX=b.clientX;c.lastY=b.clientY;$APP.ja(c,"lastTime",Date.now());b=X3(a);b=$APP.M(b);var g=$APP.D(b,$APP.dj);b=$APP.D(b,$APP.Vi);var h=function(){var v=$APP.k(a,"__xScrollModel");return $APP.n(v)?v:i4(a)}(),l=m4(a,h),m=$APP.Rj.g(h);c=function(){var v=$APP.k(a,"__xScrollChildCount");return $APP.n(v)?v:j4(a).length}();var p=$APP.Wj.g(h),q=S3($APP.cl.g(h),
|
|
21
|
+
c);g=o4(g,h);g=p4(f4.g(h),g,l);l=($APP.n(q)?$APP.gd(c)*(l+m):p*(l+m))-g;e=($APP.r(q)&&(e<0&&$APP.C.i(p,c-1)||e>0&&$APP.C.i(p,0))?e*.3:e)-l;return n4(b,$APP.n(d)?"translateX("+$APP.T.g(e)+"px)":"translateY("+$APP.T.g(e)+"px)")}}return null},F4=function(a,b){var c=$APP.k(a,"__xScrollDragState");if($APP.n(c)){a.__xScrollDragState=null;var d=X3(a);d=$APP.M(d);$APP.D(d,$APP.Vi).style.transition="";if($APP.n($APP.k(c,"isDragging"))){d=$APP.k(c,"horiz");b=($APP.n(d)?b.clientX:b.clientY)-($APP.n(d)?$APP.k(c,
|
|
22
|
+
"startX"):$APP.k(c,"startY"));c=Date.now()-$APP.k(c,"lastTime");var e=c>0?Math.abs(b)/c:0;c=function(){var l=$APP.k(a,"__xScrollModel");return $APP.n(l)?l:i4(a)}();var g=m4(a,c),h=function(){var l=$APP.k(a,"__xScrollChildCount");return $APP.n(l)?l:j4(a).length}();d=$APP.Wj.g(c);e=e>.5?b<0?1:-1:Math.abs(b)>.5*g?b<0?1:-1:0;h=e===0?d:T3(d,e,h,$APP.cl.g(c));$APP.C.i(h,d)?s4(a,c):y4(a,h,b<0?1:-1);return B4(a)}}return null},H4=function(a,b){var c=function(){var e=$APP.k(a,"__xScrollModel");return $APP.n(e)?
|
|
23
|
+
e:i4(a)}();if($APP.n($APP.X.g(c)))return null;var d=b.key;(c=l4(c))&&$APP.C.i(d,"ArrowLeft")?(D4(a),d=!0):c&&$APP.C.i(d,"ArrowRight")?(C4(a),d=!0):!c&&$APP.C.i(d,"ArrowUp")?(D4(a),d=!0):!c&&$APP.C.i(d,"ArrowDown")?(C4(a),d=!0):$APP.C.i(d,"Home")?(y4(a,0,null),d=!0):d=$APP.C.i(d,"End")&&function(){var e=$APP.k(a,"__xScrollChildCount");e=$APP.n(e)?e:j4(a).length;y4(a,e-1,null);return!0}();return d?b.preventDefault():null},I4=function(a){var b=function(){var h=$APP.k(a,"__xScrollModel");return $APP.n(h)?
|
|
24
|
+
h:i4(a)}(),c=j4(a).length;a.__xScrollChildCount=c;if(c>0&&$APP.Wj.g(b)>=c){var d=c-1;a.setAttribute("active-index",""+$APP.T.g(d));$APP.ja(a,"__xScrollModel",$APP.lh.m(b,$APP.Wj,d))}b=function(){var h=$APP.k(a,"__xScrollModel");return $APP.n(h)?h:i4(a)}();d=X3(a);var e=$APP.M(d);d=$APP.D(e,$APP.Zi);var g=$APP.D(e,$APP.Nh);e=$APP.D(e,$APP.wi);$APP.n(g4.g(b))&&u4(a,c,$APP.Wj.g(b),function(h){return y4(a,h,null)});d.disabled=!U3(b,c);g.disabled=!V3(b,c);c>0&&(e.textContent="Slide "+$APP.T.g($APP.Wj.g(b)+
|
|
25
|
+
1)+" of "+$APP.T.g(c));return s4(a,b)},J4=function(a){function b(){return B4(a)}function c(){return x4(a)}function d(){return B4(a)}function e(){return x4(a)}function g(){return $APP.n(document.hidden)?x4(a):B4(a)}function h(){return I4(a)}function l(B){return G4(a,B)}function m(B){return H4(a,B)}function p(){return C4(a)}function q(){return D4(a)}var v=X3(a),x=$APP.M(v);v=$APP.D(x,$APP.Zi);var y=$APP.D(x,$APP.Nh),A=$APP.D(x,$APP.bj);x=$APP.D(x,$APP.dj);v.addEventListener("click",q);y.addEventListener("click",
|
|
26
|
+
p);a.addEventListener("keydown",m);x.addEventListener("pointerdown",l);A.addEventListener("slotchange",h);document.addEventListener("visibilitychange",g);a.addEventListener("pointerenter",e);a.addEventListener("pointerleave",d);a.addEventListener("focusin",c);a.addEventListener("focusout",b);$APP.ja(a,"__xScrollHandlers",{slot:h,focusin:c,keydown:m,vis:g,enter:e,next:p,leave:d,prev:q,pdown:l,focusout:b})},K4=function(a){x4(a);var b=$APP.k(a,"__xScrollHandlers"),c=$APP.k(a,"__xScrollRefs");if($APP.n($APP.n(b)?
|
|
27
|
+
c:b)){var d=$APP.Zi.g(c),e=$APP.Nh.g(c),g=$APP.bj.g(c);c=$APP.dj.g(c);var h=$APP.k(b,"prev");$APP.n(h)&&d.removeEventListener("click",h);d=$APP.k(b,"next");$APP.n(d)&&e.removeEventListener("click",d);e=$APP.k(b,"keydown");$APP.n(e)&&a.removeEventListener("keydown",e);e=$APP.k(b,"pdown");$APP.n(e)&&c.removeEventListener("pointerdown",e);c=$APP.k(a,"__xScrollDragState");$APP.n(c)&&(e=$APP.k(c,"moveH"),$APP.n(e)&&window.removeEventListener("pointermove",e),c=$APP.k(c,"upH"),$APP.n(c)&&window.removeEventListener("pointerup",
|
|
28
|
+
c),a.__xScrollDragState=null);c=$APP.k(b,"slot");$APP.n(c)&&g.removeEventListener("slotchange",c);g=$APP.k(b,"vis");$APP.n(g)&&document.removeEventListener("visibilitychange",g);g=$APP.k(b,"enter");$APP.n(g)&&a.removeEventListener("pointerenter",g);g=$APP.k(b,"leave");$APP.n(g)&&a.removeEventListener("pointerleave",g);g=$APP.k(b,"focusin");$APP.n(g)&&a.removeEventListener("focusin",g);b=$APP.k(b,"focusout");$APP.n(b)&&a.removeEventListener("focusout",b)}a.__xScrollHandlers=null},L4=function(a){var b=
|
|
29
|
+
$APP.k(a,"__xScrollResizeObs");$APP.n(b)&&b.disconnect();b=X3(a);b=$APP.M(b);b=$APP.D(b,$APP.dj);var c=new ResizeObserver(function(){if($APP.n(a.isConnected)){var d=$APP.k(a,"__xScrollModel");d=$APP.n(d)?d:i4(a);return s4(a,d)}return null});c.observe(b);a.__xScrollResizeObs=c},M4=function(a,b){b=$APP.M(b);var c=$APP.D(b,$APP.mj),d=$APP.D(b,e4),e=$APP.D(b,g4),g=$APP.D(b,$APP.X),h=$APP.D(b,$APP.U),l=$APP.D(b,$APP.Wj),m=X3(a);m=$APP.M(m);var p=$APP.D(m,$APP.dj),q=$APP.D(m,$APP.Zi),v=$APP.D(m,$APP.Nh);
|
|
30
|
+
m=$APP.D(m,$APP.wi);var x=function(){var y=$APP.k(a,"__xScrollChildCount");return $APP.n(y)?y:j4(a).length}();a.setAttribute("data-mode",c);$APP.n(d)?a.removeAttribute("data-hide-controls"):a.setAttribute("data-hide-controls","");$APP.t(h)?p.setAttribute("aria-label",h):p.removeAttribute("aria-label");q.disabled=!U3(b,x);v.disabled=!V3(b,x);a.tabIndex=$APP.n(g)?-1:0;$APP.n(e)&&u4(a,x,l,function(y){return y4(a,y,null)});$APP.n(e)||(c=X3(a),c=$APP.M(c),$APP.D(c,W3).innerHTML="");x>0&&(m.textContent=
|
|
31
|
+
"Slide "+$APP.T.g(l+1)+" of "+$APP.T.g(x));s4(a,b);a.__xScrollModel=b},N4=function(a){var b=i4(a);$APP.N($APP.k(a,"__xScrollModel"),b)&&M4(a,b)},O4=function(a){Object.defineProperty(a,"mode",{get:function(){var b=this.getAttribute("mode");return $APP.n(b)?b:"horizontal"},set:function(b){return $APP.n(b)?this.setAttribute("mode",""+$APP.T.g(b)):this.removeAttribute("mode")},enumerable:!0,configurable:!0});Object.defineProperty(a,"snap",{get:function(){var b=this.getAttribute("snap");return $APP.n(b)?
|
|
32
32
|
b:"none"},set:function(b){return $APP.n(b)?this.setAttribute("snap",""+$APP.T.g(b)):this.removeAttribute("snap")},enumerable:!0,configurable:!0});Object.defineProperty(a,"loop",{get:function(){return this.hasAttribute("loop")},set:function(b){return $APP.n(b)?this.setAttribute("loop",""):this.removeAttribute("loop")},enumerable:!0,configurable:!0});Object.defineProperty(a,"autoPlay",{get:function(){return this.hasAttribute("auto-play")},set:function(b){return $APP.n(b)?this.setAttribute("auto-play",
|
|
33
|
-
""):this.removeAttribute("auto-play")},enumerable:!0,configurable:!0});Object.defineProperty(a,"interval",{get:function(){var b=this.getAttribute("interval");return $APP
|
|
34
|
-
this.setAttribute("show-controls","false")},enumerable:!0,configurable:!0});Object.defineProperty(a,"showIndicators",{get:function(){return this.hasAttribute("show-indicators")},set:function(b){return $APP.n(b)?this.setAttribute("show-indicators",""):this.removeAttribute("show-indicators")},enumerable:!0,configurable:!0});Object.defineProperty(a,"activeIndex",{get:function(){var b=this.getAttribute("active-index");return
|
|
35
|
-
this.setAttribute("active-index",""+$APP.T.g(b|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"gap",{get:function(){var b=this.getAttribute("gap");return
|
|
36
|
-
configurable:!0});Object.defineProperty(a,"label",{get:function(){var b=this.getAttribute("label");return $APP.n(b)?b:""},set:function(b){return $APP.n($APP.n(b)?$APP.N(b,""):b)?this.setAttribute("label",""+$APP.T.g(b)):this.removeAttribute("label")},enumerable:!0,configurable:!0})},
|
|
37
|
-
var c=$APP.k(this,"__xScrollResizeObs");$APP.n(c)&&(c.disconnect(),this.__xScrollResizeObs=null);c=
|
|
38
|
-
b.prev=function(){return
|
|
39
|
-
-894641087)
|
|
40
|
-
$APP.
|
|
41
|
-
$APP.
|
|
42
|
-
$APP.
|
|
43
|
-
var
|
|
33
|
+
""):this.removeAttribute("auto-play")},enumerable:!0,configurable:!0});Object.defineProperty(a,"interval",{get:function(){var b=this.getAttribute("interval");return $APP.nh.i(500,R3(b,5E3))},set:function(b){return b==null?this.removeAttribute("interval"):this.setAttribute("interval",""+$APP.T.g(b|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"showControls",{get:function(){return Q3(this.getAttribute("show-controls"))},set:function(b){return $APP.n(b)?this.removeAttribute("show-controls"):
|
|
34
|
+
this.setAttribute("show-controls","false")},enumerable:!0,configurable:!0});Object.defineProperty(a,"showIndicators",{get:function(){return this.hasAttribute("show-indicators")},set:function(b){return $APP.n(b)?this.setAttribute("show-indicators",""):this.removeAttribute("show-indicators")},enumerable:!0,configurable:!0});Object.defineProperty(a,"activeIndex",{get:function(){var b=this.getAttribute("active-index");return R3(b,0)},set:function(b){return b==null?this.removeAttribute("active-index"):
|
|
35
|
+
this.setAttribute("active-index",""+$APP.T.g(b|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"gap",{get:function(){var b=this.getAttribute("gap");return R3(b,0)},set:function(b){return b==null?this.removeAttribute("gap"):this.setAttribute("gap",""+$APP.T.g(b|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"disabled",{get:function(){return this.hasAttribute("disabled")},set:function(b){return $APP.n(b)?this.setAttribute("disabled",""):this.removeAttribute("disabled")},enumerable:!0,
|
|
36
|
+
configurable:!0});Object.defineProperty(a,"label",{get:function(){var b=this.getAttribute("label");return $APP.n(b)?b:""},set:function(b){return $APP.n($APP.n(b)?$APP.N(b,""):b)?this.setAttribute("label",""+$APP.T.g(b)):this.removeAttribute("label")},enumerable:!0,configurable:!0})},Q4=function(){var a=class extends HTMLElement{};a.observedAttributes=P4;a.prototype.connectedCallback=function(){X3(this);K4(this);J4(this);L4(this);N4(this);A4(this);return null};a.prototype.disconnectedCallback=function(){K4(this);
|
|
37
|
+
var c=$APP.k(this,"__xScrollResizeObs");$APP.n(c)&&(c.disconnect(),this.__xScrollResizeObs=null);c=j4(this);for(var d=c.length,e=0;;)if(e<d)c[e].style.order="",e+=1;else break;return null};a.prototype.attributeChangedCallback=function(c,d,e){$APP.N(d,e)&&(N4(this),d=this.isConnected,c=$APP.n(d)?$APP.C.i(c,"auto-play")||$APP.C.i(c,"interval")||$APP.C.i(c,"disabled"):d,$APP.n(c)&&B4(this));return null};var b=a.prototype;O4(b);b.goTo=function(c){return y4(this,c,null)};b.next=function(){return C4(this)};
|
|
38
|
+
b.prev=function(){return D4(this)};return a},R4=function(){$APP.n(customElements.get("x-scroll"))||customElements.define("x-scroll",Q4());return null},f4=new $APP.K(null,"snap","snap",-51714904),b4=new $APP.K(null,"snap-raw","snap-raw",828444409),h4=new $APP.K(null,"auto-play?","auto-play?",385278451),e4=new $APP.K(null,"show-controls?","show-controls?",1318868354),a4=new $APP.K(null,"show-indicators-attr","show-indicators-attr",1148535895),Y3=new $APP.K(null,"show-controls-attr","show-controls-attr",
|
|
39
|
+
-894641087),$3=new $APP.K(null,"loop-attr","loop-attr",-132212822),Z3=new $APP.K(null,"auto-play-attr","auto-play-attr",329299716),g4=new $APP.K(null,"show-indicators?","show-indicators?",-370587412),W3=new $APP.K(null,"indicators","indicators",1312373003);var P4="mode snap loop auto-play interval show-controls show-indicators active-index gap disabled label".split(" ");
|
|
40
|
+
$APP.zf([$APP.Fj,new $APP.K(null,"showIndicators","showIndicators",1780978055),f4,$APP.hk,$APP.mj,new $APP.K(null,"showControls","showControls",1591218925),$APP.nm,$APP.U,$APP.Rj,new $APP.K(null,"autoPlay","autoPlay",-561263241),$APP.Hk],[new $APP.Q(null,1,[$APP.Z,$APP.Sj],null),new $APP.Q(null,1,[$APP.Z,$APP.Sj],null),new $APP.Q(null,1,[$APP.Z,$APP.Y],null),new $APP.Q(null,1,[$APP.Z,$APP.W],null),new $APP.Q(null,1,[$APP.Z,$APP.Y],null),new $APP.Q(null,1,[$APP.Z,$APP.Sj],null),new $APP.Q(null,1,[$APP.Z,
|
|
41
|
+
$APP.Sj],null),new $APP.Q(null,1,[$APP.Z,$APP.Y],null),new $APP.Q(null,1,[$APP.Z,$APP.W],null),new $APP.Q(null,1,[$APP.Z,$APP.Sj],null),new $APP.Q(null,1,[$APP.Z,$APP.W],null)]);
|
|
42
|
+
$APP.Qd(["x-scroll-change",new $APP.Q(null,2,[$APP.V,new $APP.Q(null,2,[$APP.hk,$APP.W,$APP.Tj,$APP.W],null),$APP.Rl,!1],null),"x-scroll-start",new $APP.Q(null,2,[$APP.V,new $APP.Q(null,2,[$APP.jj,$APP.Y,$APP.hk,$APP.W],null),$APP.Rl,!1],null),"x-scroll-end",new $APP.Q(null,2,[$APP.V,new $APP.Q(null,1,[$APP.hk,$APP.W],null),$APP.Rl,!1],null),"x-scroll-loop",new $APP.Q(null,2,[$APP.V,new $APP.Q(null,1,[$APP.jj,$APP.Y],null),$APP.Rl,!0],null)]);
|
|
43
|
+
var d4=new $APP.S(null,new $APP.Q(null,2,["vertical",null,"horizontal",null],null),null),c4=new $APP.S(null,new $APP.Q(null,4,["none",null,"center",null,"start",null,"end",null],null),null);$APP.ha("baredom.exports.x_scroll.init",R4);export const init=R4;
|
package/dist/x-search-field.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
"input");b=$APP.k(b,"clear");var d=new $APP.
|
|
4
|
-
l:"";m=$APP.n(m)?m:"";p=$APP.F(p);d=$APP.F(d);e=typeof e==="string"&&$APP.
|
|
5
|
-
$APP.k(a,"__xSearchFieldInternals");return $APP.n(b)?
|
|
6
|
-
{name:e,value:d},!1)}return null}},
|
|
7
|
-
b=function(){var d=a.getAttribute("name");return $APP.n(d)?d:""}();return $APP.n(function(){var d=a.hasAttribute("required");return $APP.n(d)?$APP.C.i(c,""):d}())?(b=$APP.k(a,"__xSearchFieldInternals"),$APP.n(b)?b.reportValidity():null):
|
|
8
|
-
"__xSearchFieldInternals");$APP.n(e)&&(e.setFormValue(""),
|
|
9
|
-
"click"));a.__xSearchFieldHandlers=null;return}}return null},
|
|
10
|
-
"value",{configurable:!0,enumerable:!0,get:function(){var b=$APP.k(this,"__xSearchFieldRefs");if($APP.n(b))return $APP.k(b,"input").value;b=this.getAttribute("value");return $APP.n(b)?b:""},set:function(b){b=b!=null&&$APP.N(b)?""+$APP.T.g(b):"";this.setAttribute("value",b);var c=$APP.k(this,"__xSearchFieldRefs");return $APP.n(c)?$APP.k(c,"input").value=b:null}})},
|
|
11
|
-
|
|
2
|
+
var vp=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},wp=function(a,b,c){a=$APP.C.i("",a.value);c=c.hasAttribute("disabled");$APP.n(a?a:c)?b.classList.add("clear-hidden"):b.classList.remove("clear-hidden")},xp=function(a,b,c){a=a.hasAttribute("required");var d=c.value;return $APP.n($APP.n(a)?$APP.C.i(d,""):a)?b.setValidity({valueMissing:!0},"Please fill in this field.",c):b.setValidity({},"",c)},zp=function(a){var b=$APP.k(a,"__xSearchFieldRefs");if($APP.n(b)){var c=$APP.k(b,
|
|
3
|
+
"input");b=$APP.k(b,"clear");var d=new $APP.Q(null,7,[$APP.gl,a.getAttribute("name"),$APP.jm,a.getAttribute("value"),$APP.Gi,a.getAttribute("placeholder"),$APP.ki,a.getAttribute("label"),$APP.ul,a.hasAttribute("disabled"),$APP.Ih,a.hasAttribute("required"),$APP.ji,a.getAttribute("autocomplete")],null);var e=$APP.M(d),g=$APP.D(e,$APP.gl),h=$APP.D(e,$APP.jm),l=$APP.D(e,$APP.Gi),m=$APP.D(e,$APP.ki),p=$APP.D(e,$APP.ul);d=$APP.D(e,$APP.Ih);e=$APP.D(e,$APP.ji);g=$APP.n(g)?g:"";h=$APP.n(h)?h:"";l=$APP.n(l)?
|
|
4
|
+
l:"";m=$APP.n(m)?m:"";p=$APP.F(p);d=$APP.F(d);e=typeof e==="string"&&$APP.I(yp,e)?e:"off";d=new $APP.Q(null,7,[$APP.qj,g,$APP.Pi,h,$APP.Yl,l,$APP.U,m,$APP.X,p,$APP.hi,d,$APP.Gl,e],null);c.name=$APP.qj.g(d);c.placeholder=$APP.Yl.g(d);c.disabled=$APP.X.g(d);c.required=$APP.hi.g(d);c.autocomplete=$APP.Gl.g(d);e=$APP.U.g(d);$APP.n($APP.n(e)?$APP.N(e,""):e)?c.setAttribute("aria-label",e):c.removeAttribute("aria-label");d=$APP.n($APP.hi.g(d))?"true":"false";c.setAttribute("aria-required",d);wp(c,b,a);b=
|
|
5
|
+
$APP.k(a,"__xSearchFieldInternals");return $APP.n(b)?xp(a,b,c):null}return null},Ap=function(a,b,c,d){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:$APP.F(d)}))},Bp=function(a){return function(){var b=$APP.k(a,"__xSearchFieldRefs");if($APP.n(b)){var c=$APP.k(b,"input");b=$APP.k(b,"clear");var d=c.value;var e=a.getAttribute("name");e=$APP.n(e)?e:"";var g=$APP.k(a,"__xSearchFieldInternals");$APP.n(g)&&(g.setFormValue(d),xp(a,g,c));wp(c,b,a);return Ap(a,"x-search-field-input",
|
|
6
|
+
{name:e,value:d},!1)}return null}},Cp=function(a){return function(){var b=$APP.k(a,"__xSearchFieldRefs");if($APP.n(b)){b=$APP.k(b,"input");var c=b.value;var d=a.getAttribute("name");d=$APP.n(d)?d:"";var e=$APP.k(a,"__xSearchFieldInternals");$APP.n(e)&&(e.setFormValue(c),xp(a,e,b));return Ap(a,"x-search-field-change",{name:d,value:c},!1)}return null}},Dp=function(a){return function(b){if($APP.C.i("Enter",b.key)&&(b.preventDefault(),b=$APP.k(a,"__xSearchFieldRefs"),$APP.n(b))){var c=$APP.k(b,"input").value;
|
|
7
|
+
b=function(){var d=a.getAttribute("name");return $APP.n(d)?d:""}();return $APP.n(function(){var d=a.hasAttribute("required");return $APP.n(d)?$APP.C.i(c,""):d}())?(b=$APP.k(a,"__xSearchFieldInternals"),$APP.n(b)?b.reportValidity():null):Ap(a,"x-search-field-search",{name:b,value:c},!0)}return null}},Ep=function(a){return function(){var b=$APP.k(a,"__xSearchFieldRefs");if($APP.n(b)){var c=$APP.k(b,"input");b=$APP.k(b,"clear");var d=a.getAttribute("name");d=$APP.n(d)?d:"";c.value="";var e=$APP.k(a,
|
|
8
|
+
"__xSearchFieldInternals");$APP.n(e)&&(e.setFormValue(""),xp(a,e,c));wp(c,b,a);Ap(a,"x-search-field-clear",{name:d},!1);return c.focus()}return null}},Fp=function(a){var b=$APP.k(a,"__xSearchFieldRefs");if($APP.n(b)){var c=$APP.k(a,"__xSearchFieldHandlers");if($APP.n(c)){var d=$APP.k(b,"input");b=$APP.k(b,"clear");d.removeEventListener("input",$APP.k(c,"input"));d.removeEventListener("change",$APP.k(c,"change"));d.removeEventListener("keydown",$APP.k(c,"keydown"));b.removeEventListener("click",$APP.k(c,
|
|
9
|
+
"click"));a.__xSearchFieldHandlers=null;return}}return null},Gp=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){var d=this.getAttribute(c);return $APP.n(d)?d:""},set:function(d){d!=null&&$APP.N(d)?(d=""+$APP.T.g(d),d=this.setAttribute(c,d)):d=this.removeAttribute(c);return d}})},Hp=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return vp(this,c,$APP.F(d))}})},Ip=function(a){Object.defineProperty(a,
|
|
10
|
+
"value",{configurable:!0,enumerable:!0,get:function(){var b=$APP.k(this,"__xSearchFieldRefs");if($APP.n(b))return $APP.k(b,"input").value;b=this.getAttribute("value");return $APP.n(b)?b:""},set:function(b){b=b!=null&&$APP.N(b)?""+$APP.T.g(b):"";this.setAttribute("value",b);var c=$APP.k(this,"__xSearchFieldRefs");return $APP.n(c)?$APP.k(c,"input").value=b:null}})},Kp=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=!0;Object.defineProperty(a,"observedAttributes",{get:function(){return Jp}});
|
|
11
|
+
Ip(b);Gp(b,"name","name");Gp(b,"placeholder","placeholder");Gp(b,"label","label");Gp(b,"autocomplete","autocomplete");Hp(b,"disabled","disabled");Hp(b,"required","required");b.checkValidity=function(){var c=$APP.k(this,"__xSearchFieldInternals");return $APP.n(c)?c.checkValidity():!0};b.reportValidity=function(){var c=$APP.k(this,"__xSearchFieldInternals");return $APP.n(c)?c.reportValidity():!0};b.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xSearchFieldRefs"))){if(!$APP.n(this.shadowRoot)){var c=
|
|
12
12
|
this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("div"),g=document.createElement("span"),h=document.createElement("input"),l=document.createElement("button");d.textContent=":host{display:block;color-scheme:light dark;--x-search-field-bg:var(--x-color-surface,#ffffff);--x-search-field-color:#111827;--x-search-field-border:1px solid var(--x-color-border,#d1d5db);--x-search-field-border-radius:var(--x-radius-md,6px);--x-search-field-focus-ring-color:var(--x-color-primary,#2563eb);--x-search-field-icon-color:var(--x-color-border,#9ca3af);--x-search-field-clear-color:var(--x-color-border,#9ca3af);--x-search-field-disabled-opacity:0.45;}@media (prefers-color-scheme:dark){:host{--x-search-field-bg:var(--x-color-surface,#1f2937);--x-search-field-color:#f9fafb;--x-search-field-border:1px solid var(--x-color-border,#4b5563);--x-search-field-focus-ring-color:var(--x-color-primary,#3b82f6);--x-search-field-icon-color:#6b7280;--x-search-field-clear-color:#6b7280;}}[part\x3dwrapper]{display:flex;align-items:center;position:relative;background:var(--x-search-field-bg);border:var(--x-search-field-border);border-radius:var(--x-search-field-border-radius);transition:border-color 120ms ease,box-shadow 120ms ease;}[part\x3dwrapper]:focus-within{border-color:var(--x-search-field-focus-ring-color);box-shadow:0 0 0 3px color-mix(in srgb,var(--x-search-field-focus-ring-color) 20%,transparent);}[part\x3dicon]{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:36px;color:var(--x-search-field-icon-color);pointer-events:none;}[part\x3dinput]{flex:1;min-width:0;padding:0.5rem 0.25rem;background:transparent;color:var(--x-search-field-color);border:none;outline:none;font-size:1rem;line-height:1.5;font-family:inherit;}[part\x3dinput]::-webkit-search-cancel-button{-webkit-appearance:none;}[part\x3dinput]::-webkit-search-decoration{-webkit-appearance:none;}[part\x3dclear]{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:32px;height:32px;margin-right:2px;background:none;border:none;cursor:pointer;color:var(--x-search-field-clear-color);font-size:1.125rem;line-height:1;border-radius:4px;padding:0;}[part\x3dclear]:hover{color:var(--x-search-field-color);}.clear-hidden{display:none;}:host([disabled]) [part\x3dwrapper]{opacity:var(--x-search-field-disabled-opacity);cursor:not-allowed;}:host([disabled]) [part\x3dinput]{cursor:not-allowed;}@media (prefers-reduced-motion:reduce){[part\x3dwrapper]{transition:none;}}";
|
|
13
13
|
e.setAttribute("part","wrapper");g.setAttribute("part","icon");g.innerHTML='\x3csvg xmlns\x3d"http://www.w3.org/2000/svg" width\x3d"16" height\x3d"16" viewBox\x3d"0 0 24 24" fill\x3d"none" stroke\x3d"currentColor" stroke-width\x3d"2" stroke-linecap\x3d"round" stroke-linejoin\x3d"round" aria-hidden\x3d"true"\x3e\x3ccircle cx\x3d"11" cy\x3d"11" r\x3d"8"/\x3e\x3cline x1\x3d"21" y1\x3d"21" x2\x3d"16.65" y2\x3d"16.65"/\x3e\x3c/svg\x3e';h.setAttribute("part","input");h.setAttribute("type","search");h.setAttribute("spellcheck",
|
|
14
|
-
"false");l.setAttribute("part","clear");l.setAttribute("type","button");l.setAttribute("aria-label","Clear search");l.textContent="×";l.classList.add("clear-hidden");e.appendChild(g);e.appendChild(h);e.appendChild(l);c.appendChild(d);c.appendChild(e);this.__xSearchFieldRefs={wrapper:e,icon:g,input:h,clear:l}}$APP.n(this.attachInternals)&&(this.__xSearchFieldInternals=this.attachInternals())}
|
|
15
|
-
(c.value=d));c=$APP.k(this,"__xSearchFieldInternals");$APP.n(c)&&(d=c.setFormValue,e=this.getAttribute("value"),d.call(c,$APP.n(e)?e:""));d=$APP.k(this,"__xSearchFieldRefs");$APP.n(d)&&(c=$APP.k(d,"input"),d=$APP.k(d,"clear"),e=
|
|
16
|
-
b.attributeChangedCallback=function(c,d,e){$APP.C.i(c,"value")&&(c=$APP.k(this,"__xSearchFieldRefs"),$APP.n(c)&&(c=$APP.k(c,"input"),$APP.N(c.value,e)&&(c.value=$APP.n(e)?e:"")));return
|
|
17
|
-
return a},
|
|
14
|
+
"false");l.setAttribute("part","clear");l.setAttribute("type","button");l.setAttribute("aria-label","Clear search");l.textContent="×";l.classList.add("clear-hidden");e.appendChild(g);e.appendChild(h);e.appendChild(l);c.appendChild(d);c.appendChild(e);this.__xSearchFieldRefs={wrapper:e,icon:g,input:h,clear:l}}$APP.n(this.attachInternals)&&(this.__xSearchFieldInternals=this.attachInternals())}Fp(this);c=$APP.k(this,"__xSearchFieldRefs");$APP.n(c)&&(c=$APP.k(c,"input"),d=this.getAttribute("value"),$APP.n(d)&&
|
|
15
|
+
(c.value=d));c=$APP.k(this,"__xSearchFieldInternals");$APP.n(c)&&(d=c.setFormValue,e=this.getAttribute("value"),d.call(c,$APP.n(e)?e:""));d=$APP.k(this,"__xSearchFieldRefs");$APP.n(d)&&(c=$APP.k(d,"input"),d=$APP.k(d,"clear"),e=Bp(this),g=Cp(this),h=Dp(this),l=Ep(this),c.addEventListener("input",e),c.addEventListener("change",g),c.addEventListener("keydown",h),d.addEventListener("click",l),this.__xSearchFieldHandlers={input:e,change:g,keydown:h,click:l});return zp(this)};b.disconnectedCallback=function(){return Fp(this)};
|
|
16
|
+
b.attributeChangedCallback=function(c,d,e){$APP.C.i(c,"value")&&(c=$APP.k(this,"__xSearchFieldRefs"),$APP.n(c)&&(c=$APP.k(c,"input"),$APP.N(c.value,e)&&(c.value=$APP.n(e)?e:"")));return zp(this)};b.formDisabledCallback=function(c){vp(this,"disabled",$APP.F(c));return zp(this)};b.formResetCallback=function(){this.removeAttribute("value");var c=$APP.k(this,"__xSearchFieldRefs");$APP.n(c)&&($APP.k(c,"input").value="");c=$APP.k(this,"__xSearchFieldInternals");$APP.n(c)&&c.setFormValue("");return zp(this)};
|
|
17
|
+
return a},Lp=function(){return $APP.n(customElements.get("x-search-field"))?null:customElements.define("x-search-field",Kp())};var Jp="name value placeholder label disabled required autocomplete".split(" "),yp=new $APP.S(null,new $APP.Q(null,2,["off",null,"on",null],null),null);$APP.ha("baredom.exports.x_search_field.init",Lp);export const init=Lp;
|
package/dist/x-select.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
"md";c=new $APP.
|
|
4
|
-
$APP.N(e,"")?(b.textContent=e,b.hidden=!1):b.hidden=!0;l.value=$APP.n(m)?m:"";a.setAttribute("data-size",g);$APP.n(h)?a.setAttribute("data-disabled",""):a.removeAttribute("data-disabled");return c==null||$APP.C.i(c,"")?l.setAttribute("aria-label",$APP.n(e)?e:"select"):l.removeAttribute("aria-label")}}return null},
|
|
5
|
-
g=e;if($APP.n($APP.n(g)?e!==d:g))c.removeChild(e);else break}d=$APP.t($APP.
|
|
6
|
-
|
|
7
|
-
$APP.k(c,"change"));d.removeEventListener("slotchange",$APP.k(c,"slotchange"));a.__xSelectHandlers=null;return}}return null},
|
|
8
|
-
null&&$APP.N(b)?(b=""+$APP.T.g(b),b=this.setAttribute("value",b)):b=this.removeAttribute("value");return b}})},
|
|
2
|
+
var IP=function(a){var b=$APP.k(a,"__xSelectRefs");if($APP.n(b)){var c=new $APP.Q(null,6,[$APP.ul,a.hasAttribute("disabled"),$APP.Ih,a.hasAttribute("required"),$APP.Cl,a.getAttribute("size"),$APP.Gi,a.getAttribute("placeholder"),$APP.jm,a.getAttribute("value"),$APP.gl,a.getAttribute("name")],null);var d=$APP.M(c),e=$APP.D(d,$APP.ul),g=$APP.D(d,$APP.Ih),h=$APP.D(d,$APP.Cl);c=$APP.D(d,$APP.Gi);var l=$APP.D(d,$APP.jm);d=$APP.D(d,$APP.gl);e=$APP.F(e);g=$APP.F(g);h=typeof h==="string"&&$APP.I(HP,h)?h:
|
|
3
|
+
"md";c=new $APP.Q(null,6,[$APP.X,e,$APP.hi,g,$APP.Hh,h,$APP.Yl,c,$APP.Pi,l,$APP.qj,d],null);if($APP.N(c,$APP.k(a,"__xSelectModel"))){a.__xSelectModel=c;a=$APP.k(b,"wrapper");l=$APP.k(b,"select");b=$APP.k(b,"placeholder-opt");h=$APP.X.g(c);d=$APP.hi.g(c);g=$APP.Hh.g(c);e=$APP.Yl.g(c);var m=$APP.Pi.g(c);c=$APP.qj.g(c);l.disabled=h;$APP.n(d)?l.setAttribute("required",""):l.removeAttribute("required");typeof c==="string"&&$APP.N(c,"")?l.setAttribute("name",c):l.removeAttribute("name");typeof e==="string"&&
|
|
4
|
+
$APP.N(e,"")?(b.textContent=e,b.hidden=!1):b.hidden=!0;l.value=$APP.n(m)?m:"";a.setAttribute("data-size",g);$APP.n(h)?a.setAttribute("data-disabled",""):a.removeAttribute("data-disabled");return c==null||$APP.C.i(c,"")?l.setAttribute("aria-label",$APP.n(e)?e:"select"):l.removeAttribute("aria-label")}}return null},JP=function(a){var b=$APP.k(a,"__xSelectRefs");if($APP.n(b)){var c=$APP.k(b,"select"),d=$APP.k(b,"placeholder-opt");for(b=$APP.k(b,"slot").assignedElements({flatten:!0});;){var e=c.lastChild,
|
|
5
|
+
g=e;if($APP.n($APP.n(g)?e!==d:g))c.removeChild(e);else break}d=$APP.t($APP.uc(b));b=null;for(g=e=0;;)if(g<e){var h=b.F(null,g),l=h.tagName.toLowerCase();($APP.C.i(l,"option")||$APP.C.i(l,"optgroup"))&&c.appendChild(h.cloneNode(!0));g+=1}else if(d=$APP.t(d))$APP.Nc(d)?(e=$APP.yb(d),d=$APP.zb(d),b=e,e=$APP.z(e)):(b=$APP.u(d),e=b.tagName.toLowerCase(),($APP.C.i(e,"option")||$APP.C.i(e,"optgroup"))&&c.appendChild(b.cloneNode(!0)),d=$APP.w(d),b=null,e=0),g=0;else break;a.__xSelectModel=null;return IP(a)}return null},
|
|
6
|
+
KP=function(a){return function(){var b=$APP.k(a,"__xSelectRefs");return $APP.n(b)?(b=$APP.k(b,"select"),a.dispatchEvent(new CustomEvent("select-change",{detail:{value:b.value,label:b.selectedOptions.length>0?b.selectedOptions[0].text:""},bubbles:!0,composed:!0,cancelable:!1}))):null}},LP=function(a){return function(){return JP(a)}},MP=function(a){var b=$APP.k(a,"__xSelectRefs");if($APP.n(b)){var c=$APP.k(a,"__xSelectHandlers");if($APP.n(c)){var d=$APP.k(b,"slot");$APP.k(b,"select").removeEventListener("change",
|
|
7
|
+
$APP.k(c,"change"));d.removeEventListener("slotchange",$APP.k(c,"slotchange"));a.__xSelectHandlers=null;return}}return null},NP=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return $APP.n($APP.F(d))?this.setAttribute(c,""):this.removeAttribute(c)}})},OP=function(a){Object.defineProperty(a,"value",{configurable:!0,enumerable:!0,get:function(){var b=this.getAttribute("value");return $APP.n(b)?b:null},set:function(b){b!=
|
|
8
|
+
null&&$APP.N(b)?(b=""+$APP.T.g(b),b=this.setAttribute("value",b)):b=this.removeAttribute("value");return b}})},QP=function(){var a=class extends HTMLElement{},b=a.prototype;Object.defineProperty(a,"observedAttributes",{get:function(){return PP}});NP(b,"disabled","disabled");NP(b,"required","required");OP(b);b.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xSelectRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("div"),g=document.createElement("select"),
|
|
9
9
|
h=document.createElement("option"),l=document.createElement("span"),m=document.createElement("slot");d.textContent=":host{display:inline-block;color-scheme:light dark;--x-select-height-sm:2rem;--x-select-height-md:2.5rem;--x-select-height-lg:3rem;--x-select-radius:var(--x-radius-md,0.5rem);--x-select-font-size-sm:0.75rem;--x-select-font-size-md:var(--x-font-size-sm,0.875rem);--x-select-font-size-lg:var(--x-font-size-base,1rem);--x-select-padding-inline:0.75rem;--x-select-bg:var(--x-color-bg,#ffffff);--x-select-bg-disabled:var(--x-color-bg,#f8fafc);--x-select-fg:var(--x-color-text,#0f172a);--x-select-fg-disabled:var(--x-color-text-muted,#94a3b8);--x-select-placeholder-fg:var(--x-color-text-muted,#94a3b8);--x-select-border:var(--x-color-border,#cbd5e1);--x-select-border-hover:var(--x-color-border,#94a3b8);--x-select-border-focus:var(--x-color-primary,#3b82f6);--x-select-chevron:var(--x-color-text-muted,#64748b);--x-select-focus-ring:var(--x-color-focus-ring,#93c5fd);--x-select-shadow:var(--x-shadow-sm,0 1px 2px rgba(15,23,42,0.06));--x-select-transition-duration:var(--x-transition-duration,140ms);}@media (prefers-color-scheme:dark){:host{--x-select-bg:var(--x-color-bg,#1f2937);--x-select-bg-disabled:var(--x-color-bg,#111827);--x-select-fg:var(--x-color-text,#f1f5f9);--x-select-border:var(--x-color-border,#374151);--x-select-border-hover:var(--x-color-border,#4b5563);--x-select-border-focus:var(--x-color-focus-ring,#60a5fa);--x-select-chevron:var(--x-color-text-muted,#94a3b8);}}[part\x3dwrapper]{position:relative;display:flex;align-items:stretch;height:var(--x-select-height-md);border:1px solid var(--x-select-border);border-radius:var(--x-select-radius);background:var(--x-select-bg);box-shadow:var(--x-select-shadow);transition:border-color var(--x-select-transition-duration) ease,box-shadow var(--x-select-transition-duration) ease;overflow:hidden;font-size:var(--x-select-font-size-md);}[part\x3dwrapper][data-size\x3dsm]{height:var(--x-select-height-sm);font-size:var(--x-select-font-size-sm);}[part\x3dwrapper][data-size\x3dlg]{height:var(--x-select-height-lg);font-size:var(--x-select-font-size-lg);}[part\x3dwrapper][data-disabled]{background:var(--x-select-bg-disabled);opacity:0.6;pointer-events:none;}[part\x3dwrapper]:hover:not([data-disabled]){border-color:var(--x-select-border-hover);}[part\x3dwrapper]:focus-within:not([data-disabled]){border-color:var(--x-select-border-focus);box-shadow:0 0 0 3px var(--x-select-focus-ring);}[part\x3dselect]{appearance:none;-webkit-appearance:none;flex:1;min-width:0;background:transparent;border:none;outline:none;color:var(--x-select-fg);font-size:inherit;font-family:inherit;padding-inline:var(--x-select-padding-inline);padding-inline-end:calc(var(--x-select-padding-inline) + 1.75rem);cursor:pointer;width:100%;}[part\x3dselect]:disabled{color:var(--x-select-fg-disabled);cursor:default;}[part\x3dselect] option[data-placeholder]{color:var(--x-select-placeholder-fg);}[part\x3dchevron]{position:absolute;right:var(--x-select-padding-inline);top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;pointer-events:none;color:var(--x-select-chevron);width:1rem;height:1rem;}slot{display:none;}@media (prefers-reduced-motion:reduce){[part\x3dwrapper]{transition:none;}}";
|
|
10
10
|
e.setAttribute("part","wrapper");g.setAttribute("part","select");l.setAttribute("part","chevron");l.setAttribute("aria-hidden","true");h.setAttribute("data-placeholder","");h.setAttribute("value","");h.hidden=!0;h.disabled=!0;h.selected=!0;l.innerHTML='\x3csvg xmlns\x3d"http://www.w3.org/2000/svg" width\x3d"16" height\x3d"16" viewBox\x3d"0 0 16 16" fill\x3d"none" stroke\x3d"currentColor" stroke-width\x3d"2" stroke-linecap\x3d"round" stroke-linejoin\x3d"round" aria-hidden\x3d"true"\x3e\x3cpolyline points\x3d"4 6 8 10 12 6"/\x3e\x3c/svg\x3e';
|
|
11
|
-
g.appendChild(h);e.appendChild(g);e.appendChild(l);c.appendChild(d);c.appendChild(e);c.appendChild(m);this.__xSelectRefs={root:c,wrapper:e,select:g,"placeholder-opt":h,slot:m,chevron:l}}
|
|
12
|
-
function(c,d,e){return $APP.N(d,e)?
|
|
11
|
+
g.appendChild(h);e.appendChild(g);e.appendChild(l);c.appendChild(d);c.appendChild(e);c.appendChild(m);this.__xSelectRefs={root:c,wrapper:e,select:g,"placeholder-opt":h,slot:m,chevron:l}}MP(this);c=$APP.k(this,"__xSelectRefs");$APP.n(c)&&(d=$APP.k(c,"slot"),e=KP(this),g=LP(this),h={change:e,slotchange:g},$APP.k(c,"select").addEventListener("change",e),d.addEventListener("slotchange",g),this.__xSelectHandlers=h);JP(this);return IP(this)};b.disconnectedCallback=function(){return MP(this)};b.attributeChangedCallback=
|
|
12
|
+
function(c,d,e){return $APP.N(d,e)?IP(this):null};return a},RP=function(){return $APP.n(customElements.get("x-select"))?null:customElements.define("x-select",QP())};var HP=new $APP.S(null,new $APP.Q(null,3,["md",null,"lg",null,"sm",null],null),null),PP="disabled required size placeholder value name".split(" ");$APP.Qd(["select-change",new $APP.Q(null,2,[$APP.Rl,!1,$APP.V,new $APP.Q(null,2,[$APP.Pi,$APP.Y,$APP.U,$APP.Y],null)],null)]);$APP.ha("baredom.exports.x_select.init",RP);export const init=RP;
|