@vanelsas/baredom 3.2.0 → 4.0.0-alpha.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 +42 -0
- package/README.md +82 -170
- package/custom-elements.json +3705 -3385
- package/dist/barebuild-action.d.ts +45 -0
- package/dist/barebuild-action.js +9 -0
- package/dist/barebuild-data.d.ts +39 -0
- package/dist/barebuild-data.js +5 -0
- package/dist/barebuild-invalidate-on.d.ts +42 -0
- package/dist/barebuild-invalidate-on.js +5 -0
- package/dist/barebuild-route.d.ts +39 -0
- package/dist/barebuild-route.js +4 -0
- package/dist/barebuild-router.d.ts +41 -0
- package/dist/barebuild-router.js +13 -0
- package/dist/baredom.d.ts +96 -91
- package/dist/base.js +589 -579
- package/dist/integrity.json +113 -108
- package/dist/x-alert.js +17 -17
- package/dist/x-avatar-group.js +9 -9
- package/dist/x-avatar.js +14 -14
- package/dist/x-badge.js +9 -9
- package/dist/x-bento-grid.js +5 -5
- package/dist/x-bento-item.js +4 -4
- package/dist/x-breadcrumbs.js +13 -13
- package/dist/x-button.js +1 -1
- package/dist/x-calendar.js +38 -38
- package/dist/x-cancel-dialogue.js +13 -13
- package/dist/x-card.js +7 -7
- package/dist/x-carousel.js +33 -33
- package/dist/x-chart.js +47 -47
- package/dist/x-checkbox.js +1 -1
- package/dist/x-chip.js +1 -1
- package/dist/x-code.js +27 -27
- package/dist/x-collapse.js +11 -11
- package/dist/x-color-picker.js +44 -44
- package/dist/x-combobox.js +28 -28
- package/dist/x-command-palette.js +27 -27
- package/dist/x-confetti.js +24 -24
- package/dist/x-container.js +5 -5
- package/dist/x-context-menu.js +20 -20
- package/dist/x-copy.js +1 -1
- package/dist/x-currency-field.js +24 -24
- package/dist/x-date-picker.d.ts +5 -4
- package/dist/x-date-picker.js +37 -37
- package/dist/x-divider.js +10 -10
- package/dist/x-drawer.js +11 -11
- package/dist/x-dropdown.js +12 -12
- package/dist/x-fieldset.js +5 -5
- package/dist/x-file-download.js +5 -5
- package/dist/x-file-upload.js +22 -22
- package/dist/x-form-field.js +14 -14
- package/dist/x-form.js +11 -10
- package/dist/x-gaussian-blur.js +13 -13
- package/dist/x-grid.js +6 -6
- package/dist/x-i18n-provider.js +7 -7
- package/dist/x-i18n.js +4 -4
- package/dist/x-icon.js +7 -7
- package/dist/x-image.js +17 -17
- package/dist/x-kbd.js +12 -12
- package/dist/x-kinetic-canvas.js +25 -25
- package/dist/x-kinetic-font.js +27 -27
- package/dist/x-kinetic-typography.js +33 -33
- package/dist/x-liquid-dock.js +31 -31
- package/dist/x-liquid-fill.js +41 -41
- package/dist/x-liquid-glass.js +34 -34
- package/dist/x-menu-item.js +8 -8
- package/dist/x-menu.js +9 -9
- package/dist/x-metaball-cursor.js +23 -23
- package/dist/x-modal.js +12 -12
- package/dist/x-morph-stack.js +37 -37
- package/dist/x-multi-combobox.js +35 -35
- package/dist/x-navbar.js +15 -15
- package/dist/x-neural-glow.js +29 -29
- package/dist/x-notification-center.js +9 -9
- package/dist/x-organic-divider.js +17 -17
- package/dist/x-organic-progress.js +33 -33
- package/dist/x-organic-shape.js +12 -12
- package/dist/x-otp-input.js +21 -21
- package/dist/x-pagination.js +14 -14
- package/dist/x-particle-button.js +48 -48
- package/dist/x-popover.js +26 -26
- package/dist/x-progress-circle.js +7 -7
- package/dist/x-progress.js +7 -7
- package/dist/x-proximity-list.js +20 -20
- package/dist/x-radio.js +11 -11
- package/dist/x-range-slider.js +28 -28
- package/dist/x-rating.js +23 -23
- package/dist/x-ripple-effect.js +9 -9
- package/dist/x-scroll-parallax.js +17 -17
- package/dist/x-scroll-stack.js +16 -16
- package/dist/x-scroll-story.js +33 -33
- package/dist/x-scroll-timeline.js +45 -45
- package/dist/x-scroll.js +37 -37
- package/dist/x-search-field.js +1 -1
- package/dist/x-select.d.ts +1 -0
- package/dist/x-select.js +1 -1
- package/dist/x-sidebar.js +16 -16
- package/dist/x-skeleton-group.js +12 -12
- package/dist/x-skeleton.js +1 -1
- package/dist/x-slider.js +15 -15
- package/dist/x-soft-body.js +18 -18
- package/dist/x-spacer.js +4 -4
- package/dist/x-spinner.js +4 -4
- package/dist/x-splash.js +12 -12
- package/dist/x-split-pane.js +15 -15
- package/dist/x-spotlight-card.js +12 -12
- package/dist/x-stat.js +10 -10
- package/dist/x-stepper.js +13 -13
- package/dist/x-switch.js +10 -10
- package/dist/x-tab.js +6 -6
- package/dist/x-table-cell.js +19 -19
- package/dist/x-table-row.js +8 -8
- package/dist/x-table.js +13 -13
- package/dist/x-tabs.js +11 -11
- package/dist/x-text-area.js +18 -18
- package/dist/x-theme.js +25 -25
- package/dist/x-timeline-item.js +20 -20
- package/dist/x-timeline.js +8 -8
- package/dist/x-toast.js +22 -22
- package/dist/x-toaster.js +6 -6
- package/dist/x-tooltip.js +12 -12
- package/dist/x-trace-history.js +124 -124
- package/dist/x-typography.js +6 -6
- package/dist/x-welcome-tour.js +63 -63
- package/package.json +28 -1
package/dist/x-timeline-item.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
b){a=$APP.C(
|
|
4
|
-
$APP.
|
|
5
|
-
$APP.
|
|
6
|
-
m=document.createElement("div"),
|
|
7
|
-
$APP.T(d,"class","timeline-item");$APP.T(e,"class","label-col");$APP.T(f,"name","label");$APP.T(h,"class","label-text");f.appendChild(h);e.appendChild(f);$APP.T(k,"class","track-col");$APP.T(m,"class","marker");$APP.T(
|
|
8
|
-
"class","actions");$APP.T(S,"name","actions");
|
|
9
|
-
|
|
10
|
-
$APP.C(d,$APP.
|
|
11
|
-
"listitem");$APP.n(h)?($APP.T(a,"aria-disabled","true"),a.tabIndex=-1):($APP.U(a,"aria-disabled"),a.tabIndex=0);k=$APP.I(m,"")?m:$APP.I(k,"")?k:null;$APP.n(k)?$APP.T(a,"aria-label",k):$APP.U(a,"aria-label");m=$APP.G(b);k=$APP.C(m,
|
|
12
|
-
null;return a},
|
|
13
|
-
$APP.
|
|
14
|
-
$APP.l(b,"click");b=$APP.l(b,"keydown");$APP.n(c)&&a.removeEventListener("click",c);$APP.n(b)&&a.removeEventListener("keydown",b)}$APP.Q(a,"__xTimelineItemHandlers",null)},
|
|
15
|
-
return $APP.n(b)?b:""},set:function(b){return $APP.n($APP.n(b)?$APP.I(b,""):b)?$APP.T(this,"title",""+$APP.P.i(b)):$APP.U(this,"title")},enumerable:!0,configurable:!0});$APP.
|
|
16
|
-
"__xTimelineItemModel");b=$APP.n(b)?b:
|
|
17
|
-
b],null);return $APP.
|
|
18
|
-
"actions-slot",1424248629),
|
|
19
|
-
"marker-aria","marker-aria",-353426855),
|
|
20
|
-
$APP.
|
|
21
|
-
var
|
|
2
|
+
var Kv=function(a){a=$APP.C(Jv,typeof a==="string"?a.toLowerCase():null);return $APP.n(a)?a:$APP.Mp},Mv=function(a){a=$APP.C(Lv,a);return $APP.n(a)?a:"pending"},Pv=function(a){a=$APP.C(Nv,typeof a==="string"?a.toLowerCase():null);return $APP.n(a)?a:Ov},Qv=function(a){return typeof a==="string"?(a=a.trim(),$APP.I(a,"")&&$APP.I(a.toLowerCase(),"none")?a:null):null},Rv=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),typeof a==="number"&&$APP.p(isNaN(a))&&a>=0?a:null):null},Tv=function(a,
|
|
3
|
+
b){a=$APP.C(Sv,typeof a==="string"?a.toLowerCase():null);$APP.n(a)?b=a:(b=$APP.C(Sv,typeof b==="string"?b.toLowerCase():null),b=$APP.n(b)?b:$APP.hu);return b},Uv=function(a,b,c){a=Mv(a);c=c!=null?"Step "+$APP.P.i(c+1)+": ":null;return""+$APP.P.i(c)+$APP.P.i(typeof b==="string"&&$APP.I(b,"")?""+$APP.P.i(b)+" ":null)+"("+$APP.P.i(a)+")"},dw=function(a){var b=$APP.G(a),c=$APP.C(b,Vv);a=$APP.C(b,$APP.Xj);var d=$APP.C(b,$APP.Gr),e=$APP.C(b,$APP.Dj),f=$APP.C(b,Wv),h=$APP.C(b,$APP.eq),k=$APP.C(b,Xv),m=$APP.C(b,
|
|
4
|
+
$APP.Cq),r=$APP.C(b,Yv),u=$APP.C(b,$APP.yp),x=$APP.C(b,$APP.ds);b=$APP.C(b,$APP.or);var y=Kv(m),A=Qv(b),E=$APP.n($APP.n(u)?A==null:u)?$APP.av:A!=null?$APP.tt:$APP.wj;m=function(){var H=E instanceof $APP.F?E.ea:null;switch(H){case "default":return H=$APP.C(Zv,y),$APP.n(H)?H:$APP.C(Zv,$APP.Mp);case "custom":return A;case "hidden":return null;default:throw Error("No matching clause: "+$APP.P.i(H));}}();c=Rv(c);d=Tv(k,d);e=$APP.n(e)?e:"";x=$APP.n(x)?x:"";return $APP.Gg([$APP.Qp,$v,aw,Wv,Yv,$APP.Cs,$APP.Xp,
|
|
5
|
+
$APP.ks,$APP.Wj,bw,$APP.as,$APP.Xj,cw],[Pv(h),c,m,$APP.D(f),$APP.D(r),$APP.z.j(E,$APP.tt)?A:null,x,y,e,Uv(y,e,c),E,$APP.D(a),d])},ew=function(a){a=$APP.G(a);a=$APP.C(a,$APP.Xj);return $APP.p(a)},nw=function(a){var b=$APP.l(a,"__xTimelineItemRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("div"),f=document.createElement("slot"),h=document.createElement("span"),k=document.createElement("div"),
|
|
6
|
+
m=document.createElement("div"),r=document.createElement("slot"),u=document.createElement("span"),x=document.createElement("div"),y=document.createElement("div"),A=document.createElement("div"),E=document.createElement("div"),H=document.createElement("slot"),O=document.createElement("div"),S=document.createElement("slot");c.textContent=":host{display:block;color-scheme:light dark;--x-timeline-item-marker-size:2rem;--x-timeline-item-marker-bg:var(--x-color-border,rgba(0,0,0,0.06));--x-timeline-item-marker-color:var(--x-color-text-muted,rgba(0,0,0,0.45));--x-timeline-item-connector-color:var(--x-color-border,rgba(0,0,0,0.12));--x-timeline-item-connector-width:2px;--x-timeline-item-gap:0.75rem;--x-timeline-item-label-width:6rem;--x-timeline-item-label-color:var(--x-color-text-muted,rgba(0,0,0,0.5));--x-timeline-item-label-font-size:var(--x-font-size-sm,0.8125rem);--x-timeline-item-title-font-size:0.9375rem;--x-timeline-item-stripe-bg:var(--x-color-surface,rgba(0,0,0,0.025));--x-timeline-item-motion:var(--x-transition-duration,150ms);--x-timeline-item-motion-ease:var(--x-transition-easing,cubic-bezier(0.2,0,0,1));--x-timeline-item-enter-duration:160ms;--x-timeline-item-disabled-opacity:0.45;}@media (prefers-color-scheme:dark){:host{--x-timeline-item-marker-bg:var(--x-color-border,rgba(255,255,255,0.10));--x-timeline-item-marker-color:var(--x-color-text-muted,rgba(255,255,255,0.55));--x-timeline-item-connector-color:var(--x-color-border,rgba(255,255,255,0.15));--x-timeline-item-label-color:var(--x-color-text-muted,rgba(255,255,255,0.5));--x-timeline-item-stripe-bg:var(--x-color-surface,rgba(255,255,255,0.03));}}:host([data-status\x3d'active']){--x-timeline-item-marker-bg:var(--x-color-primary,rgba(0,102,204,1));--x-timeline-item-marker-color:#fff;--x-timeline-item-connector-color:var(--x-color-primary,rgba(0,102,204,0.4));}:host([data-status\x3d'complete']){--x-timeline-item-marker-bg:var(--x-color-success,rgba(16,140,72,1));--x-timeline-item-marker-color:#fff;--x-timeline-item-connector-color:var(--x-color-success,rgba(16,140,72,0.5));}:host([data-status\x3d'error']){--x-timeline-item-marker-bg:var(--x-color-danger,rgba(190,20,40,1));--x-timeline-item-marker-color:#fff;--x-timeline-item-connector-color:var(--x-color-danger,rgba(190,20,40,0.4));}:host([data-status\x3d'warning']){--x-timeline-item-marker-bg:var(--x-color-warning,rgba(204,120,0,1));--x-timeline-item-marker-color:#fff;--x-timeline-item-connector-color:var(--x-color-warning,rgba(204,120,0,0.4));}@media (prefers-color-scheme:dark){:host([data-status\x3d'active']){--x-timeline-item-marker-bg:var(--x-color-primary,rgba(80,160,255,1));--x-timeline-item-connector-color:var(--x-color-primary,rgba(80,160,255,0.4));}:host([data-status\x3d'complete']){--x-timeline-item-marker-bg:var(--x-color-success,rgba(60,210,120,1));--x-timeline-item-connector-color:var(--x-color-success,rgba(60,210,120,0.5));}:host([data-status\x3d'error']){--x-timeline-item-marker-bg:var(--x-color-danger,rgba(255,90,110,1));--x-timeline-item-connector-color:var(--x-color-danger,rgba(255,90,110,0.4));}:host([data-status\x3d'warning']){--x-timeline-item-marker-bg:var(--x-color-warning,rgba(255,190,90,1));--x-timeline-item-connector-color:var(--x-color-warning,rgba(255,190,90,0.4));}}:host([data-striped]){background:var(--x-timeline-item-stripe-bg);border-radius:var(--x-radius-sm,4px);}:host([disabled]){opacity:var(--x-timeline-item-disabled-opacity);pointer-events:none;}:host(:not([disabled])){cursor:pointer;}:host(:not([disabled])):focus{outline:none;}:host(:not([disabled])):focus-visible{outline:2px solid var(--x-color-focus-ring,rgba(0,102,204,0.55));outline-offset:2px;}@media (prefers-color-scheme:dark){:host(:not([disabled])):focus-visible{outline-color:var(--x-color-focus-ring,rgba(80,160,255,0.7));}}.timeline-item{display:grid;grid-template-columns:var(--x-timeline-item-label-width) var(--x-timeline-item-marker-size) 1fr;grid-template-areas:'label track content';align-items:start;gap:0 var(--x-timeline-item-gap);}:host([data-position\x3d'end']) .timeline-item{grid-template-columns:1fr var(--x-timeline-item-marker-size) var(--x-timeline-item-label-width);grid-template-areas:'content track label';}.label-col{grid-area:label;display:flex;align-items:center;justify-content:flex-end;min-height:var(--x-timeline-item-marker-size);font-size:var(--x-timeline-item-label-font-size);color:var(--x-timeline-item-label-color);overflow:hidden;min-width:0;}:host([data-position\x3d'end']) .label-col{justify-content:flex-start;}.track-col{grid-area:track;display:flex;flex-direction:column;align-items:center;}.marker{display:inline-flex;align-items:center;justify-content:center;width:var(--x-timeline-item-marker-size);height:var(--x-timeline-item-marker-size);border-radius:999px;background:var(--x-timeline-item-marker-bg);color:var(--x-timeline-item-marker-color);font-size:0.875em;flex-shrink:0;transition:background var(--x-timeline-item-motion) var(--x-timeline-item-motion-ease),color var(--x-timeline-item-motion) var(--x-timeline-item-motion-ease);}.connector{flex:1;width:var(--x-timeline-item-connector-width);background:var(--x-timeline-item-connector-color);min-height:1rem;transition:background var(--x-timeline-item-motion) var(--x-timeline-item-motion-ease);}:host([data-connector\x3d'dashed']) .connector{background:repeating-linear-gradient(to bottom,var(--x-timeline-item-connector-color) 0,var(--x-timeline-item-connector-color) 4px,transparent 4px,transparent 8px);}:host([data-connector\x3d'none']) .connector,:host([data-last]) .connector{display:none;}.content-col{grid-area:content;display:flex;flex-direction:column;min-width:0;padding-bottom:var(--x-timeline-item-gap);}.title{font-weight:600;font-size:var(--x-timeline-item-title-font-size);line-height:1.25;min-height:var(--x-timeline-item-marker-size);display:flex;align-items:center;overflow-wrap:anywhere;min-width:0;}.title[hidden]{display:none;}.body{margin-top:0.25rem;}.actions{margin-top:0.5rem;}:host([data-entering]){animation:x-timeline-item-enter var(--x-timeline-item-enter-duration) var(--x-timeline-item-motion-ease) both;}@keyframes x-timeline-item-enter{from{opacity:0;transform:translateX(-4px);}to{opacity:1;transform:translateX(0);}}:host([data-position\x3d'end'][data-entering]){animation-name:x-timeline-item-enter-end;}@keyframes x-timeline-item-enter-end{from{opacity:0;transform:translateX(4px);}to{opacity:1;transform:translateX(0);}}@media (prefers-reduced-motion:reduce){:host([data-entering]){animation:none !important;}.marker,.connector{transition:none !important;}}";
|
|
7
|
+
$APP.T(d,"class","timeline-item");$APP.T(e,"class","label-col");$APP.T(f,"name","label");$APP.T(h,"class","label-text");f.appendChild(h);e.appendChild(f);$APP.T(k,"class","track-col");$APP.T(m,"class","marker");$APP.T(r,"name","icon");$APP.T(u,"class","default-icon");$APP.T(u,"aria-hidden","true");r.appendChild(u);m.appendChild(r);$APP.T(x,"class","connector");k.appendChild(m);k.appendChild(x);$APP.T(y,"class","content-col");$APP.T(A,"class","title");$APP.T(E,"class","body");E.appendChild(H);$APP.T(O,
|
|
8
|
+
"class","actions");$APP.T(S,"name","actions");O.appendChild(S);y.appendChild(A);y.appendChild(E);y.appendChild(O);d.appendChild(e);d.appendChild(k);d.appendChild(y);b.appendChild(c);b.appendChild(d);$APP.Q(a,"__xTimelineItemRefs",$APP.Gg([$APP.Qp,fw,$APP.Es,$APP.Vu,gw,hw,$APP.Cu,iw,$APP.Fk,jw,$APP.Hs,kw,lw,mw,$APP.hr,$APP.cn],[x,h,m,u,e,k,E,H,b,S,A,y,d,O,r,f]));return $APP.l(a,"__xTimelineItemRefs")},ow=function(a){return dw($APP.Gg([$APP.Gr,$APP.Dj,Wv,$APP.eq,Xv,$APP.Cq,Yv,$APP.yp,$APP.ds,$APP.or,
|
|
9
|
+
Vv,$APP.Xj],[a.getAttribute("position"),a.getAttribute("label"),a.hasAttribute("data-striped"),a.getAttribute("connector"),$APP.l(a,"__xTimelineItemParentPos"),a.getAttribute("status"),a.hasAttribute("data-last"),a.hasAttribute("icon"),a.getAttribute("title"),a.getAttribute("icon"),a.getAttribute("data-index"),a.hasAttribute("disabled")]))},pw=function(a){var b=ow(a);if($APP.I($APP.l(a,"__xTimelineItemModel"),b)){var c=nw(a),d=$APP.G(c);c=$APP.C(d,fw);var e=$APP.C(d,$APP.Es),f=$APP.C(d,$APP.Hs);d=
|
|
10
|
+
$APP.C(d,$APP.Vu);var h=$APP.G(b),k=$APP.C(h,$APP.ks),m=$APP.C(h,cw);h=$APP.C(h,$APP.Qp);$APP.T(a,"data-status",Mv(k));$APP.Q(a,"__xTimelineItemSelfPos",!0);$APP.T(a,"data-position",$APP.kh(m));$APP.Q(a,"__xTimelineItemSelfPos",null);switch(h instanceof $APP.F?h.ea:null){case "dashed":$APP.T(a,"data-connector","dashed");break;case "none":$APP.T(a,"data-connector","none");break;default:$APP.U(a,"data-connector")}h=$APP.G(b);k=$APP.C(h,$APP.Wj);m=$APP.C(h,$APP.Xp);h=$APP.C(h,$APP.Xj);$APP.T(a,"role",
|
|
11
|
+
"listitem");$APP.n(h)?($APP.T(a,"aria-disabled","true"),a.tabIndex=-1):($APP.U(a,"aria-disabled"),a.tabIndex=0);k=$APP.I(m,"")?m:$APP.I(k,"")?k:null;$APP.n(k)?$APP.T(a,"aria-label",k):$APP.U(a,"aria-label");m=$APP.G(b);k=$APP.C(m,aw);m=$APP.C(m,bw);$APP.T(e,"aria-label",m);d.textContent=k!=null?k:"";d=$APP.G(b);e=$APP.C(d,$APP.Wj);d=$APP.C(d,$APP.Xp);c.textContent=e;$APP.I(d,"")?($APP.U(f,"hidden"),f.textContent=d):($APP.T(f,"hidden",""),f.textContent="");a=$APP.Q(a,"__xTimelineItemModel",b)}else a=
|
|
12
|
+
null;return a},qw=function(a){$APP.n($APP.l(a,"__xTimelineItemEntered"))||($APP.Q(a,"__xTimelineItemEntered",!0),$APP.T(a,"data-entering",""),a.addEventListener("animationend",function d(c){return $APP.z.j(c.target,a)?(a.removeEventListener("animationend",d),$APP.U(a,"data-entering")):null}))},rw=function(a){var b=$APP.l(a,"__xTimelineItemModel");b=$APP.n(b)?b:ow(a);var c=$APP.G(b);b=$APP.C(c,$APP.ks);c=$APP.C(c,$APP.Wj);b=new $APP.M(null,2,[$APP.ks,Mv(b),$APP.Wj,c],null);return $APP.jj(a,"x-timeline-item-click",
|
|
13
|
+
$APP.gm(b))},sw=function(a){function b(d){a:{var e=d.key;if($APP.z.j(e,"Enter")||$APP.z.j(e," "))if(e=$APP.l(a,"__xTimelineItemModel"),e=$APP.n(e)?e:ow(a),ew(e)){d.preventDefault();d=rw(a);break a}d=null}return d}function c(){var d=$APP.l(a,"__xTimelineItemModel");d=$APP.n(d)?d:ow(a);return ew(d)?rw(a):null}a.addEventListener("click",c);a.addEventListener("keydown",b);$APP.Q(a,"__xTimelineItemHandlers",{click:c,keydown:b})},tw=function(a){var b=$APP.l(a,"__xTimelineItemHandlers");if($APP.n(b)){var c=
|
|
14
|
+
$APP.l(b,"click");b=$APP.l(b,"keydown");$APP.n(c)&&a.removeEventListener("click",c);$APP.n(b)&&a.removeEventListener("keydown",b)}$APP.Q(a,"__xTimelineItemHandlers",null)},uw=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.I(b,""):b)?$APP.T(this,"label",""+$APP.P.i(b)):$APP.U(this,"label")},enumerable:!0,configurable:!0});Object.defineProperty(a,"title",{get:function(){var b=this.getAttribute("title");
|
|
15
|
+
return $APP.n(b)?b:""},set:function(b){return $APP.n($APP.n(b)?$APP.I(b,""):b)?$APP.T(this,"title",""+$APP.P.i(b)):$APP.U(this,"title")},enumerable:!0,configurable:!0});$APP.pj(a,"status","status","pending");$APP.qj(a,"icon","icon");$APP.pj(a,"connector","connector","solid");$APP.pj(a,"position","position","start");return $APP.mj(a,"disabled","disabled")},vw=function(a){nw(a);tw(a);sw(a);var b=a.getAttribute("data-position");$APP.n(b)&&$APP.Q(a,"__xTimelineItemParentPos",b);pw(a);qw(a);b=$APP.l(a,
|
|
16
|
+
"__xTimelineItemModel");b=$APP.n(b)?b:ow(a);var c=$APP.G(b);b=$APP.C(c,$APP.ks);var d=$APP.C(c,$APP.Wj),e=$APP.C(c,cw);c=$APP.C(c,$APP.Xj);b=new $APP.M(null,4,[$APP.ks,Mv(b),$APP.Wj,d,$APP.bv,$APP.kh(e),$APP.zm,$APP.D(c)],null);return $APP.hj(a,"x-timeline-item-connected",$APP.gm(b))},ww=function(a){var b=$APP.l(a,"__xTimelineItemModel");b=$APP.n(b)?b:ow(a);tw(a);$APP.Q(a,"__xTimelineItemEntered",null);b=$APP.G(b);a=$APP.C(b,$APP.ks);b=$APP.C(b,$APP.Wj);a=new $APP.M(null,2,[$APP.ks,Mv(a),$APP.Wj,
|
|
17
|
+
b],null);return $APP.lj("x-timeline-item-disconnected",$APP.gm(a))},xw=function(a,b,c,d){if($APP.I(c,d)){c=$APP.z.j(b,"data-position");if($APP.n(c?$APP.l(a,"__xTimelineItemSelfPos"):c))return null;$APP.z.j(b,"data-position")&&$APP.Q(a,"__xTimelineItemParentPos",d);return pw(a)}return null},zw=function(){return $APP.zi("x-timeline-item",new $APP.M(null,5,[$APP.ji,yw,$APP.hi,vw,$APP.ei,ww,$APP.di,xw,$APP.ii,uw],null))},hw=new $APP.F(null,"track-col","track-col",629248272),jw=new $APP.F(null,"actions-slot",
|
|
18
|
+
"actions-slot",1424248629),cw=new $APP.F(null,"effective-position","effective-position",840072317),gw=new $APP.F(null,"label-col","label-col",1883390160),fw=new $APP.F(null,"label-text","label-text",-1566972381),Wv=new $APP.F(null,"data-striped?","data-striped?",906911587),mw=new $APP.F(null,"actions-el","actions-el",1486248509),kw=new $APP.F(null,"content-col","content-col",767367449),Aw=new $APP.F(null,"dashed","dashed",-1449249319),lw=new $APP.F(null,"item-div","item-div",1630512700),bw=new $APP.F(null,
|
|
19
|
+
"marker-aria","marker-aria",-353426855),aw=new $APP.F(null,"marker-icon","marker-icon",424963779),Ov=new $APP.F(null,"solid","solid",-2023773691),iw=new $APP.F(null,"default-slot","default-slot",-1145647151),Yv=new $APP.F(null,"data-last?","data-last?",-1110326839),Xv=new $APP.F(null,"data-position-raw","data-position-raw",256144356),Vv=new $APP.F(null,"data-index-raw","data-index-raw",491574874),$v=new $APP.F(null,"data-index","data-index",1161508385),Bw=new $APP.F(null,"none","none",1333468478);var yw="label title status icon connector position disabled data-last data-index data-position data-striped".split(" ");
|
|
20
|
+
$APP.je(["x-timeline-item-connected",new $APP.M(null,2,[$APP.V,new $APP.M(null,4,[$APP.ks,$APP.X,$APP.Wj,$APP.X,$APP.bv,$APP.X,$APP.zm,$APP.vj],null),$APP.fu,!1],null),"x-timeline-item-disconnected",new $APP.M(null,2,[$APP.V,new $APP.M(null,2,[$APP.ks,$APP.X,$APP.Wj,$APP.X],null),$APP.fu,!1],null),"x-timeline-item-click",new $APP.M(null,2,[$APP.V,new $APP.M(null,2,[$APP.ks,$APP.X,$APP.Wj,$APP.X],null),$APP.fu,!0],null)]);
|
|
21
|
+
var Jv=new $APP.M(null,5,["pending",$APP.Mp,"active",$APP.ur,"complete",$APP.Iu,"error",$APP.fq,"warning",$APP.cu],null),Lv=new $APP.M(null,5,[$APP.Mp,"pending",$APP.ur,"active",$APP.Iu,"complete",$APP.fq,"error",$APP.cu,"warning"],null),Zv=new $APP.M(null,5,[$APP.Mp,"○",$APP.ur,"●",$APP.Iu,"✓",$APP.fq,"✕",$APP.cu,"!"],null),Nv=new $APP.M(null,3,["solid",Ov,"dashed",Aw,"none",Bw],null),Sv=new $APP.M(null,2,["start",$APP.hu,"end",$APP.sq],null);$APP.fa("baredom.exports.x_timeline_item.init",zw);export const init=zw;
|
package/dist/x-timeline.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
$APP.T(d,"part","label");$APP.T(d,"hidden","");b.appendChild(c);b.appendChild(d);b.appendChild(e);$APP.Q(a,"__xTimelineRefs",new $APP.M(null,3,[$APP.
|
|
4
|
-
$APP.D(b)],null)},
|
|
5
|
-
for(var d=a.length,e=0;;)if(e<d){var f=a[e],h=$APP.z.j(e,d-1);$APP.T(f,"data-index",""+$APP.P.i(e));h?$APP.T(f,"data-last",""):$APP.U(f,"data-last");$APP.T(f,"data-position",
|
|
6
|
-
$APP.l(e,"status");e=$APP.l(e,"label");return $APP.
|
|
7
|
-
if($APP.n(b)){var c=$APP.l(b,"item-connected"),d=$APP.l(b,"item-click");b=$APP.l(b,"item-disconnected-doc");$APP.n(c)&&a.removeEventListener("x-timeline-item-connected",c);$APP.n(d)&&a.removeEventListener("x-timeline-item-click",d);$APP.n(b)&&document.removeEventListener("x-timeline-item-disconnected",b)}return $APP.Q(a,"__xTimelineHandlers",null)},
|
|
8
|
-
$APP.I(b,""):b)?$APP.T(this,"label",""+$APP.P.i(b)):$APP.U(this,"label")},enumerable:!0,configurable:!0});Object.defineProperty(a,"position",{get:function(){return
|
|
9
|
-
null},
|
|
2
|
+
var n4=function(a){a=typeof a==="string"?a.trim().toLowerCase():null;return $APP.ed(nra,a)?a:"start"},ora=function(a,b){switch(a){case "start":return"start";case "end":return"end";case "alternating":return $APP.ud(b,2)===0?"start":"end";default:return"start"}},p4=function(a){var b=$APP.l(a,"__xTimelineRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("slot");c.textContent=":host{display:flex;flex-direction:column;color-scheme:light dark;--x-timeline-gap:0;--x-timeline-label-color:var(--x-color-text,inherit);--x-timeline-label-font-size:var(--x-font-size-sm,0.875rem);--x-timeline-label-font-weight:600;--x-timeline-label-padding:0 0 0.5rem;}slot{display:contents;}[part\x3dlabel]{color:var(--x-timeline-label-color);font-size:var(--x-timeline-label-font-size);font-weight:var(--x-timeline-label-font-weight);padding:var(--x-timeline-label-padding);box-sizing:border-box;}[part\x3dlabel][hidden]{display:none !important;}";
|
|
3
|
+
$APP.T(d,"part","label");$APP.T(d,"hidden","");b.appendChild(c);b.appendChild(d);b.appendChild(e);$APP.Q(a,"__xTimelineRefs",new $APP.M(null,3,[$APP.Fk,b,o4,d,$APP.vt,e],null));return $APP.l(a,"__xTimelineRefs")},q4=function(a){a=new $APP.M(null,3,[$APP.Dj,a.getAttribute("label"),$APP.Gr,a.getAttribute("position"),$APP.Rs,a.hasAttribute("striped")],null);var b=$APP.G(a);a=$APP.C(b,$APP.Dj);var c=$APP.C(b,$APP.Gr);b=$APP.C(b,$APP.Rs);return new $APP.M(null,3,[$APP.Wj,$APP.n(a)?a:"",$APP.bv,n4(c),$APP.Rs,
|
|
4
|
+
$APP.D(b)],null)},r4=function(a){var b=q4(a);if($APP.I($APP.l(a,"__xTimelineModel"),b)){b=$APP.G(b);var c=$APP.C(b,$APP.Wj),d=p4(a);d=$APP.G(d);d=$APP.C(d,o4);$APP.T(a,"role","list");$APP.I(c,"")?$APP.T(a,"aria-label",c):$APP.U(a,"aria-label");$APP.I(c,"")?(d.textContent=c,$APP.U(d,"hidden")):(d.textContent="",$APP.T(d,"hidden",""));$APP.Q(a,"__xTimelineModel",b)}},s4=function(a){var b=$APP.l(a,"__xTimelineModel");b=$APP.n(b)?b:q4(a);var c=$APP.G(b);b=$APP.C(c,$APP.bv);c=$APP.C(c,$APP.Rs);a=a.querySelectorAll("x-timeline-item");
|
|
5
|
+
for(var d=a.length,e=0;;)if(e<d){var f=a[e],h=$APP.z.j(e,d-1);$APP.T(f,"data-index",""+$APP.P.i(e));h?$APP.T(f,"data-last",""):$APP.U(f,"data-last");$APP.T(f,"data-position",ora(b,e));$APP.n(c)?$APP.T(f,"data-striped",""):$APP.U(f,"data-striped");e+=1}else return null},pra=function(a){function b(){return $APP.n(a.isConnected)?s4(a):null}function c(e){e.stopPropagation();var f=e.target.getAttribute("data-index");e=e.detail;typeof f==="string"?(f=parseInt(f,10),f=$APP.n(isNaN(f))?null:f):f=null;var h=
|
|
6
|
+
$APP.l(e,"status");e=$APP.l(e,"label");return $APP.hj(a,"x-timeline-select",$APP.gm(new $APP.M(null,3,[$APP.Ip,$APP.n(f)?f:0,$APP.ks,$APP.n(h)?h:"",$APP.Wj,$APP.n(e)?e:""],null)))}function d(){return s4(a)}a.addEventListener("x-timeline-item-connected",d);a.addEventListener("x-timeline-item-click",c);document.addEventListener("x-timeline-item-disconnected",b);$APP.Q(a,"__xTimelineHandlers",{"item-connected":d,"item-click":c,"item-disconnected-doc":b})},t4=function(a){var b=$APP.l(a,"__xTimelineHandlers");
|
|
7
|
+
if($APP.n(b)){var c=$APP.l(b,"item-connected"),d=$APP.l(b,"item-click");b=$APP.l(b,"item-disconnected-doc");$APP.n(c)&&a.removeEventListener("x-timeline-item-connected",c);$APP.n(d)&&a.removeEventListener("x-timeline-item-click",d);$APP.n(b)&&document.removeEventListener("x-timeline-item-disconnected",b)}return $APP.Q(a,"__xTimelineHandlers",null)},qra=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)?
|
|
8
|
+
$APP.I(b,""):b)?$APP.T(this,"label",""+$APP.P.i(b)):$APP.U(this,"label")},enumerable:!0,configurable:!0});Object.defineProperty(a,"position",{get:function(){return n4(this.getAttribute("position"))},set:function(b){return $APP.n(b)?$APP.T(this,"position",""+$APP.P.i(b)):$APP.U(this,"position")},enumerable:!0,configurable:!0});return $APP.mj(a,"striped","striped")},rra=function(a){p4(a);r4(a);t4(a);pra(a);return s4(a)},sra=function(a){return t4(a)},tra=function(a,b,c,d){return $APP.I(c,d)?(r4(a),s4(a)):
|
|
9
|
+
null},u4=function(){return $APP.zi("x-timeline",new $APP.M(null,5,[$APP.ji,ura,$APP.hi,rra,$APP.ei,sra,$APP.di,tra,$APP.ii,qra],null))},o4=new $APP.F(null,"label-div","label-div",1505730697);var ura=["label","position","striped"];$APP.je(["x-timeline-select",new $APP.M(null,2,[$APP.V,new $APP.M(null,3,[$APP.Ip,$APP.Y,$APP.ks,$APP.X,$APP.Wj,$APP.X],null),$APP.fu,!1],null)]);var nra=new $APP.ch(null,new $APP.M(null,3,["start",null,"end",null,"alternating",null],null),null);$APP.fa("baredom.exports.x_timeline.init",u4);export const init=u4;
|
package/dist/x-toast.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
$APP.G(a),c=$APP.C(b,$APP.
|
|
4
|
-
typeof d==="string"?d.trim():null;return $APP.n(
|
|
5
|
-
b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("div"),f=document.createElement("span"),h=document.createElement("slot"),k=document.createElement("span"),m=document.createElement("div"),
|
|
6
|
-
$APP.T(d,"part","container");$APP.T(e,"part","inner");$APP.T(f,"part","icon");$APP.T(f,"aria-hidden","true");$APP.T(h,"name","icon");$APP.T(k,"part","default-icon");h.appendChild(k);f.appendChild(h);$APP.T(m,"part","body");$APP.T(
|
|
7
|
-
e.appendChild(x);$APP.T(A,"part","progress");$APP.T(E,"part","progress-bar");A.appendChild(E);d.appendChild(e);d.appendChild(A);b.appendChild(c);b.appendChild(d);$APP.Q(a,"__xToastRefs",$APP.
|
|
8
|
-
a.hasAttribute("icon"),a.getAttribute("show-progress"),a.getAttribute("icon"),a.getAttribute("type"),a.getAttribute("message"),a.getAttribute("heading")]))},
|
|
9
|
-
|
|
10
|
-
$APP.n(c)?(y.textContent="",
|
|
11
|
-
"aria-keyshortcuts");$APP.Q(a,"__xToastModel",b)}},
|
|
12
|
-
$APP.l(a,"__xToastTimeout");$APP.n(b)&&(clearTimeout(b),$APP.Q(a,"__xToastTimeout",null))},
|
|
13
|
-
function(){var d=$APP.l(a,"__xToastModel");return $APP.n(d)?d:
|
|
14
|
-
|
|
15
|
-
d);return $APP.Q(a,"__xToastExitTimer",setTimeout(function(){var f=a.isConnected;return $APP.n($APP.n(f)?$APP.l(a,"__xToastExiting"):f)?(b.removeEventListener("animationend",d),$APP.Q(a,"__xToastExitTimer",null),a.remove()):null},c+60))},
|
|
16
|
-
c=c>0?c:b>0?b:180;if(c===0||
|
|
17
|
-
"Escape")){var c=function(){var d=$APP.l(a,"__xToastModel");return $APP.n(d)?d:
|
|
18
|
-
$APP.n(b)&&(clearTimeout(b),$APP.Q(a,"__xToastExitTimer",null));b=$APP.l(a,"__xToastHandlers");var c=$APP.l(a,"__xToastRefs");if($APP.n($APP.n(b)?c:b)){c=$APP
|
|
19
|
-
"dismissible");$APP.
|
|
20
|
-
|
|
21
|
-
$APP.
|
|
22
|
-
"show-progress-attr",1680262066);var
|
|
23
|
-
var
|
|
2
|
+
var dA=function(a){a=$APP.C(cA,typeof a==="string"?a.toLowerCase():null);return $APP.n(a)?a:$APP.ht},fA=function(a){a=$APP.C(eA,a);return $APP.n(a)?a:"info"},gA=function(a){return a==null?!1:$APP.I((""+$APP.P.i(a)).trim().toLowerCase(),"false")},hA=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),typeof a==="number"&&$APP.p(isNaN(a))&&a>0?a:null):null},iA=function(a){return typeof a==="string"?(a=a.trim(),$APP.I(a,"")&&$APP.I(a.toLowerCase(),"none")?a:null):null},lA=function(a){var b=
|
|
3
|
+
$APP.G(a),c=$APP.C(b,$APP.os),d=$APP.C(b,$APP.rt);a=$APP.C(b,$APP.er);var e=$APP.C(b,$APP.Ej),f=$APP.C(b,$APP.Wp),h=$APP.C(b,$APP.yp),k=$APP.C(b,jA),m=$APP.C(b,$APP.Zp);b=$APP.C(b,$APP.or);m=dA(m);b=iA(b);h=$APP.n($APP.n(h)?b==null:h)?$APP.av:b!=null?$APP.tt:$APP.wj;return $APP.Gg([kA,$APP.vq,$APP.N,$APP.Cs,$APP.as,$APP.Xj,$APP.ru,$APP.os,$APP.rt],[gA(k),$APP.Ki(a),m,$APP.z.j(h,$APP.tt)?b:null,h,$APP.D(e),hA(f),function(){var r=typeof c==="string"?c.trim():null;return $APP.n(r)?r:""}(),function(){var r=
|
|
4
|
+
typeof d==="string"?d.trim():null;return $APP.n(r)?r:""}()])},mA=function(a){var b=$APP.G(a);a=$APP.C(b,$APP.vq);b=$APP.C(b,$APP.Xj);return $APP.n(a)?$APP.p(b):a},nA=function(a,b){var c=$APP.G(a);a=$APP.C(c,$APP.N);var d=$APP.C(c,$APP.rt);c=$APP.C(c,$APP.os);return new $APP.M(null,4,[$APP.N,fA(a),$APP.wq,b,$APP.rt,d,$APP.os,c],null)},oA=function(a){var b=$APP.G(a);a=$APP.C(b,kA);b=$APP.C(b,$APP.ru);return $APP.D($APP.n(a)?b!=null&&b>0:a)},tA=function(a){var b=$APP.l(a,"__xToastRefs");if($APP.n(b))return b;
|
|
5
|
+
b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("div"),f=document.createElement("span"),h=document.createElement("slot"),k=document.createElement("span"),m=document.createElement("div"),r=document.createElement("span"),u=document.createElement("span"),x=document.createElement("button"),y=document.createElement("span"),A=document.createElement("div"),E=document.createElement("div");c.textContent=":host{display:block;color-scheme:light dark;--x-toast-radius:var(--x-radius-lg,12px);--x-toast-padding-y:14px;--x-toast-padding-x:16px;--x-toast-gap:12px;--x-toast-font-size:var(--x-font-size-sm,0.875rem);--x-toast-heading-font-size:0.9375rem;--x-toast-heading-weight:600;--x-toast-min-width:min(280px,calc(100vw - 2rem));--x-toast-max-width:min(480px,calc(100vw - 2rem));--x-toast-border-width:1px;--x-toast-shadow:var(--x-shadow-md,0 4px 16px rgba(0,0,0,0.12),0 1px 4px rgba(0,0,0,0.08));--x-toast-motion-fast:var(--x-transition-duration,120ms);--x-toast-motion-ease:var(--x-transition-easing,cubic-bezier(0.2,0,0,1));--x-toast-enter-duration:200ms;--x-toast-exit-duration:180ms;--x-toast-press-scale:0.97;--x-toast-disabled-opacity:0.55;--x-toast-focus-ring:var(--x-color-focus-ring,rgba(0,0,0,0.6));--x-toast-dismiss-color:var(--x-color-text-muted,rgba(0,0,0,0.50));--x-toast-dismiss-hover-bg:var(--x-color-surface-hover,rgba(0,0,0,0.06));--x-toast-progress-height:3px;--x-toast-progress-bg:var(--x-color-border,rgba(0,0,0,0.08));--x-toast-info-bg:var(--x-color-bg,#ffffff);--x-toast-info-border:rgba(0,102,204,0.30);--x-toast-info-color:rgba(15,23,42,0.92);--x-toast-info-icon-color:rgba(0,102,204,0.85);--x-toast-info-progress-fill:rgba(0,102,204,0.70);--x-toast-success-bg:var(--x-color-bg,#ffffff);--x-toast-success-border:rgba(16,140,72,0.30);--x-toast-success-color:rgba(15,23,42,0.92);--x-toast-success-icon-color:rgba(16,140,72,0.85);--x-toast-success-progress-fill:rgba(16,140,72,0.70);--x-toast-warning-bg:var(--x-color-bg,#ffffff);--x-toast-warning-border:rgba(204,120,0,0.40);--x-toast-warning-color:rgba(15,23,42,0.92);--x-toast-warning-icon-color:rgba(180,100,0,0.85);--x-toast-warning-progress-fill:rgba(204,120,0,0.70);--x-toast-error-bg:var(--x-color-bg,#ffffff);--x-toast-error-border:rgba(190,20,40,0.40);--x-toast-error-color:rgba(15,23,42,0.92);--x-toast-error-icon-color:rgba(190,20,40,0.85);--x-toast-error-progress-fill:rgba(190,20,40,0.70);--x-toast-bg:transparent;--x-toast-border-color:transparent;--x-toast-color:inherit;--x-toast-icon-color:inherit;--x-toast-progress-fill:currentColor;}@media (prefers-color-scheme:dark){:host{--x-toast-shadow:var(--x-shadow-md,0 4px 20px rgba(0,0,0,0.40),0 1px 6px rgba(0,0,0,0.30));--x-toast-focus-ring:var(--x-color-focus-ring,rgba(255,255,255,0.75));--x-toast-dismiss-color:var(--x-color-text-muted,rgba(255,255,255,0.65));--x-toast-dismiss-hover-bg:var(--x-color-surface-hover,rgba(255,255,255,0.12));--x-toast-progress-bg:var(--x-color-border,rgba(255,255,255,0.10));--x-toast-info-bg:var(--x-color-bg,#1e293b);--x-toast-info-border:rgba(80,160,255,0.35);--x-toast-info-color:rgba(248,250,252,0.92);--x-toast-info-icon-color:rgba(96,165,250,0.90);--x-toast-info-progress-fill:rgba(96,165,250,0.75);--x-toast-success-bg:var(--x-color-bg,#1e293b);--x-toast-success-border:rgba(60,210,120,0.35);--x-toast-success-color:rgba(248,250,252,0.92);--x-toast-success-icon-color:rgba(52,211,153,0.90);--x-toast-success-progress-fill:rgba(52,211,153,0.75);--x-toast-warning-bg:var(--x-color-bg,#1e293b);--x-toast-warning-border:rgba(255,190,90,0.40);--x-toast-warning-color:rgba(248,250,252,0.92);--x-toast-warning-icon-color:rgba(251,191,36,0.90);--x-toast-warning-progress-fill:rgba(251,191,36,0.75);--x-toast-error-bg:var(--x-color-bg,#1e293b);--x-toast-error-border:rgba(255,90,110,0.40);--x-toast-error-color:rgba(248,250,252,0.92);--x-toast-error-icon-color:rgba(248,113,113,0.90);--x-toast-error-progress-fill:rgba(248,113,113,0.75);}}:host([data-type\x3d'info']){--x-toast-bg:var(--x-toast-info-bg);--x-toast-border-color:var(--x-toast-info-border);--x-toast-color:var(--x-toast-info-color);--x-toast-icon-color:var(--x-toast-info-icon-color);--x-toast-progress-fill:var(--x-toast-info-progress-fill);}:host([data-type\x3d'success']){--x-toast-bg:var(--x-toast-success-bg);--x-toast-border-color:var(--x-toast-success-border);--x-toast-color:var(--x-toast-success-color);--x-toast-icon-color:var(--x-toast-success-icon-color);--x-toast-progress-fill:var(--x-toast-success-progress-fill);}:host([data-type\x3d'warning']){--x-toast-bg:var(--x-toast-warning-bg);--x-toast-border-color:var(--x-toast-warning-border);--x-toast-color:var(--x-toast-warning-color);--x-toast-icon-color:var(--x-toast-warning-icon-color);--x-toast-progress-fill:var(--x-toast-warning-progress-fill);}:host([data-type\x3d'error']){--x-toast-bg:var(--x-toast-error-bg);--x-toast-border-color:var(--x-toast-error-border);--x-toast-color:var(--x-toast-error-color);--x-toast-icon-color:var(--x-toast-error-icon-color);--x-toast-progress-fill:var(--x-toast-error-progress-fill);}[part\x3dcontainer]{display:flex;flex-direction:column;background:var(--x-toast-bg);border:var(--x-toast-border-width) solid var(--x-toast-border-color);border-radius:var(--x-toast-radius);box-shadow:var(--x-toast-shadow);color:var(--x-toast-color);min-width:var(--x-toast-min-width);max-width:var(--x-toast-max-width);overflow:hidden;transition:background var(--x-toast-motion-fast) var(--x-toast-motion-ease),border-color var(--x-toast-motion-fast) var(--x-toast-motion-ease),opacity var(--x-toast-motion-fast) var(--x-toast-motion-ease),transform var(--x-toast-motion-fast) var(--x-toast-motion-ease);}[part\x3dinner]{display:flex;align-items:flex-start;gap:var(--x-toast-gap);padding:var(--x-toast-padding-y) var(--x-toast-padding-x);}[part\x3dicon]{flex:0 0 auto;color:var(--x-toast-icon-color);line-height:1;margin-top:0.15em;}slot[name\x3dicon]::slotted(*){display:block;}[part\x3dbody]{flex:1 1 auto;display:flex;flex-direction:column;gap:3px;min-width:0;}[part\x3dheading]{font-size:var(--x-toast-heading-font-size);font-weight:var(--x-toast-heading-weight);line-height:1.2;overflow-wrap:anywhere;}[part\x3dmessage]{font-size:var(--x-toast-font-size);line-height:1.35;overflow-wrap:anywhere;opacity:0.82;}[part\x3ddismiss]{flex:0 0 auto;appearance:none;border:0;background:transparent;color:var(--x-toast-dismiss-color);width:1.5em;height:1.5em;padding:0;margin:0;border-radius:999px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:background var(--x-toast-motion-fast) var(--x-toast-motion-ease),transform var(--x-toast-motion-fast) var(--x-toast-motion-ease);}:host(:not([disabled])) [part\x3ddismiss]:hover{background:var(--x-toast-dismiss-hover-bg);}:host(:not([disabled])) [part\x3ddismiss]:active{transform:scale(var(--x-toast-press-scale));}[part\x3ddismiss]:focus{outline:none;}:host(:not([disabled])) [part\x3ddismiss]:focus-visible{outline:2px solid var(--x-toast-focus-ring);outline-offset:2px;}:host([disabled]){opacity:var(--x-toast-disabled-opacity);}:host([disabled]) [part\x3ddismiss]{cursor:default;pointer-events:none;}[part\x3dprogress]{height:var(--x-toast-progress-height);background:var(--x-toast-progress-bg);overflow:hidden;display:none;}[part\x3dprogress-bar]{height:100%;width:100%;background:var(--x-toast-progress-fill);animation:x-toast-progress var(--x-toast-timeout,0ms) linear forwards;animation-play-state:paused;}:host([data-progress-active]) [part\x3dprogress-bar]{animation-play-state:running;}@keyframes x-toast-progress{from{width:100%;}to{width:0%;}}:host([data-entering]) [part\x3dcontainer]{animation:x-toast-enter var(--x-toast-enter-duration) var(--x-toast-motion-ease) both;}@keyframes x-toast-enter{from{opacity:0;transform:translateY(-8px);}to{opacity:1;transform:translateY(0);}}:host([data-exiting]) [part\x3dcontainer]{animation:x-toast-exit var(--x-toast-exit-duration) var(--x-toast-motion-ease) forwards;}@keyframes x-toast-exit{from{opacity:1;transform:translateY(0);}to{opacity:0;transform:translateY(-8px);}}@media (prefers-reduced-motion:reduce){[part\x3dcontainer],[part\x3ddismiss]{transition:none !important;}:host([data-entering]) [part\x3dcontainer],:host([data-exiting]) [part\x3dcontainer]{animation:none !important;}:host([data-progress-active]) [part\x3dprogress-bar]{animation:none !important;}}";
|
|
6
|
+
$APP.T(d,"part","container");$APP.T(e,"part","inner");$APP.T(f,"part","icon");$APP.T(f,"aria-hidden","true");$APP.T(h,"name","icon");$APP.T(k,"part","default-icon");h.appendChild(k);f.appendChild(h);$APP.T(m,"part","body");$APP.T(r,"part","heading");$APP.T(u,"part","message");m.appendChild(r);m.appendChild(u);$APP.T(x,"part","dismiss");$APP.T(x,"type","button");$APP.T(x,"aria-label","Dismiss toast");$APP.T(y,"aria-hidden","true");y.textContent="×";x.appendChild(y);e.appendChild(f);e.appendChild(m);
|
|
7
|
+
e.appendChild(x);$APP.T(A,"part","progress");$APP.T(E,"part","progress-bar");A.appendChild(E);d.appendChild(e);d.appendChild(A);b.appendChild(c);b.appendChild(d);$APP.Q(a,"__xToastRefs",$APP.Gg([pA,$APP.Vu,qA,$APP.Fs,$APP.Cu,rA,$APP.Fk,$APP.Gk,$APP.Vq,$APP.up,$APP.hr,sA],[E,k,u,x,m,e,b,d,A,f,h,r]));return $APP.l(a,"__xToastRefs")},uA=function(a){return lA($APP.Gg([$APP.er,$APP.Ej,$APP.Wp,$APP.yp,jA,$APP.or,$APP.Zp,$APP.os,$APP.rt],[a.getAttribute("dismissible"),a.hasAttribute("disabled"),a.getAttribute("timeout-ms"),
|
|
8
|
+
a.hasAttribute("icon"),a.getAttribute("show-progress"),a.getAttribute("icon"),a.getAttribute("type"),a.getAttribute("message"),a.getAttribute("heading")]))},yA=function(a){var b=uA(a);if($APP.I($APP.l(a,"__xToastModel"),b)){b=$APP.G(b);var c=$APP.C(b,$APP.N),d=$APP.C(b,$APP.rt),e=$APP.C(b,$APP.os),f=$APP.C(b,$APP.vq),h=$APP.C(b,$APP.Xj),k=$APP.C(b,$APP.ru),m=tA(a),r=$APP.G(m),u=$APP.C(r,$APP.hr),x=$APP.C(r,sA);m=$APP.C(r,pA);var y=$APP.C(r,$APP.Vu),A=$APP.C(r,qA),E=$APP.C(r,$APP.Fs),H=$APP.C(r,$APP.Gk),
|
|
9
|
+
O=$APP.C(r,$APP.Vq);r=$APP.C(r,$APP.up);$APP.T(a,"data-type",fA(c));var S=$APP.z.j(c,$APP.cu)||$APP.z.j(c,$APP.fq)?"alert":"status";$APP.T(H,"role",S);x.textContent=d;x.style.display=$APP.z.j(d,"")?"none":"";A.textContent=e;d=$APP.n(u)?u.assignedNodes().length>0:null;u=$APP.G(b);e=$APP.C(u,$APP.as);u=$APP.C(u,$APP.Cs);$APP.z.j(e,$APP.tt)?c=u:(c=$APP.C(vA,c),c=$APP.n(c)?c:$APP.C(vA,$APP.ht));d=$APP.p(d)&&$APP.z.j(e,$APP.av);d=$APP.G(new $APP.M(null,2,[wA,d,xA,c],null));c=$APP.C(d,wA);d=$APP.C(d,xA);
|
|
10
|
+
$APP.n(c)?(y.textContent="",r.style.display="none"):(y.textContent=d,r.style.display="inline");$APP.n(f)?(E.disabled=$APP.D(h),E.style.display="inline-flex"):(E.disabled=!0,E.style.display="none");y=oA(b);$APP.n(y)?(O.style.display="block",m.style.setProperty("--x-toast-timeout",""+$APP.P.i(k)+"ms")):O.style.display="none";f=$APP.n(f)?$APP.p(h):f;a.tabIndex=$APP.n(f)?0:-1;$APP.n(h)?$APP.T(a,"aria-disabled","true"):$APP.U(a,"aria-disabled");$APP.n(f)?$APP.T(a,"aria-keyshortcuts","Escape"):$APP.U(a,
|
|
11
|
+
"aria-keyshortcuts");$APP.Q(a,"__xToastModel",b)}},zA=function(){return $APP.D(window.matchMedia("(prefers-reduced-motion:reduce)").matches)},AA=function(a){a=typeof a==="string"?a.trim():"";return $APP.z.j(a,"")||$APP.z.j(a,"0")||$APP.z.j(a,"0ms")||$APP.z.j(a,"0s")?0:$APP.n(a.endsWith("ms"))?(a=parseFloat(a.slice(0,a.length-2)),$APP.n(isNaN(a))?0:Math.max(0,Math.round(a))):$APP.n(a.endsWith("s"))?(a=parseFloat(a.slice(0,a.length-1)),$APP.n(isNaN(a))?0:Math.max(0,Math.round(1E3*a))):0},BA=function(a){var b=
|
|
12
|
+
$APP.l(a,"__xToastTimeout");$APP.n(b)&&(clearTimeout(b),$APP.Q(a,"__xToastTimeout",null))},DA=function(a){BA(a);var b=function(){var c=$APP.l(a,"__xToastModel");return $APP.n(c)?c:uA(a)}();return $APP.n(function(){var c=mA(b);return $APP.n(c)?typeof $APP.ru.i(b)==="number"&&$APP.p($APP.l(a,"__xToastExiting")):c}())?$APP.Q(a,"__xToastTimeout",setTimeout(function(){$APP.Q(a,"__xToastTimeout",null);if($APP.n(function(){var d=a.isConnected;return $APP.n(d)?$APP.p($APP.l(a,"__xToastExiting")):d}())){var c=
|
|
13
|
+
function(){var d=$APP.l(a,"__xToastModel");return $APP.n(d)?d:uA(a)}();if($APP.n(mA(c)))return c=$APP.gm(nA(c,"timeout")),$APP.jj(a,"x-toast-dismiss",c)?CA.i?CA.i(a):CA.call(null,a):null}return null},$APP.ru.i(b))):null},EA=function(a){var b=$APP.l(a,"__xToastModel");$APP.n($APP.n(b)?oA(b):b)&&$APP.T(a,"data-progress-active","");return DA(a)},FA=function(a){if($APP.n($APP.l(a,"__xToastEntered")))return null;$APP.Q(a,"__xToastEntered",!0);$APP.T(a,"data-entering","");if(zA())return $APP.U(a,"data-entering"),
|
|
14
|
+
EA(a);var b=tA(a);b=$APP.G(b);var c=$APP.C(b,$APP.Gk);return c.addEventListener("animationend",function f(e){return $APP.z.j(e.target,c)?(c.removeEventListener("animationend",f),$APP.U(a,"data-entering"),EA(a)):null})},GA=function(a,b,c){var d=function h(f){return $APP.z.j(f.target,b)?(b.removeEventListener("animationend",h),f=$APP.l(a,"__xToastExitTimer"),$APP.n(f)&&(clearTimeout(f),$APP.Q(a,"__xToastExitTimer",null)),$APP.n(a.isConnected)?a.remove():null):null};$APP.T(a,"data-exiting","");b.addEventListener("animationend",
|
|
15
|
+
d);return $APP.Q(a,"__xToastExitTimer",setTimeout(function(){var f=a.isConnected;return $APP.n($APP.n(f)?$APP.l(a,"__xToastExiting"):f)?(b.removeEventListener("animationend",d),$APP.Q(a,"__xToastExitTimer",null),a.remove()):null},c+60))},CA=function(a){if($APP.n($APP.l(a,"__xToastExiting")))return null;$APP.Q(a,"__xToastExiting",!0);BA(a);$APP.U(a,"data-entering");$APP.U(a,"data-progress-active");var b=window.getComputedStyle(a);var c=AA(b.getPropertyValue("--x-toast-exit-duration"));b=AA(b.getPropertyValue("--x-motion-exit-duration"));
|
|
16
|
+
c=c>0?c:b>0?b:180;if(c===0||zA())return a.remove();b=tA(a);b=$APP.G(b);b=$APP.C(b,$APP.Gk);return GA(a,b,c)},HA=function(a,b){var c=$APP.l(a,"__xToastModel");c=$APP.n(c)?c:uA(a);b=$APP.gm(nA(c,b));(b=$APP.jj(a,"x-toast-dismiss",b))&&CA(a);return b},IA=function(a,b){var c=function(){var d=$APP.l(a,"__xToastModel");return $APP.n(d)?d:uA(a)}();return $APP.n(function(){var d=mA(c);return $APP.n(d)?$APP.p($APP.l(a,"__xToastExiting")):d}())?(b.preventDefault(),HA(a,"button")):null},JA=function(a,b){if($APP.z.j(b.key,
|
|
17
|
+
"Escape")){var c=function(){var d=$APP.l(a,"__xToastModel");return $APP.n(d)?d:uA(a)}();if($APP.n(function(){var d=mA(c);return $APP.n(d)?$APP.p($APP.l(a,"__xToastExiting")):d}()))return b.preventDefault(),HA(a,"keyboard")}return null},KA=function(a){function b(e){return JA(a,e)}function c(e){return IA(a,e)}var d=tA(a);d=$APP.G(d);$APP.C(d,$APP.Fs).addEventListener("click",c);a.addEventListener("keydown",b);$APP.Q(a,"__xToastHandlers",{click:c,keydown:b})},LA=function(a){BA(a);var b=$APP.l(a,"__xToastExitTimer");
|
|
18
|
+
$APP.n(b)&&(clearTimeout(b),$APP.Q(a,"__xToastExitTimer",null));b=$APP.l(a,"__xToastHandlers");var c=$APP.l(a,"__xToastRefs");if($APP.n($APP.n(b)?c:b)){c=$APP.Fs.i(c);var d=$APP.l(b,"click");b=$APP.l(b,"keydown");$APP.n(d)&&c.removeEventListener("click",d);$APP.n(b)&&a.removeEventListener("keydown",b)}return $APP.Q(a,"__xToastHandlers",null)},MA=function(a){$APP.pj(a,"type","type","info");$APP.pj(a,"heading","heading","");$APP.pj(a,"message","message","");$APP.qj(a,"icon","icon");$APP.nj(a,"dismissible",
|
|
19
|
+
"dismissible");$APP.mj(a,"disabled","disabled");Object.defineProperty(a,"timeoutMs",{get:function(){return hA(this.getAttribute("timeout-ms"))},set:function(b){return b==null?$APP.U(this,"timeout-ms"):$APP.T(this,"timeout-ms",""+$APP.P.i(b|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"showProgress",{get:function(){return gA(this.getAttribute("show-progress"))},set:function(b){return $APP.n(b)?$APP.T(this,"show-progress",""):$APP.U(this,"show-progress")},enumerable:!0,configurable:!0})},
|
|
20
|
+
NA=function(a){return Object.defineProperty(a,"dismiss",{value:function(b){var c=$APP.p($APP.l(this,"__xToastExiting"));$APP.n(c?this.isConnected:c)&&HA(this,typeof b==="string"?b:"api");return null},writable:!0,configurable:!0})},OA=function(a){tA(a);LA(a);KA(a);yA(a);return FA(a)},PA=function(a){return LA(a)},QA=function(a,b,c,d){return $APP.I(c,d)?(yA(a),$APP.n(a.isConnected)?DA(a):null):null},UA=function(){return $APP.zi("x-toast",new $APP.M(null,5,[$APP.ji,RA,$APP.hi,OA,$APP.ei,PA,$APP.di,QA,
|
|
21
|
+
$APP.ii,function(a){MA(a);return NA(a)}],null))},VA=function(){return UA()},sA=new $APP.F(null,"heading-el","heading-el",-1277272161),kA=new $APP.F(null,"show-progress?","show-progress?",-1681518912),rA=new $APP.F(null,"inner","inner",-1383171215),wA=new $APP.F(null,"hide?","hide?",-988635670),xA=new $APP.F(null,"fallback","fallback",761637929),qA=new $APP.F(null,"message-el","message-el",-683533234),pA=new $APP.F(null,"progress-bar","progress-bar",-123877022),jA=new $APP.F(null,"show-progress-attr",
|
|
22
|
+
"show-progress-attr",1680262066);var RA="type heading message icon dismissible disabled timeout-ms show-progress".split(" ");$APP.je(["x-toast-dismiss",new $APP.M(null,2,[$APP.V,new $APP.M(null,4,[$APP.N,$APP.X,$APP.wq,$APP.X,$APP.rt,$APP.X,$APP.os,$APP.X],null),$APP.fu,!0],null)]);
|
|
23
|
+
var cA=new $APP.M(null,4,["info",$APP.ht,"success",$APP.ws,"warning",$APP.cu,"error",$APP.fq],null),eA=new $APP.M(null,4,[$APP.ht,"info",$APP.ws,"success",$APP.cu,"warning",$APP.fq,"error"],null),vA=new $APP.M(null,4,[$APP.ht,"ℹ",$APP.ws,"✓",$APP.cu,"!",$APP.fq,"⨯"],null);$APP.fa("baredom.exports.x_toast.init",VA);export const init=VA;
|
package/dist/x-toaster.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
a.getAttribute("position"),
|
|
4
|
-
"data-position",c);a=$APP.Q(a,"__xToasterModel",b)}else a=null;return a},
|
|
5
|
-
b);$APP.Q(a,"__xToasterHandlers",{dismiss:b})},
|
|
6
|
-
"label")},enumerable:!0,configurable:!0});Object.defineProperty(a,"maxToasts",{get:function(){var b=
|
|
2
|
+
var YC=function(a){a=typeof a==="string"?a.trim().toLowerCase():null;return $APP.ed(XC,a)?a:"top-end"},ZC=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),$APP.p(isNaN(a))&&a>0?Math.floor(a):null):null},aD=function(a){if(!$APP.Vi(a,"__xToasterInitialized")){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("slot");c.textContent=$C;b.appendChild(c);b.appendChild(d);$APP.Wi(a,"__xToasterInitialized")}},dD=function(a){a=new $APP.M(null,3,[$APP.Gr,
|
|
3
|
+
a.getAttribute("position"),bD,a.getAttribute("max-toasts"),$APP.Dj,a.getAttribute("label")],null);var b=$APP.G(a),c=$APP.C(b,$APP.Gr);a=$APP.C(b,bD);b=$APP.C(b,$APP.Dj);c=YC(c);a=ZC(a);return new $APP.M(null,3,[$APP.bv,c,cD,$APP.n(a)?a:5,$APP.Wj,typeof b==="string"&&$APP.I(b.trim(),"")?b:"Notifications"],null)},eD=function(a){var b=dD(a);if($APP.I($APP.l(a,"__xToasterModel"),b)){b=$APP.G(b);var c=$APP.C(b,$APP.bv),d=$APP.C(b,$APP.Wj);aD(a);$APP.T(a,"role","region");$APP.T(a,"aria-label",d);$APP.T(a,
|
|
4
|
+
"data-position",c);a=$APP.Q(a,"__xToasterModel",b)}else a=null;return a},fD=function(a){function b(c){var d=c.detail;if($APP.I($APP.l(d,"reason"),"toaster-remove")){c.preventDefault();var e=$APP.l(d,"type"),f=$APP.l(d,"reason"),h=$APP.l(d,"heading");d=$APP.l(d,"message");e=$APP.gm(new $APP.M(null,4,[$APP.N,$APP.n(e)?e:"info",$APP.wq,$APP.n(f)?f:"",$APP.rt,$APP.n(h)?h:"",$APP.os,$APP.n(d)?d:""],null));c=$APP.jj(a,"x-toaster-dismiss",e)?c.target.dismiss("toaster-remove"):null}else c=null;return c}a.addEventListener("x-toast-dismiss",
|
|
5
|
+
b);$APP.Q(a,"__xToasterHandlers",{dismiss:b})},gD=function(a){var b=$APP.l(a,"__xToasterHandlers");$APP.n(b)&&(b=$APP.l(b,"dismiss"),$APP.n(b)&&a.removeEventListener("x-toast-dismiss",b));return $APP.Q(a,"__xToasterHandlers",null)},hD=function(a){$APP.sj(a,"position","position",YC);Object.defineProperty(a,"label",{get:function(){var b=this.getAttribute("label");return $APP.n(b)?b:"Notifications"},set:function(b){return $APP.n($APP.n(b)?$APP.I(b,""):b)?$APP.T(this,"label",""+$APP.P.i(b)):$APP.U(this,
|
|
6
|
+
"label")},enumerable:!0,configurable:!0});Object.defineProperty(a,"maxToasts",{get:function(){var b=ZC(this.getAttribute("max-toasts"));return $APP.n(b)?b:5},set:function(b){return b==null?$APP.U(this,"max-toasts"):$APP.T(this,"max-toasts",""+$APP.P.i(Math.floor(b)))},enumerable:!0,configurable:!0});return Object.defineProperty(a,"toast",{value:function(b){b=$APP.n(b)?b:{};var c=$APP.l(this,"__xToasterModel");c=$APP.n(c)?c:dD(this);var d=cD.i(c);c=this.querySelectorAll("x-toast");var e=c.length;if(e>=
|
|
7
7
|
d)for(d=e-d- -1,e=0;;)if(e<d)c[e].dismiss("toaster-remove"),e+=1;else break;c=document.createElement("x-toast");d=$APP.l(b,"type");$APP.n(d)&&$APP.T(c,"type",d);d=$APP.l(b,"heading");$APP.n(d)&&$APP.T(c,"heading",d);d=$APP.l(b,"message");$APP.n(d)&&$APP.T(c,"message",d);d=$APP.l(b,"icon");$APP.n(d)&&$APP.T(c,"icon",d);$APP.l(b,"dismissible")===!1&&$APP.T(c,"dismissible","false");d=$APP.l(b,"timeoutMs");$APP.n(d)&&$APP.T(c,"timeout-ms",""+$APP.P.i(d));$APP.n($APP.l(b,"showProgress"))&&$APP.T(c,"show-progress",
|
|
8
|
-
"");this.appendChild(c);return c},writable:!0,configurable:!0})},
|
|
8
|
+
"");this.appendChild(c);return c},writable:!0,configurable:!0})},iD=function(a){aD(a);gD(a);fD(a);return eD(a)},jD=function(a){return gD(a)},kD=function(a,b,c,d){return $APP.I(c,d)?eD(a):null},mD=function(){return $APP.zi("x-toaster",new $APP.M(null,5,[$APP.ji,lD,$APP.hi,iD,$APP.ei,jD,$APP.di,kD,$APP.ii,hD],null))},bD=new $APP.F(null,"max-toasts-raw","max-toasts-raw",-815087069),cD=new $APP.F(null,"max-toasts","max-toasts",-1982289139);var lD=["position","max-toasts","label"];$APP.je(["x-toaster-dismiss",new $APP.M(null,2,[$APP.V,new $APP.M(null,4,[$APP.N,$APP.X,$APP.wq,$APP.X,$APP.rt,$APP.X,$APP.os,$APP.X],null),$APP.fu,!0],null)]);var XC=new $APP.ch(null,new $APP.M(null,6,["top-center",null,"bottom-start",null,"bottom-end",null,"bottom-center",null,"top-end",null,"top-start",null],null),null);var $C=":host{display:flex;position:fixed;z-index:var(--x-toaster-z-index,9000);gap:var(--x-toaster-gap,8px);width:max-content;max-width:var(--x-toaster-max-width,min(480px,calc(100vw - 2rem)));box-sizing:border-box;pointer-events:none;color-scheme:light dark;}::slotted("+$APP.P.i("x-toast")+"){pointer-events:auto;}slot{display:contents;}:host([data-position\x3d'top-start']){top:var(--x-toaster-inset,16px);inset-inline-start:var(--x-toaster-inset,16px);flex-direction:column-reverse;}:host([data-position\x3d'top-center']){top:var(--x-toaster-inset,16px);left:50%;transform:translateX(-50%);flex-direction:column-reverse;align-items:center;}:host([data-position\x3d'top-end']){top:var(--x-toaster-inset,16px);inset-inline-end:var(--x-toaster-inset,16px);flex-direction:column-reverse;}:host([data-position\x3d'bottom-start']){bottom:var(--x-toaster-inset,16px);inset-inline-start:var(--x-toaster-inset,16px);flex-direction:column;}:host([data-position\x3d'bottom-center']){bottom:var(--x-toaster-inset,16px);left:50%;transform:translateX(-50%);flex-direction:column;align-items:center;}:host([data-position\x3d'bottom-end']){bottom:var(--x-toaster-inset,16px);inset-inline-end:var(--x-toaster-inset,16px);flex-direction:column;}";$APP.fa("baredom.exports.x_toaster.init",mD);export const init=mD;
|
package/dist/x-tooltip.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
$APP.D(a),$APP.
|
|
4
|
-
null))},
|
|
5
|
-
null},b))},
|
|
6
|
-
!1)},pointerleave:function(){return
|
|
7
|
-
f=0,h=0;;)if(h<f){var k=e.C(null,h),m=$APP.B(k,0,null),
|
|
8
|
-
d=document.createElement("span"),e=document.createElement("slot"),f=document.createElement("div"),h=document.createElement("div"),k=document.createElement("div"),m=document.createElement("span"),
|
|
9
|
-
$APP.T(d,"part","trigger");$APP.T(f,"part","panel");$APP.T(f,"role","tooltip");$APP.T(f,"id",u);$APP.T(f,"aria-hidden","true");$APP.T(f,"data-placement","top");$APP.T(h,"part","arrow");$APP.T(h,"aria-hidden","true");$APP.T(k,"part","body");$APP.T(m,"part","text");$APP.T(
|
|
10
|
-
panel:f,arrow:h,body:k,text:m,contentSlot:
|
|
11
|
-
$APP.l(c,
|
|
12
|
-
"show",{value:function(){return
|
|
13
|
-
null)],null);$APP.
|
|
2
|
+
var EC=function(a){a=new $APP.M(null,5,[$APP.Ll,a.getAttribute("text"),$APP.iv,a.getAttribute("placement"),BC,a.getAttribute("delay"),$APP.Ej,a.hasAttribute("disabled"),$APP.jq,a.hasAttribute("open")],null);var b=$APP.G(a),c=$APP.C(b,$APP.Ll),d=$APP.C(b,$APP.iv),e=$APP.C(b,BC);a=$APP.C(b,$APP.Ej);b=$APP.C(b,$APP.jq);c=$APP.n(c)?c:"";d=$APP.ed(CC,d)?d:"top";e!=null?(e=parseInt(e,10),e=$APP.n(isNaN(e))?400:$APP.po.j($APP.Wo.j(e,0),5E3)):e=400;return new $APP.M(null,5,[$APP.Zl,c,$APP.Ar,d,DC,e,$APP.Xj,
|
|
3
|
+
$APP.D(a),$APP.Hu,$APP.D(b)],null)},FC=function(a){var b=EC(a);if($APP.I($APP.l(a,"__xTooltipModel"),b)){b=$APP.G(b);var c=$APP.C(b,$APP.Zl),d=$APP.C(b,$APP.Ar),e=$APP.C(b,$APP.Hu),f=$APP.l(a,"__xTooltipRefs");if($APP.n(f)){var h=$APP.l(f,"panel");f=$APP.l(f,"text");$APP.T(h,"data-placement",d);$APP.T(h,"aria-hidden",""+$APP.P.i($APP.p(e)));f.textContent=c;$APP.Q(a,"__xTooltipModel",b)}}},GC=function(a){var b=$APP.l(a,"__xTooltipShowTimer");$APP.n(b)&&(clearTimeout(b),$APP.Q(a,"__xTooltipShowTimer",
|
|
4
|
+
null))},HC=function(a,b){if($APP.n(a.hasAttribute("disabled")))return null;GC(a);if($APP.n($APP.n(b)?b:a.hasAttribute("open"))){if($APP.n(a.hasAttribute("open")))return null;$APP.T(a,"open","");return $APP.hj(a,"x-tooltip-show",{})}b=EC(a);b=$APP.G(b);b=$APP.C(b,DC);return b===0?($APP.T(a,"open",""),$APP.hj(a,"x-tooltip-show",{})):$APP.Q(a,"__xTooltipShowTimer",setTimeout(function(){$APP.Q(a,"__xTooltipShowTimer",null);return $APP.n(a.isConnected)?($APP.T(a,"open",""),$APP.hj(a,"x-tooltip-show",{})):
|
|
5
|
+
null},b))},IC=function(a){GC(a);return $APP.n(a.hasAttribute("open"))?($APP.U(a,"open"),$APP.hj(a,"x-tooltip-hide",{})):null},JC=function(a){var b=$APP.l(a,"__xTooltipRefs");if($APP.n(b)){var c=$APP.l(b,"triggerSlot").assignedElements();b=$APP.l(a,"__xTooltipId");var d=$APP.l(a,"__xTooltipTriggerEl");$APP.n(d)&&($APP.U(d,"aria-describedby"),$APP.Q(a,"__xTooltipTriggerEl",null));if(c.length>0)return c=c[0],$APP.T(c,"aria-describedby",b),$APP.Q(a,"__xTooltipTriggerEl",c)}return null},KC=function(a){return{pointerenter:function(){return HC(a,
|
|
6
|
+
!1)},pointerleave:function(){return IC(a)},focusin:function(){return HC(a,!0)},focusout:function(b){b=b.relatedTarget;return b==null||$APP.p(a.contains(b))?IC(a):null},keydown:function(b){b=$APP.z.j(b.key,"Escape");return $APP.n(b?a.hasAttribute("open"):b)?IC(a):null},slotchange:function(){return JC(a)}}},MC=function(a,b,c){return $APP.z.j(c,LC)?a:$APP.l(b,c)},OC=function(a){var b=$APP.l(a,"__xTooltipRefs");if($APP.n(b)){var c=$APP.l(a,"__xTooltipHandlers");if($APP.n(c))for(var d=$APP.q(NC),e=null,
|
|
7
|
+
f=0,h=0;;)if(h<f){var k=e.C(null,h),m=$APP.B(k,0,null),r=$APP.B(k,1,null);k=$APP.B(k,2,null);MC(a,b,m).removeEventListener(r,$APP.l(c,k));h+=1}else if(d=$APP.q(d))$APP.$c(d)?(r=$APP.Fb(d),d=$APP.Gb(d),m=r,r=$APP.w(r),e=m,f=r):(e=$APP.t(d),m=$APP.B(e,0,null),r=$APP.B(e,1,null),k=$APP.B(e,2,null),MC(a,b,m).removeEventListener(r,$APP.l(c,k)),d=$APP.v(d),e=null,f=0),h=0;else break}},QC=function(a){if(!$APP.n($APP.l(a,"__xTooltipRefs"))){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),
|
|
8
|
+
d=document.createElement("span"),e=document.createElement("slot"),f=document.createElement("div"),h=document.createElement("div"),k=document.createElement("div"),m=document.createElement("span"),r=document.createElement("slot");var u=$APP.l(PC,"n")+1;PC.n=u;u="x-tt-"+$APP.P.i(u);c.textContent=":host{display:inline-block;position:relative;color-scheme:light dark;--x-tooltip-bg:var(--x-color-bg,#ffffff);--x-tooltip-text:var(--x-color-text,#0f172a);--x-tooltip-border:1px solid var(--x-color-border,#e2e8f0);--x-tooltip-padding:var(--x-space-xs,4px) var(--x-space-sm,8px);--x-tooltip-radius:var(--x-radius-md,6px);--x-tooltip-shadow:var(--x-shadow-md,0 4px 16px rgba(0,0,0,0.12));--x-tooltip-z:var(--x-z-dropdown,1000);--x-tooltip-max-width:min(280px,calc(100vw - 2rem));--x-tooltip-font-size:var(--x-font-size-xs,0.75rem);--x-tooltip-arrow-size:6px;--x-tooltip-offset:4px;--x-tooltip-transition-duration:var(--x-transition-duration,150ms);--x-tooltip-transition-easing:var(--x-transition-easing,ease);}@media (prefers-color-scheme:dark){:host{--x-tooltip-bg:var(--x-color-bg,#1e293b);--x-tooltip-text:var(--x-color-text,#e2e8f0);--x-tooltip-border:1px solid var(--x-color-border,#334155);--x-tooltip-shadow:0 4px 24px rgba(0,0,0,0.4);}}[part\x3dtrigger]{display:inline-block;}[part\x3dpanel]{position:absolute;z-index:var(--x-tooltip-z);box-sizing:border-box;background:var(--x-tooltip-bg);color:var(--x-tooltip-text);border:var(--x-tooltip-border);padding:var(--x-tooltip-padding);border-radius:var(--x-tooltip-radius);box-shadow:var(--x-tooltip-shadow);max-width:var(--x-tooltip-max-width);font-size:var(--x-tooltip-font-size);font-family:inherit;line-height:1.4;white-space:normal;word-wrap:break-word;pointer-events:none;visibility:hidden;opacity:0;transition:opacity var(--x-tooltip-transition-duration) var(--x-tooltip-transition-easing),transform var(--x-tooltip-transition-duration) var(--x-tooltip-transition-easing),visibility 0s var(--x-tooltip-transition-duration);}:host([open]) [part\x3dpanel]{visibility:visible;opacity:1;transition:opacity var(--x-tooltip-transition-duration) var(--x-tooltip-transition-easing),transform var(--x-tooltip-transition-duration) var(--x-tooltip-transition-easing),visibility 0s 0s;}[part\x3dpanel][data-placement\x3dtop]{bottom:calc(100% + var(--x-tooltip-arrow-size) + var(--x-tooltip-offset));left:50%;transform:translateX(-50%) translateY(4px);transform-origin:bottom center;}:host([open]) [part\x3dpanel][data-placement\x3dtop]{transform:translateX(-50%) translateY(0);}[part\x3dpanel][data-placement\x3dbottom]{top:calc(100% + var(--x-tooltip-arrow-size) + var(--x-tooltip-offset));left:50%;transform:translateX(-50%) translateY(-4px);transform-origin:top center;}:host([open]) [part\x3dpanel][data-placement\x3dbottom]{transform:translateX(-50%) translateY(0);}[part\x3dpanel][data-placement\x3dleft]{right:calc(100% + var(--x-tooltip-arrow-size) + var(--x-tooltip-offset));top:50%;transform:translateY(-50%) translateX(4px);transform-origin:center right;}:host([open]) [part\x3dpanel][data-placement\x3dleft]{transform:translateY(-50%) translateX(0);}[part\x3dpanel][data-placement\x3dright]{left:calc(100% + var(--x-tooltip-arrow-size) + var(--x-tooltip-offset));top:50%;transform:translateY(-50%) translateX(-4px);transform-origin:center left;}:host([open]) [part\x3dpanel][data-placement\x3dright]{transform:translateY(-50%) translateX(0);}[part\x3darrow]{position:absolute;width:var(--x-tooltip-arrow-size);height:var(--x-tooltip-arrow-size);background:var(--x-tooltip-bg);border:var(--x-tooltip-border);transform:rotate(45deg);pointer-events:none;}[part\x3dpanel][data-placement\x3dtop] [part\x3darrow]{bottom:calc(var(--x-tooltip-arrow-size) / -2);left:calc(50% - var(--x-tooltip-arrow-size) / 2);border-top:none;border-left:none;}[part\x3dpanel][data-placement\x3dbottom] [part\x3darrow]{top:calc(var(--x-tooltip-arrow-size) / -2);left:calc(50% - var(--x-tooltip-arrow-size) / 2);border-bottom:none;border-right:none;}[part\x3dpanel][data-placement\x3dleft] [part\x3darrow]{right:calc(var(--x-tooltip-arrow-size) / -2);top:calc(50% - var(--x-tooltip-arrow-size) / 2);border-bottom:none;border-left:none;}[part\x3dpanel][data-placement\x3dright] [part\x3darrow]{left:calc(var(--x-tooltip-arrow-size) / -2);top:calc(50% - var(--x-tooltip-arrow-size) / 2);border-top:none;border-right:none;}[part\x3dbody]{position:relative;}@media (prefers-reduced-motion:reduce){[part\x3dpanel]{transition:none !important;}}";
|
|
9
|
+
$APP.T(d,"part","trigger");$APP.T(f,"part","panel");$APP.T(f,"role","tooltip");$APP.T(f,"id",u);$APP.T(f,"aria-hidden","true");$APP.T(f,"data-placement","top");$APP.T(h,"part","arrow");$APP.T(h,"aria-hidden","true");$APP.T(k,"part","body");$APP.T(m,"part","text");$APP.T(r,"name","content");d.appendChild(e);k.appendChild(m);k.appendChild(r);f.appendChild(h);f.appendChild(k);b.appendChild(c);b.appendChild(d);b.appendChild(f);$APP.Q(a,"__xTooltipId",u);$APP.Q(a,"__xTooltipRefs",{trigger:d,triggerSlot:e,
|
|
10
|
+
panel:f,arrow:h,body:k,text:m,contentSlot:r})}OC(a);$APP.Q(a,"__xTooltipHandlers",KC(a));a:if(b=$APP.l(a,"__xTooltipRefs"),$APP.n(b)&&(c=$APP.l(a,"__xTooltipHandlers"),$APP.n(c)))for(d=$APP.q(NC),h=null,m=k=0;;)if(m<k)r=h.C(null,m),e=$APP.B(r,0,null),f=$APP.B(r,1,null),r=$APP.B(r,2,null),MC(a,b,e).addEventListener(f,$APP.l(c,r)),m+=1;else if(d=$APP.q(d))$APP.$c(d)?(f=$APP.Fb(d),d=$APP.Gb(d),e=f,f=$APP.w(f),h=e,k=f):(h=$APP.t(d),e=$APP.B(h,0,null),f=$APP.B(h,1,null),r=$APP.B(h,2,null),MC(a,b,e).addEventListener(f,
|
|
11
|
+
$APP.l(c,r)),d=$APP.v(d),h=null,k=0),m=0;else break a;FC(a);return JC(a)},RC=function(a){GC(a);OC(a);var b=$APP.l(a,"__xTooltipTriggerEl");$APP.n(b)?($APP.U(b,"aria-describedby"),a=$APP.Q(a,"__xTooltipTriggerEl",null)):a=null;return a},SC=function(a,b,c,d){return $APP.n(function(){var e=$APP.I(c,d);return e?$APP.l(a,"__xTooltipRefs"):e}())?(FC(a),$APP.n(function(){var e=a.hasAttribute("disabled");return $APP.n(e)?a.hasAttribute("open"):e}())?IC(a):null):null},UC=function(a){$APP.xj(a,TC);Object.defineProperty(a,
|
|
12
|
+
"show",{value:function(){return HC(this,!0)},writable:!0,configurable:!0});return Object.defineProperty(a,"hide",{value:function(){return IC(this)},writable:!0,configurable:!0})},WC=function(){return $APP.zi("x-tooltip",new $APP.M(null,5,[$APP.ji,VC,$APP.hi,QC,$APP.ei,RC,$APP.di,SC,$APP.ii,UC],null))},DC=new $APP.F(null,"delay","delay",-574225219),LC=new $APP.F(null,"host","host",-1558485167),BC=new $APP.F(null,"delay-raw","delay-raw",886290425);var CC=new $APP.ch(null,new $APP.M(null,4,["right",null,"top",null,"bottom",null,"left",null],null),null),VC=["text","placement","delay","disabled","open"],TC=new $APP.M(null,5,[$APP.Zl,new $APP.M(null,2,[$APP.N,$APP.X,$APP.W,"text"],null),$APP.Ar,new $APP.M(null,2,[$APP.N,$APP.X,$APP.W,"placement"],null),DC,new $APP.M(null,3,[$APP.N,$APP.Y,$APP.W,"delay",$APP.wj,400],null),$APP.zm,new $APP.M(null,2,[$APP.N,$APP.vj,$APP.W,"disabled"],null),$APP.bu,new $APP.M(null,2,[$APP.N,$APP.vj,$APP.W,"open"],
|
|
13
|
+
null)],null);$APP.je(["x-tooltip-show",new $APP.M(null,2,[$APP.fu,!1,$APP.V,$APP.ke],null),"x-tooltip-hide",new $APP.M(null,2,[$APP.fu,!1,$APP.V,$APP.ke],null)]);var PC={n:0},NC=new $APP.J(null,6,5,$APP.K,[new $APP.J(null,3,5,$APP.K,[LC,"pointerenter","pointerenter"],null),new $APP.J(null,3,5,$APP.K,[LC,"pointerleave","pointerleave"],null),new $APP.J(null,3,5,$APP.K,[LC,"focusin","focusin"],null),new $APP.J(null,3,5,$APP.K,[LC,"focusout","focusout"],null),new $APP.J(null,3,5,$APP.K,[LC,"keydown","keydown"],null),new $APP.J(null,3,5,$APP.K,["triggerSlot","slotchange","slotchange"],null)],null);$APP.fa("baredom.exports.x_tooltip.init",WC);export const init=WC;
|