@vanelsas/baredom 2.4.1 → 2.5.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 +11 -0
- package/README.md +83 -5
- package/custom-elements.json +7338 -0
- package/dist/baredom.d.ts +97 -0
- package/dist/base.js +53 -53
- package/dist/integrity.json +87 -87
- package/dist/x-alert.d.ts +43 -0
- package/dist/x-alert.js +16 -16
- package/dist/x-avatar-group.d.ts +18 -0
- package/dist/x-avatar-group.js +10 -10
- package/dist/x-avatar.d.ts +21 -0
- package/dist/x-avatar.js +2 -2
- package/dist/x-badge.d.ts +19 -0
- package/dist/x-badge.js +7 -7
- package/dist/x-bento-grid.d.ts +12 -0
- package/dist/x-bento-grid.js +2 -2
- package/dist/x-bento-item.d.ts +12 -0
- package/dist/x-bento-item.js +4 -4
- package/dist/x-breadcrumbs.d.ts +20 -0
- package/dist/x-breadcrumbs.js +14 -14
- package/dist/x-button.d.ts +45 -0
- package/dist/x-button.js +4 -4
- package/dist/x-cancel-dialogue.d.ts +50 -0
- package/dist/x-cancel-dialogue.js +12 -12
- package/dist/x-card.d.ts +39 -0
- package/dist/x-card.js +3 -3
- package/dist/x-carousel.d.ts +48 -0
- package/dist/x-carousel.js +28 -28
- package/dist/x-chart.d.ts +23 -0
- package/dist/x-chart.js +28 -28
- package/dist/x-checkbox.d.ts +45 -0
- package/dist/x-checkbox.js +6 -6
- package/dist/x-chip.d.ts +41 -0
- package/dist/x-chip.js +8 -8
- package/dist/x-collapse.d.ts +42 -0
- package/dist/x-collapse.js +1 -1
- package/dist/x-color-picker.d.ts +47 -0
- package/dist/x-color-picker.js +40 -40
- package/dist/x-combobox.d.ts +46 -0
- package/dist/x-combobox.js +24 -24
- package/dist/x-command-palette.d.ts +46 -0
- package/dist/x-command-palette.js +24 -24
- package/dist/x-container.d.ts +14 -0
- package/dist/x-container.js +2 -2
- package/dist/x-context-menu.d.ts +17 -0
- package/dist/x-context-menu.js +9 -9
- package/dist/x-copy.d.ts +51 -0
- package/dist/x-copy.js +6 -6
- package/dist/x-currency-field.d.ts +51 -0
- package/dist/x-currency-field.js +9 -8
- package/dist/x-date-picker.d.ts +20 -0
- package/dist/x-date-picker.js +8 -8
- package/dist/x-divider.d.ts +20 -0
- package/dist/x-divider.js +3 -3
- package/dist/x-drawer.d.ts +44 -0
- package/dist/x-drawer.js +3 -3
- package/dist/x-dropdown.d.ts +42 -0
- package/dist/x-dropdown.js +9 -9
- package/dist/x-fieldset.d.ts +14 -0
- package/dist/x-fieldset.js +2 -2
- package/dist/x-file-download.d.ts +40 -0
- package/dist/x-file-download.js +7 -7
- package/dist/x-file-upload.d.ts +46 -0
- package/dist/x-file-upload.js +22 -22
- package/dist/x-form-field.d.ts +47 -0
- package/dist/x-form-field.js +6 -6
- package/dist/x-form.d.ts +41 -0
- package/dist/x-form.js +3 -3
- package/dist/x-gaussian-blur.d.ts +20 -0
- package/dist/x-gaussian-blur.js +6 -6
- package/dist/x-grid.d.ts +12 -0
- package/dist/x-grid.js +3 -3
- package/dist/x-icon.d.ts +15 -0
- package/dist/x-icon.js +2 -2
- package/dist/x-image.d.ts +48 -0
- package/dist/x-image.js +6 -6
- package/dist/x-kinetic-font.d.ts +48 -0
- package/dist/x-kinetic-font.js +11 -11
- package/dist/x-kinetic-typography.d.ts +27 -0
- package/dist/x-kinetic-typography.js +20 -20
- package/dist/x-liquid-dock.d.ts +47 -0
- package/dist/x-liquid-dock.js +35 -35
- package/dist/x-liquid-fill.d.ts +46 -0
- package/dist/x-liquid-fill.js +18 -18
- package/dist/x-liquid-glass.d.ts +25 -0
- package/dist/x-liquid-glass.js +10 -10
- package/dist/x-menu-item.d.ts +41 -0
- package/dist/x-menu.d.ts +42 -0
- package/dist/x-menu.js +1 -1
- package/dist/x-metaball-cursor.d.ts +21 -0
- package/dist/x-metaball-cursor.js +9 -9
- package/dist/x-modal.d.ts +44 -0
- package/dist/x-modal.js +2 -2
- package/dist/x-morph-stack.d.ts +46 -0
- package/dist/x-morph-stack.js +39 -39
- package/dist/x-navbar.d.ts +46 -0
- package/dist/x-navbar.js +3 -3
- package/dist/x-neural-glow.d.ts +22 -0
- package/dist/x-neural-glow.js +2 -2
- package/dist/x-notification-center.d.ts +42 -0
- package/dist/x-notification-center.js +10 -10
- package/dist/x-organic-divider.d.ts +19 -0
- package/dist/x-organic-progress.d.ts +45 -0
- package/dist/x-organic-progress.js +9 -9
- package/dist/x-organic-shape.d.ts +18 -0
- package/dist/x-pagination.d.ts +44 -0
- package/dist/x-pagination.js +1 -1
- package/dist/x-particle-button.d.ts +47 -0
- package/dist/x-particle-button.js +7 -7
- package/dist/x-popover.d.ts +45 -0
- package/dist/x-popover.js +23 -23
- package/dist/x-progress-circle.d.ts +41 -0
- package/dist/x-progress-circle.js +3 -3
- package/dist/x-progress.d.ts +44 -0
- package/dist/x-progress.js +3 -3
- package/dist/x-radio.d.ts +44 -0
- package/dist/x-radio.js +11 -11
- package/dist/x-ripple-effect.d.ts +42 -0
- package/dist/x-ripple-effect.js +5 -5
- package/dist/x-scroll-parallax.d.ts +45 -0
- package/dist/x-scroll-parallax.js +3 -3
- package/dist/x-scroll-stack.d.ts +46 -0
- package/dist/x-scroll-stack.js +6 -6
- package/dist/x-scroll-story.d.ts +56 -0
- package/dist/x-scroll-story.js +14 -14
- package/dist/x-scroll-timeline.d.ts +58 -0
- package/dist/x-scroll-timeline.js +43 -43
- package/dist/x-scroll.d.ts +51 -0
- package/dist/x-scroll.js +14 -14
- package/dist/x-search-field.d.ts +47 -0
- package/dist/x-search-field.js +15 -14
- package/dist/x-select.d.ts +40 -0
- package/dist/x-select.js +3 -3
- package/dist/x-sidebar.d.ts +40 -0
- package/dist/x-sidebar.js +8 -8
- package/dist/x-skeleton-group.d.ts +15 -0
- package/dist/x-skeleton-group.js +5 -5
- package/dist/x-skeleton.d.ts +16 -0
- package/dist/x-slider.d.ts +48 -0
- package/dist/x-slider.js +5 -5
- package/dist/x-soft-body.d.ts +44 -0
- package/dist/x-soft-body.js +5 -5
- package/dist/x-spacer.d.ts +15 -0
- package/dist/x-spacer.js +1 -1
- package/dist/x-spinner.d.ts +15 -0
- package/dist/x-splash.d.ts +42 -0
- package/dist/x-splash.js +3 -3
- package/dist/x-stat.d.ts +21 -0
- package/dist/x-stat.js +6 -6
- package/dist/x-stepper.d.ts +42 -0
- package/dist/x-stepper.js +14 -14
- package/dist/x-switch.d.ts +44 -0
- package/dist/x-switch.js +5 -5
- package/dist/x-tab.d.ts +40 -0
- package/dist/x-tab.js +7 -7
- package/dist/x-table-cell.d.ts +50 -0
- package/dist/x-table-cell.js +5 -5
- package/dist/x-table-row.d.ts +43 -0
- package/dist/x-table-row.js +10 -10
- package/dist/x-table.d.ts +124 -0
- package/dist/x-table.js +3 -3
- package/dist/x-tabs.d.ts +70 -0
- package/dist/x-tabs.js +2 -2
- package/dist/x-text-area.d.ts +47 -0
- package/dist/x-text-area.js +7 -7
- package/dist/x-theme.d.ts +15 -0
- package/dist/x-timeline-item.d.ts +46 -0
- package/dist/x-timeline-item.js +19 -19
- package/dist/x-timeline.d.ts +78 -0
- package/dist/x-timeline.js +3 -3
- package/dist/x-toast.d.ts +45 -0
- package/dist/x-toast.js +21 -21
- package/dist/x-toaster.d.ts +41 -0
- package/dist/x-toaster.js +8 -8
- package/dist/x-tooltip.d.ts +43 -0
- package/dist/x-tooltip.js +12 -12
- package/dist/x-typography.d.ts +16 -0
- package/dist/x-typography.js +1 -1
- package/dist/x-welcome-tour.d.ts +92 -0
- package/dist/x-welcome-tour.js +56 -56
- package/package.json +502 -392
package/dist/x-timeline-item.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
b){a=$APP.D(
|
|
4
|
-
$APP.Ti),p=$APP.D(b,
|
|
5
|
-
$APP.zk,$APP.U,
|
|
2
|
+
var Dn=function(a){a=$APP.D(Cn,typeof a==="string"?a.toLowerCase():null);return $APP.n(a)?a:$APP.ji},Fn=function(a){a=$APP.D(En,a);return $APP.n(a)?a:"pending"},In=function(a){a=$APP.D(Gn,typeof a==="string"?a.toLowerCase():null);return $APP.n(a)?a:Hn},Jn=function(a){return typeof a==="string"?(a=a.trim(),$APP.N(a,"")&&$APP.N(a.toLowerCase(),"none")?a:null):null},Kn=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),typeof a==="number"&&$APP.r(isNaN(a))&&a>=0?a:null):null},Mn=function(a,
|
|
3
|
+
b){a=$APP.D(Ln,typeof a==="string"?a.toLowerCase():null);$APP.n(a)?b=a:(b=$APP.D(Ln,typeof b==="string"?b.toLowerCase():null),b=$APP.n(b)?b:$APP.lm);return b},Nn=function(a,b,c){a=Fn(a);c=c!=null?"Step "+$APP.T.g(c+1)+": ":null;return""+$APP.T.g(c)+$APP.T.g(typeof b==="string"&&$APP.N(b,"")?""+$APP.T.g(b)+" ":null)+"("+$APP.T.g(a)+")"},Xn=function(a){var b=$APP.M(a),c=$APP.D(b,On);a=$APP.D(b,$APP.X);var d=$APP.D(b,$APP.Xj),e=$APP.D(b,$APP.pi),g=$APP.D(b,Pn),h=$APP.D(b,$APP.Di),l=$APP.D(b,Qn),m=$APP.D(b,
|
|
4
|
+
$APP.Ti),p=$APP.D(b,Rn),q=$APP.D(b,$APP.Uh),v=$APP.D(b,$APP.uk);b=$APP.D(b,$APP.Dj);var x=Dn(m),y=Jn(b),A=$APP.n($APP.n(q)?y==null:q)?$APP.an:y!=null?$APP.Dl:$APP.li;m=function(){var C=A instanceof $APP.K?A.pa:null;switch(C){case "default":return C=$APP.D(Sn,x),$APP.n(C)?C:$APP.D(Sn,$APP.ji);case "custom":return y;case "hidden":return null;default:throw Error("No matching clause: "+$APP.T.g(C));}}();c=Kn(c);d=Mn(l,d);e=$APP.n(e)?e:"";v=$APP.n(v)?v:"";return $APP.zf([$APP.ri,Tn,Un,Pn,Rn,$APP.Qk,$APP.xi,
|
|
5
|
+
$APP.zk,$APP.U,Vn,$APP.rk,$APP.X,Wn],[In(h),c,m,$APP.F(g),$APP.F(p),$APP.B.i(A,$APP.Dl)?y:null,v,x,e,Nn(x,e,c),A,$APP.F(a),d])},Yn=function(a){a=$APP.M(a);a=$APP.D(a,$APP.X);return $APP.r(a)},io=function(a){var b=$APP.k(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"),g=document.createElement("slot"),h=document.createElement("span"),l=document.createElement("div"),m=
|
|
6
6
|
document.createElement("div"),p=document.createElement("slot"),q=document.createElement("span"),v=document.createElement("div"),x=document.createElement("div"),y=document.createElement("div"),A=document.createElement("div"),C=document.createElement("slot"),E=document.createElement("div"),H=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
7
|
d.setAttribute("class","timeline-item");e.setAttribute("class","label-col");g.setAttribute("name","label");h.setAttribute("class","label-text");g.appendChild(h);e.appendChild(g);l.setAttribute("class","track-col");m.setAttribute("class","marker");p.setAttribute("name","icon");q.setAttribute("class","default-icon");q.setAttribute("aria-hidden","true");p.appendChild(q);m.appendChild(p);v.setAttribute("class","connector");l.appendChild(m);l.appendChild(v);x.setAttribute("class","content-col");y.setAttribute("class",
|
|
8
|
-
"title");A.setAttribute("class","body");A.appendChild(C);E.setAttribute("class","actions");H.setAttribute("name","actions");E.appendChild(H);x.appendChild(y);x.appendChild(A);x.appendChild(E);d.appendChild(e);d.appendChild(l);d.appendChild(x);b.appendChild(c);b.appendChild(d);b=$APP.zf([$APP.ri,
|
|
9
|
-
$APP.pi,
|
|
10
|
-
d=$APP.D(b,$APP.xi),e=$APP.D(b,$APP.zk),g=$APP.D(b,
|
|
11
|
-
a.setAttribute("role","listitem");$APP.n(h)?(a.setAttribute("aria-disabled","true"),a.tabIndex=-1):(a.removeAttribute("aria-disabled"),a.tabIndex=0);e=$APP.N(d,"")?d:$APP.N(c,"")?c:null;$APP.n(e)?a.setAttribute("aria-label",e):a.removeAttribute("aria-label");v.setAttribute("aria-label",m);p.textContent=c;q.textContent=l!=null?l:"";$APP.N(d,"")?(x.removeAttribute("hidden"),x.textContent=d):(x.setAttribute("hidden",""),x.textContent="");a.__xTimelineItemModel=b}},
|
|
12
|
-
(a.__xTimelineItemEntered=!0,a.setAttribute("data-entering",""),a.addEventListener("animationend",function d(c){return $APP.B.i(c.target,a)?(a.removeEventListener("animationend",d),a.removeAttribute("data-entering")):null}))},
|
|
13
|
-
composed:!0,cancelable:!0}))},
|
|
14
|
-
$APP.k(b,"click");b=$APP.k(b,"keydown");$APP.n(c)&&a.removeEventListener("click",c);$APP.n(b)&&a.removeEventListener("keydown",b)}a.__xTimelineItemHandlers=null},
|
|
8
|
+
"title");A.setAttribute("class","body");A.appendChild(C);E.setAttribute("class","actions");H.setAttribute("name","actions");E.appendChild(H);x.appendChild(y);x.appendChild(A);x.appendChild(E);d.appendChild(e);d.appendChild(l);d.appendChild(x);b.appendChild(c);b.appendChild(d);b=$APP.zf([$APP.ri,Zn,$APP.Rk,$APP.Vm,$n,ao,$APP.Jm,bo,$APP.Hi,co,$APP.Tk,eo,fo,go,$APP.uj,ho],[v,h,m,q,e,l,A,C,b,H,y,x,d,E,p,g]);a.__xTimelineItemRefs=b;return $APP.k(a,"__xTimelineItemRefs")},jo=function(a){return Xn($APP.zf([$APP.Xj,
|
|
9
|
+
$APP.pi,Pn,$APP.Di,Qn,$APP.Ti,Rn,$APP.Uh,$APP.uk,$APP.Dj,On,$APP.X],[a.getAttribute("position"),a.getAttribute("label"),a.hasAttribute("data-striped"),a.getAttribute("connector"),$APP.k(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")]))},mo=function(a){var b=jo(a);if($APP.N($APP.k(a,"__xTimelineItemModel"),b)){b=$APP.M(b);var c=$APP.D(b,$APP.U),
|
|
10
|
+
d=$APP.D(b,$APP.xi),e=$APP.D(b,$APP.zk),g=$APP.D(b,Wn),h=$APP.D(b,$APP.X),l=$APP.D(b,Un),m=$APP.D(b,Vn),p=io(a),q=$APP.M(p);p=$APP.D(q,Zn);var v=$APP.D(q,$APP.Rk),x=$APP.D(q,$APP.Tk);q=$APP.D(q,$APP.Vm);a.setAttribute("data-status",Fn(e));a.__xTimelineItemSelfPos=!0;a.setAttribute("data-position",$APP.Yf(g));a.__xTimelineItemSelfPos=null;$APP.B.i($APP.ri.g(b),ko)?a.setAttribute("data-connector","dashed"):$APP.B.i($APP.ri.g(b),lo)?a.setAttribute("data-connector","none"):a.removeAttribute("data-connector");
|
|
11
|
+
a.setAttribute("role","listitem");$APP.n(h)?(a.setAttribute("aria-disabled","true"),a.tabIndex=-1):(a.removeAttribute("aria-disabled"),a.tabIndex=0);e=$APP.N(d,"")?d:$APP.N(c,"")?c:null;$APP.n(e)?a.setAttribute("aria-label",e):a.removeAttribute("aria-label");v.setAttribute("aria-label",m);p.textContent=c;q.textContent=l!=null?l:"";$APP.N(d,"")?(x.removeAttribute("hidden"),x.textContent=d):(x.setAttribute("hidden",""),x.textContent="");a.__xTimelineItemModel=b}},no=function(a){$APP.n($APP.k(a,"__xTimelineItemEntered"))||
|
|
12
|
+
(a.__xTimelineItemEntered=!0,a.setAttribute("data-entering",""),a.addEventListener("animationend",function d(c){return $APP.B.i(c.target,a)?(a.removeEventListener("animationend",d),a.removeAttribute("data-entering")):null}))},oo=function(a){var b=$APP.k(a,"__xTimelineItemModel");var c=$APP.n(b)?b:jo(a);b=a.dispatchEvent;var d=CustomEvent,e=$APP.M(c);c=$APP.D(e,$APP.zk);e=$APP.D(e,$APP.U);c=new $APP.R(null,2,[$APP.zk,Fn(c),$APP.U,e],null);b.call(a,new d("x-timeline-item-click",{detail:$APP.Hh(c),bubbles:!0,
|
|
13
|
+
composed:!0,cancelable:!0}))},po=function(a){function b(d){var e=d.key;if($APP.B.i(e,"Enter")||$APP.B.i(e," "))e=$APP.k(a,"__xTimelineItemModel"),e=$APP.n(e)?e:jo(a),Yn(e)&&(d.preventDefault(),oo(a));return null}function c(){var d=$APP.k(a,"__xTimelineItemModel");d=$APP.n(d)?d:jo(a);Yn(d)&&oo(a);return null}a.addEventListener("click",c);a.addEventListener("keydown",b);$APP.ja(a,"__xTimelineItemHandlers",{click:c,keydown:b})},qo=function(a){var b=$APP.k(a,"__xTimelineItemHandlers");if($APP.n(b)){var c=
|
|
14
|
+
$APP.k(b,"click");b=$APP.k(b,"keydown");$APP.n(c)&&a.removeEventListener("click",c);$APP.n(b)&&a.removeEventListener("keydown",b)}a.__xTimelineItemHandlers=null},ro=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});Object.defineProperty(a,"title",{get:function(){var b=this.getAttribute("title");
|
|
15
15
|
return $APP.n(b)?b:""},set:function(b){return $APP.n($APP.n(b)?$APP.N(b,""):b)?this.setAttribute("title",""+$APP.T.g(b)):this.removeAttribute("title")},enumerable:!0,configurable:!0});Object.defineProperty(a,"status",{get:function(){var b=this.getAttribute("status");return $APP.n(b)?b:"pending"},set:function(b){return $APP.n(b)?this.setAttribute("status",""+$APP.T.g(b)):this.removeAttribute("status")},enumerable:!0,configurable:!0});Object.defineProperty(a,"icon",{get:function(){return this.getAttribute("icon")},
|
|
16
16
|
set:function(b){return $APP.n(b)?this.setAttribute("icon",""+$APP.T.g(b)):this.removeAttribute("icon")},enumerable:!0,configurable:!0});Object.defineProperty(a,"connector",{get:function(){var b=this.getAttribute("connector");return $APP.n(b)?b:"solid"},set:function(b){return $APP.n(b)?this.setAttribute("connector",""+$APP.T.g(b)):this.removeAttribute("connector")},enumerable:!0,configurable:!0});Object.defineProperty(a,"position",{get:function(){var b=this.getAttribute("position");return $APP.n(b)?
|
|
17
|
-
b:"start"},set:function(b){return $APP.n(b)?this.setAttribute("position",""+$APP.T.g(b)):this.removeAttribute("position")},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,configurable:!0})},
|
|
18
|
-
|
|
19
|
-
a.prototype.disconnectedCallback=function(){var b=$APP.k(this,"__xTimelineItemModel");var c=$APP.n(b)?b:
|
|
20
|
-
"data-position"),c=!$APP.n(c?$APP.k(this,"__xTimelineItemSelfPos"):c);c&&($APP.B.i(b,"data-position")&&(this.__xTimelineItemParentPos=d),
|
|
21
|
-
"label-col","label-col",1883390160),
|
|
22
|
-
"solid","solid",-2023773691),
|
|
23
|
-
$APP.Pd(["x-timeline-item-connected",new $APP.R(null,2,[$APP.V,new $APP.R(null,4,[$APP.zk,$APP.Y,$APP.U,$APP.Y,$APP.
|
|
24
|
-
var
|
|
17
|
+
b:"start"},set:function(b){return $APP.n(b)?this.setAttribute("position",""+$APP.T.g(b)):this.removeAttribute("position")},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,configurable:!0})},to=function(){var a=class extends HTMLElement{};a.observedAttributes=so;a.prototype.connectedCallback=function(){io(this);qo(this);
|
|
18
|
+
po(this);var b=this.getAttribute("data-position");$APP.n(b)&&(this.__xTimelineItemParentPos=b);mo(this);no(this);b=$APP.k(this,"__xTimelineItemModel");var c=$APP.n(b)?b:jo(this);b=this.dispatchEvent;var d=CustomEvent,e=$APP.M(c);c=$APP.D(e,$APP.zk);var g=$APP.D(e,$APP.U),h=$APP.D(e,Wn);e=$APP.D(e,$APP.X);c=new $APP.R(null,4,[$APP.zk,Fn(c),$APP.U,g,$APP.bn,$APP.Yf(h),$APP.Pj,$APP.F(e)],null);b.call(this,new d("x-timeline-item-connected",{detail:$APP.Hh(c),bubbles:!0,composed:!0,cancelable:!1}));return null};
|
|
19
|
+
a.prototype.disconnectedCallback=function(){var b=$APP.k(this,"__xTimelineItemModel");var c=$APP.n(b)?b:jo(this);qo(this);this.__xTimelineItemEntered=null;b=document;var d=b.dispatchEvent,e=CustomEvent,g=$APP.M(c);c=$APP.D(g,$APP.zk);g=$APP.D(g,$APP.U);c=new $APP.R(null,2,[$APP.zk,Fn(c),$APP.U,g],null);d.call(b,new e("x-timeline-item-disconnected",{detail:$APP.Hh(c),bubbles:!1,composed:!1,cancelable:!1}));return null};a.prototype.attributeChangedCallback=function(b,c,d){if(c=$APP.N(c,d))c=$APP.B.i(b,
|
|
20
|
+
"data-position"),c=!$APP.n(c?$APP.k(this,"__xTimelineItemSelfPos"):c);c&&($APP.B.i(b,"data-position")&&(this.__xTimelineItemParentPos=d),mo(this));return null};ro(a.prototype);return a},uo=function(){$APP.n(customElements.get("x-timeline-item"))||customElements.define("x-timeline-item",to());return null},ao=new $APP.K(null,"track-col","track-col",629248272),co=new $APP.K(null,"actions-slot","actions-slot",1424248629),Wn=new $APP.K(null,"effective-position","effective-position",840072317),$n=new $APP.K(null,
|
|
21
|
+
"label-col","label-col",1883390160),Zn=new $APP.K(null,"label-text","label-text",-1566972381),Pn=new $APP.K(null,"data-striped?","data-striped?",906911587),go=new $APP.K(null,"actions-el","actions-el",1486248509),eo=new $APP.K(null,"content-col","content-col",767367449),ko=new $APP.K(null,"dashed","dashed",-1449249319),fo=new $APP.K(null,"item-div","item-div",1630512700),Vn=new $APP.K(null,"marker-aria","marker-aria",-353426855),Un=new $APP.K(null,"marker-icon","marker-icon",424963779),Hn=new $APP.K(null,
|
|
22
|
+
"solid","solid",-2023773691),bo=new $APP.K(null,"default-slot","default-slot",-1145647151),Rn=new $APP.K(null,"data-last?","data-last?",-1110326839),Qn=new $APP.K(null,"data-position-raw","data-position-raw",256144356),On=new $APP.K(null,"data-index-raw","data-index-raw",491574874),Tn=new $APP.K(null,"data-index","data-index",1161508385),ho=new $APP.K(null,"label-slot","label-slot",-1755862561),lo=new $APP.K(null,"none","none",1333468478);var so="label title status icon connector position disabled data-last data-index data-position data-striped".split(" ");
|
|
23
|
+
$APP.Pd(["x-timeline-item-connected",new $APP.R(null,2,[$APP.V,new $APP.R(null,4,[$APP.zk,$APP.Y,$APP.U,$APP.Y,$APP.bn,$APP.Y,$APP.Pj,$APP.Zj],null),$APP.km,!1],null),"x-timeline-item-disconnected",new $APP.R(null,2,[$APP.V,new $APP.R(null,2,[$APP.zk,$APP.Y,$APP.U,$APP.Y],null),$APP.km,!1],null),"x-timeline-item-click",new $APP.R(null,2,[$APP.V,new $APP.R(null,2,[$APP.zk,$APP.Y,$APP.U,$APP.Y],null),$APP.km,!0],null)]);
|
|
24
|
+
var Cn=new $APP.R(null,5,["pending",$APP.ji,"active",$APP.Kj,"complete",$APP.Om,"error",$APP.Ei,"warning",$APP.im],null),En=new $APP.R(null,5,[$APP.ji,"pending",$APP.Kj,"active",$APP.Om,"complete",$APP.Ei,"error",$APP.im,"warning"],null),Sn=new $APP.R(null,5,[$APP.ji,"○",$APP.Kj,"●",$APP.Om,"✓",$APP.Ei,"✕",$APP.im,"!"],null),Gn=new $APP.R(null,3,["solid",Hn,"dashed",ko,"none",lo],null),Ln=new $APP.R(null,2,["start",$APP.lm,"end",$APP.Li],null);$APP.ha("baredom.exports.x_timeline_item.init",uo);export const init=uo;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// x-timeline.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
+
|
|
3
|
+
export function init(): void;
|
|
4
|
+
|
|
5
|
+
export interface XTimelineEventMap {
|
|
6
|
+
"x-timeline-select": CustomEvent<{ index: number; status: string; label: string }>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface XTimeline extends HTMLElement {
|
|
10
|
+
label: string;
|
|
11
|
+
position: string;
|
|
12
|
+
striped: boolean;
|
|
13
|
+
|
|
14
|
+
addEventListener<K extends keyof XTimelineEventMap>(
|
|
15
|
+
type: K,
|
|
16
|
+
listener: (this: XTimeline, ev: XTimelineEventMap[K]) => any,
|
|
17
|
+
options?: boolean | AddEventListenerOptions
|
|
18
|
+
): void;
|
|
19
|
+
addEventListener(
|
|
20
|
+
type: string,
|
|
21
|
+
listener: EventListenerOrEventListenerObject,
|
|
22
|
+
options?: boolean | AddEventListenerOptions
|
|
23
|
+
): void;
|
|
24
|
+
removeEventListener<K extends keyof XTimelineEventMap>(
|
|
25
|
+
type: K,
|
|
26
|
+
listener: (this: XTimeline, ev: XTimelineEventMap[K]) => any,
|
|
27
|
+
options?: boolean | EventListenerOptions
|
|
28
|
+
): void;
|
|
29
|
+
removeEventListener(
|
|
30
|
+
type: string,
|
|
31
|
+
listener: EventListenerOrEventListenerObject,
|
|
32
|
+
options?: boolean | EventListenerOptions
|
|
33
|
+
): void;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface XTimelineItemEventMap {
|
|
37
|
+
"x-timeline-item-connected": CustomEvent<{ status: string; label: string; position: string; disabled: boolean }>;
|
|
38
|
+
"x-timeline-item-disconnected": CustomEvent<{ status: string; label: string }>;
|
|
39
|
+
"x-timeline-item-click": CustomEvent<{ status: string; label: string }>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface XTimelineItem extends HTMLElement {
|
|
43
|
+
label: string;
|
|
44
|
+
title: string;
|
|
45
|
+
status: string;
|
|
46
|
+
icon: string;
|
|
47
|
+
connector: string;
|
|
48
|
+
position: string;
|
|
49
|
+
disabled: boolean;
|
|
50
|
+
|
|
51
|
+
addEventListener<K extends keyof XTimelineItemEventMap>(
|
|
52
|
+
type: K,
|
|
53
|
+
listener: (this: XTimelineItem, ev: XTimelineItemEventMap[K]) => any,
|
|
54
|
+
options?: boolean | AddEventListenerOptions
|
|
55
|
+
): void;
|
|
56
|
+
addEventListener(
|
|
57
|
+
type: string,
|
|
58
|
+
listener: EventListenerOrEventListenerObject,
|
|
59
|
+
options?: boolean | AddEventListenerOptions
|
|
60
|
+
): void;
|
|
61
|
+
removeEventListener<K extends keyof XTimelineItemEventMap>(
|
|
62
|
+
type: K,
|
|
63
|
+
listener: (this: XTimelineItem, ev: XTimelineItemEventMap[K]) => any,
|
|
64
|
+
options?: boolean | EventListenerOptions
|
|
65
|
+
): void;
|
|
66
|
+
removeEventListener(
|
|
67
|
+
type: string,
|
|
68
|
+
listener: EventListenerOrEventListenerObject,
|
|
69
|
+
options?: boolean | EventListenerOptions
|
|
70
|
+
): void;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
declare global {
|
|
74
|
+
interface HTMLElementTagNameMap {
|
|
75
|
+
"x-timeline": XTimeline;
|
|
76
|
+
"x-timeline-item": XTimelineItem;
|
|
77
|
+
}
|
|
78
|
+
}
|
package/dist/x-timeline.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
2
|
var a_=function(a){a=typeof a==="string"?a.trim().toLowerCase():null;return $APP.I($Z,a)?a:"start"},b_=function(a,b){switch(a){case "start":return"start";case "end":return"end";case "alternating":return $APP.fd(b,2)===0?"start":"end";default:return"start"}},d_=function(a){var b=$APP.k(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
|
-
d.setAttribute("part","label");d.setAttribute("hidden","");b.appendChild(c);b.appendChild(d);b.appendChild(e);a.__xTimelineRefs=new $APP.R(null,3,[$APP.Hi,b,c_,d,$APP.
|
|
4
|
-
$APP.al,$APP.F(b)],null)},f_=function(a){var b=e_(a);if($APP.N($APP.k(a,"__xTimelineModel"),b)){b=$APP.M(b);var c=$APP.D(b,$APP.U),d=d_(a);d=$APP.M(d);d=$APP.D(d,c_);a.setAttribute("role","list");$APP.N(c,"")?a.setAttribute("aria-label",c):a.removeAttribute("aria-label");$APP.N(c,"")?(d.textContent=c,d.removeAttribute("hidden")):(d.textContent="",d.setAttribute("hidden",""));a.__xTimelineModel=b}},g_=function(a){var b=$APP.k(a,"__xTimelineModel");b=$APP.n(b)?b:e_(a);var c=$APP.M(b);b=$APP.D(c,$APP.
|
|
3
|
+
d.setAttribute("part","label");d.setAttribute("hidden","");b.appendChild(c);b.appendChild(d);b.appendChild(e);a.__xTimelineRefs=new $APP.R(null,3,[$APP.Hi,b,c_,d,$APP.El,e],null);return $APP.k(a,"__xTimelineRefs")},e_=function(a){a=new $APP.R(null,3,[$APP.pi,a.getAttribute("label"),$APP.Xj,a.getAttribute("position"),$APP.al,a.hasAttribute("striped")],null);var b=$APP.M(a);a=$APP.D(b,$APP.pi);var c=$APP.D(b,$APP.Xj);b=$APP.D(b,$APP.al);return new $APP.R(null,3,[$APP.U,$APP.n(a)?a:"",$APP.bn,a_(c),
|
|
4
|
+
$APP.al,$APP.F(b)],null)},f_=function(a){var b=e_(a);if($APP.N($APP.k(a,"__xTimelineModel"),b)){b=$APP.M(b);var c=$APP.D(b,$APP.U),d=d_(a);d=$APP.M(d);d=$APP.D(d,c_);a.setAttribute("role","list");$APP.N(c,"")?a.setAttribute("aria-label",c):a.removeAttribute("aria-label");$APP.N(c,"")?(d.textContent=c,d.removeAttribute("hidden")):(d.textContent="",d.setAttribute("hidden",""));a.__xTimelineModel=b}},g_=function(a){var b=$APP.k(a,"__xTimelineModel");b=$APP.n(b)?b:e_(a);var c=$APP.M(b);b=$APP.D(c,$APP.bn);
|
|
5
5
|
c=$APP.D(c,$APP.al);a=a.querySelectorAll("x-timeline-item");for(var d=a.length,e=0;;)if(e<d){var g=a[e],h=$APP.B.i(e,d-1);g.setAttribute("data-index",""+$APP.T.g(e));h?g.setAttribute("data-last",""):g.removeAttribute("data-last");g.setAttribute("data-position",b_(b,e));$APP.n(c)?g.setAttribute("data-striped",""):g.removeAttribute("data-striped");e+=1}else break},h_=function(a){function b(){$APP.n(a.isConnected)&&g_(a);return null}function c(e){e.stopPropagation();var g=e.target.getAttribute("data-index");
|
|
6
6
|
e=e.detail;typeof g==="string"?(g=parseInt(g,10),g=$APP.n(isNaN(g))?null:g):g=null;var h=$APP.k(e,"status");e=$APP.k(e,"label");e=$APP.Hh(new $APP.R(null,3,[$APP.ai,$APP.n(g)?g:0,$APP.zk,$APP.n(h)?h:"",$APP.U,$APP.n(e)?e:""],null));a.dispatchEvent(new CustomEvent("x-timeline-select",{detail:e,bubbles:!0,composed:!0,cancelable:!1}));return null}function d(){g_(a);return null}a.addEventListener("x-timeline-item-connected",d);a.addEventListener("x-timeline-item-click",c);document.addEventListener("x-timeline-item-disconnected",
|
|
7
7
|
b);$APP.ja(a,"__xTimelineHandlers",{"item-connected":d,"item-click":c,"item-disconnected-doc":b})},i_=function(a){var b=$APP.k(a,"__xTimelineHandlers");if($APP.n(b)){var c=$APP.k(b,"item-connected"),d=$APP.k(b,"item-click");b=$APP.k(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)}a.__xTimelineHandlers=null},j_=function(a){Object.defineProperty(a,
|
|
8
8
|
"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});Object.defineProperty(a,"position",{get:function(){return a_(this.getAttribute("position"))},set:function(b){return $APP.n(b)?this.setAttribute("position",""+$APP.T.g(b)):this.removeAttribute("position")},enumerable:!0,configurable:!0});Object.defineProperty(a,
|
|
9
9
|
"striped",{get:function(){return this.hasAttribute("striped")},set:function(b){return $APP.n(b)?this.setAttribute("striped",""):this.removeAttribute("striped")},enumerable:!0,configurable:!0})},l_=function(){var a=class extends HTMLElement{};a.observedAttributes=k_;a.prototype.connectedCallback=function(){d_(this);f_(this);i_(this);h_(this);g_(this);return null};a.prototype.disconnectedCallback=function(){i_(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.N(c,d)&&(f_(this),
|
|
10
|
-
g_(this));return null};j_(a.prototype);return a},m_=function(){$APP.n(customElements.get("x-timeline"))||customElements.define("x-timeline",l_());return null},c_=new $APP.K(null,"label-div","label-div",1505730697);var k_=["label","position","striped"];$APP.Pd(["x-timeline-select",new $APP.R(null,2,[$APP.V,new $APP.R(null,3,[$APP.ai,$APP.W,$APP.zk,$APP.Y,$APP.U,$APP.Y],null),$APP.
|
|
10
|
+
g_(this));return null};j_(a.prototype);return a},m_=function(){$APP.n(customElements.get("x-timeline"))||customElements.define("x-timeline",l_());return null},c_=new $APP.K(null,"label-div","label-div",1505730697);var k_=["label","position","striped"];$APP.Pd(["x-timeline-select",new $APP.R(null,2,[$APP.V,new $APP.R(null,3,[$APP.ai,$APP.W,$APP.zk,$APP.Y,$APP.U,$APP.Y],null),$APP.km,!1],null)]);var $Z=new $APP.S(null,new $APP.R(null,3,["start",null,"end",null,"alternating",null],null),null);$APP.ha("baredom.exports.x_timeline.init",m_);export const init=m_;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// x-toast.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
+
|
|
3
|
+
export function init(): void;
|
|
4
|
+
|
|
5
|
+
export interface XToastEventMap {
|
|
6
|
+
"x-toast-dismiss": CustomEvent<{ type: string; reason: string; heading: string; message: string }>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface XToast extends HTMLElement {
|
|
10
|
+
type: string;
|
|
11
|
+
heading: string;
|
|
12
|
+
message: string;
|
|
13
|
+
icon: string;
|
|
14
|
+
dismissible: boolean;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
timeoutMs: number;
|
|
17
|
+
showProgress: boolean;
|
|
18
|
+
|
|
19
|
+
addEventListener<K extends keyof XToastEventMap>(
|
|
20
|
+
type: K,
|
|
21
|
+
listener: (this: XToast, ev: XToastEventMap[K]) => any,
|
|
22
|
+
options?: boolean | AddEventListenerOptions
|
|
23
|
+
): void;
|
|
24
|
+
addEventListener(
|
|
25
|
+
type: string,
|
|
26
|
+
listener: EventListenerOrEventListenerObject,
|
|
27
|
+
options?: boolean | AddEventListenerOptions
|
|
28
|
+
): void;
|
|
29
|
+
removeEventListener<K extends keyof XToastEventMap>(
|
|
30
|
+
type: K,
|
|
31
|
+
listener: (this: XToast, ev: XToastEventMap[K]) => any,
|
|
32
|
+
options?: boolean | EventListenerOptions
|
|
33
|
+
): void;
|
|
34
|
+
removeEventListener(
|
|
35
|
+
type: string,
|
|
36
|
+
listener: EventListenerOrEventListenerObject,
|
|
37
|
+
options?: boolean | EventListenerOptions
|
|
38
|
+
): void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
declare global {
|
|
42
|
+
interface HTMLElementTagNameMap {
|
|
43
|
+
"x-toast": XToast;
|
|
44
|
+
}
|
|
45
|
+
}
|
package/dist/x-toast.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
a.trim(),$APP.N(a,"")&&$APP.N(a.toLowerCase(),"none")?a:null):null},
|
|
4
|
-
typeof c==="string"?c.trim():null;return $APP.n(p)?p:""}(),function(){var p=typeof d==="string"?d.trim():null;return $APP.n(p)?p:""}()])},
|
|
5
|
-
b!=null&&b>0:a)},
|
|
2
|
+
var Ar=function(a){a=$APP.D(zr,typeof a==="string"?a.toLowerCase():null);return $APP.n(a)?a:$APP.ol},Cr=function(a){a=$APP.D(Br,a);return $APP.n(a)?a:"info"},Dr=function(a){return a==null?!0:$APP.N((""+$APP.T.g(a)).trim().toLowerCase(),"false")},Er=function(a){return a==null?!1:$APP.N((""+$APP.T.g(a)).trim().toLowerCase(),"false")},Fr=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),typeof a==="number"&&$APP.r(isNaN(a))&&a>0?a:null):null},Gr=function(a){return typeof a==="string"?(a=
|
|
3
|
+
a.trim(),$APP.N(a,"")&&$APP.N(a.toLowerCase(),"none")?a:null):null},Jr=function(a){var b=$APP.M(a),c=$APP.D(b,$APP.Bk),d=$APP.D(b,$APP.Al);a=$APP.D(b,$APP.rj);var e=$APP.D(b,$APP.Nl),g=$APP.D(b,$APP.wi),h=$APP.D(b,$APP.Uh),l=$APP.D(b,Hr),m=$APP.D(b,$APP.yi);b=$APP.D(b,$APP.Dj);m=Ar(m);b=Gr(b);h=$APP.n($APP.n(h)?b==null:h)?$APP.an:b!=null?$APP.Dl:$APP.li;return $APP.zf([Ir,$APP.Oi,$APP.Z,$APP.Qk,$APP.rk,$APP.X,$APP.tm,$APP.Bk,$APP.Al],[Er(l),Dr(a),m,$APP.B.i(h,$APP.Dl)?b:null,h,$APP.F(e),Fr(g),function(){var p=
|
|
4
|
+
typeof c==="string"?c.trim():null;return $APP.n(p)?p:""}(),function(){var p=typeof d==="string"?d.trim():null;return $APP.n(p)?p:""}()])},Kr=function(a){var b=$APP.M(a);a=$APP.D(b,$APP.Oi);b=$APP.D(b,$APP.X);return $APP.n(a)?$APP.r(b):a},Lr=function(a,b){var c=$APP.M(a);a=$APP.D(c,$APP.Z);var d=$APP.D(c,$APP.Al);c=$APP.D(c,$APP.Bk);return new $APP.R(null,4,[$APP.Z,Cr(a),$APP.Qi,b,$APP.Al,d,$APP.Bk,c],null)},Mr=function(a){var b=$APP.M(a);a=$APP.D(b,Ir);b=$APP.D(b,$APP.tm);return $APP.F($APP.n(a)?
|
|
5
|
+
b!=null&&b>0:a)},Rr=function(a){var b=$APP.k(a,"__xToastRefs");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("span"),h=document.createElement("slot"),l=document.createElement("span"),m=document.createElement("div"),p=document.createElement("span"),q=document.createElement("span"),v=document.createElement("button"),x=document.createElement("span"),y=document.createElement("div"),
|
|
6
6
|
A=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;}}";
|
|
7
7
|
d.setAttribute("part","container");e.setAttribute("part","inner");g.setAttribute("part","icon");g.setAttribute("aria-hidden","true");h.setAttribute("name","icon");l.setAttribute("part","default-icon");h.appendChild(l);g.appendChild(h);m.setAttribute("part","body");p.setAttribute("part","heading");q.setAttribute("part","message");m.appendChild(p);m.appendChild(q);v.setAttribute("part","dismiss");v.setAttribute("type","button");v.setAttribute("aria-label","Dismiss toast");x.setAttribute("aria-hidden",
|
|
8
|
-
"true");x.textContent="×";v.appendChild(x);e.appendChild(g);e.appendChild(m);e.appendChild(v);y.setAttribute("part","progress");A.setAttribute("part","progress-bar");y.appendChild(A);d.appendChild(e);d.appendChild(y);b.appendChild(c);b.appendChild(d);b=$APP.zf([
|
|
9
|
-
$APP.Bk,$APP.
|
|
10
|
-
q=
|
|
8
|
+
"true");x.textContent="×";v.appendChild(x);e.appendChild(g);e.appendChild(m);e.appendChild(v);y.setAttribute("part","progress");A.setAttribute("part","progress-bar");y.appendChild(A);d.appendChild(e);d.appendChild(y);b.appendChild(c);b.appendChild(d);b=$APP.zf([Nr,$APP.Vm,Or,$APP.Sk,$APP.Jm,Pr,$APP.Hi,$APP.Hj,$APP.jj,$APP.Ph,$APP.uj,Qr],[A,l,q,v,m,e,b,d,y,g,h,p]);a.__xToastRefs=b;return $APP.k(a,"__xToastRefs")},Sr=function(a){return Jr($APP.zf([$APP.rj,$APP.Nl,$APP.wi,$APP.Uh,Hr,$APP.Dj,$APP.yi,
|
|
9
|
+
$APP.Bk,$APP.Al],[a.getAttribute("dismissible"),a.hasAttribute("disabled"),a.getAttribute("timeout-ms"),a.hasAttribute("icon"),a.getAttribute("show-progress"),a.getAttribute("icon"),a.getAttribute("type"),a.getAttribute("message"),a.getAttribute("heading")]))},Ur=function(a){var b=Sr(a);if($APP.N($APP.k(a,"__xToastModel"),b)){b=$APP.M(b);var c=$APP.D(b,$APP.Z),d=$APP.D(b,$APP.Al),e=$APP.D(b,$APP.Bk),g=$APP.D(b,$APP.rk),h=$APP.D(b,$APP.Qk),l=$APP.D(b,$APP.Oi),m=$APP.D(b,$APP.X),p=$APP.D(b,$APP.tm),
|
|
10
|
+
q=Rr(a),v=$APP.M(q),x=$APP.D(v,$APP.uj);q=$APP.D(v,Qr);var y=$APP.D(v,Nr),A=$APP.D(v,$APP.Vm),C=$APP.D(v,Or),E=$APP.D(v,$APP.Sk),H=$APP.D(v,$APP.Hj),G=$APP.D(v,$APP.jj);v=$APP.D(v,$APP.Ph);x=$APP.n(x)?x.assignedNodes().length>0:null;$APP.B.i(g,$APP.Dl)||(h=$APP.D(Tr,c),h=$APP.n(h)?h:$APP.D(Tr,$APP.ol));g=$APP.r(x)&&$APP.B.i(g,$APP.an);x=Mr(b);a.setAttribute("data-type",Cr(c));var J=H.setAttribute;c=$APP.B.i(c,$APP.im)||$APP.B.i(c,$APP.Ei)?"alert":"status";J.call(H,"role",c);q.textContent=d;q.style.display=
|
|
11
11
|
$APP.B.i(d,"")?"none":"";C.textContent=e;g?(A.textContent="",v.style.display="none"):(A.textContent=h,v.style.display="inline");$APP.n(l)?(E.disabled=$APP.F(m),E.style.display="inline-flex"):(E.disabled=!0,E.style.display="none");x?(G.style.display="block",y.style.setProperty("--x-toast-timeout",""+$APP.T.g(p)+"ms")):G.style.display="none";d=$APP.n(l)?$APP.r(m):l;a.tabIndex=$APP.n(d)?0:-1;$APP.n(m)?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled");$APP.n(d)?a.setAttribute("aria-keyshortcuts",
|
|
12
|
-
"Escape"):a.removeAttribute("aria-keyshortcuts");a.__xToastModel=b}},
|
|
13
|
-
a))):0},
|
|
14
|
-
$APP.ja(a,"__xToastTimeout",setTimeout(function(){a.__xToastTimeout=null;if($APP.n(function(){var d=a.isConnected;return $APP.n(d)?$APP.r($APP.k(a,"__xToastExiting")):d}())){var c=function(){var d=$APP.k(a,"__xToastModel");return $APP.n(d)?d:
|
|
15
|
-
$APP.k(a,"__xToastModel");$APP.n($APP.n(b)?
|
|
16
|
-
"__xToastExiting"))){a.__xToastExiting=!0;
|
|
17
|
-
$APP.ja(a,"__xToastExitTimer",setTimeout(function(){var h=a.isConnected;return $APP.n($APP.n(h)?$APP.k(a,"__xToastExiting"):h)?(d.removeEventListener("animationend",e),a.__xToastExitTimer=null,a.remove()):null},b+60))}}return null},
|
|
18
|
-
return $APP.n(d)?d:
|
|
19
|
-
e)}var d=
|
|
20
|
-
b)}a.__xToastHandlers=null},
|
|
12
|
+
"Escape"):a.removeAttribute("aria-keyshortcuts");a.__xToastModel=b}},Vr=function(){return $APP.F(window.matchMedia("(prefers-reduced-motion:reduce)").matches)},Wr=function(a){a=typeof a==="string"?a.trim():"";return $APP.B.i(a,"")||$APP.B.i(a,"0")||$APP.B.i(a,"0ms")||$APP.B.i(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*
|
|
13
|
+
a))):0},Xr=function(a){var b=window.getComputedStyle(a);a=Wr(b.getPropertyValue("--x-toast-exit-duration"));b=Wr(b.getPropertyValue("--x-motion-exit-duration"));return a>0?a:b>0?b:180},Yr=function(a){var b=$APP.k(a,"__xToastTimeout");$APP.n(b)&&(clearTimeout(b),a.__xToastTimeout=null)},$r=function(a){Yr(a);var b=function(){var c=$APP.k(a,"__xToastModel");return $APP.n(c)?c:Sr(a)}();$APP.n(function(){var c=Kr(b);return $APP.n(c)?typeof $APP.tm.g(b)==="number"&&$APP.r($APP.k(a,"__xToastExiting")):c}())&&
|
|
14
|
+
$APP.ja(a,"__xToastTimeout",setTimeout(function(){a.__xToastTimeout=null;if($APP.n(function(){var d=a.isConnected;return $APP.n(d)?$APP.r($APP.k(a,"__xToastExiting")):d}())){var c=function(){var d=$APP.k(a,"__xToastModel");return $APP.n(d)?d:Sr(a)}();if($APP.n(Kr(c)))return c=$APP.Hh(Lr(c,"timeout")),c=new CustomEvent("x-toast-dismiss",{detail:c,bubbles:!0,composed:!0,cancelable:!0}),c=a.dispatchEvent(c),$APP.n(c)?Zr.g?Zr.g(a):Zr.call(null,a):null}return null},$APP.tm.g(b)));return null},as=function(a){var b=
|
|
15
|
+
$APP.k(a,"__xToastModel");$APP.n($APP.n(b)?Mr(b):b)&&a.setAttribute("data-progress-active","");return $r(a)},bs=function(a){if(!$APP.n($APP.k(a,"__xToastEntered")))if(a.__xToastEntered=!0,a.setAttribute("data-entering",""),Vr())a.removeAttribute("data-entering"),as(a);else{var b=Rr(a);b=$APP.M(b);var c=$APP.D(b,$APP.Hj);c.addEventListener("animationend",function g(e){return $APP.B.i(e.target,c)?(c.removeEventListener("animationend",g),a.removeAttribute("data-entering"),as(a)):null})}},Zr=function(a){if(!$APP.n($APP.k(a,
|
|
16
|
+
"__xToastExiting"))){a.__xToastExiting=!0;Yr(a);a.removeAttribute("data-entering");a.removeAttribute("data-progress-active");var b=Xr(a);if(b===0||Vr())a.remove();else{var c=Rr(a);c=$APP.M(c);var d=$APP.D(c,$APP.Hj),e=function l(h){return $APP.B.i(h.target,d)?(d.removeEventListener("animationend",l),h=$APP.k(a,"__xToastExitTimer"),$APP.n(h)&&(clearTimeout(h),a.__xToastExitTimer=null),$APP.n(a.isConnected)?a.remove():null):null};a.setAttribute("data-exiting","");d.addEventListener("animationend",e);
|
|
17
|
+
$APP.ja(a,"__xToastExitTimer",setTimeout(function(){var h=a.isConnected;return $APP.n($APP.n(h)?$APP.k(a,"__xToastExiting"):h)?(d.removeEventListener("animationend",e),a.__xToastExitTimer=null,a.remove()):null},b+60))}}return null},cs=function(a,b){var c=$APP.k(a,"__xToastModel");c=$APP.n(c)?c:Sr(a);b=$APP.Hh(Lr(c,b));b=new CustomEvent("x-toast-dismiss",{detail:b,bubbles:!0,composed:!0,cancelable:!0});b=a.dispatchEvent(b);$APP.n(b)&&Zr(a)},ds=function(a,b){var c=function(){var d=$APP.k(a,"__xToastModel");
|
|
18
|
+
return $APP.n(d)?d:Sr(a)}();$APP.n(function(){var d=Kr(c);return $APP.n(d)?$APP.r($APP.k(a,"__xToastExiting")):d}())&&(b.preventDefault(),cs(a,"button"));return null},es=function(a,b){if($APP.B.i(b.key,"Escape")){var c=function(){var d=$APP.k(a,"__xToastModel");return $APP.n(d)?d:Sr(a)}();$APP.n(function(){var d=Kr(c);return $APP.n(d)?$APP.r($APP.k(a,"__xToastExiting")):d}())&&(b.preventDefault(),cs(a,"keyboard"))}return null},fs=function(a){function b(e){return es(a,e)}function c(e){return ds(a,
|
|
19
|
+
e)}var d=Rr(a);d=$APP.M(d);$APP.D(d,$APP.Sk).addEventListener("click",c);a.addEventListener("keydown",b);$APP.ja(a,"__xToastHandlers",{click:c,keydown:b})},gs=function(a){Yr(a);var b=$APP.k(a,"__xToastExitTimer");$APP.n(b)&&(clearTimeout(b),a.__xToastExitTimer=null);b=$APP.k(a,"__xToastHandlers");var c=$APP.k(a,"__xToastRefs");if($APP.n($APP.n(b)?c:b)){c=$APP.Sk.g(c);var d=$APP.k(b,"click");b=$APP.k(b,"keydown");$APP.n(d)&&c.removeEventListener("click",d);$APP.n(b)&&a.removeEventListener("keydown",
|
|
20
|
+
b)}a.__xToastHandlers=null},hs=function(a){Object.defineProperty(a,"type",{get:function(){var b=this.getAttribute("type");return $APP.n(b)?b:"info"},set:function(b){return $APP.n(b)?this.setAttribute("type",""+$APP.T.g(b)):this.removeAttribute("type")},enumerable:!0,configurable:!0});Object.defineProperty(a,"heading",{get:function(){var b=this.getAttribute("heading");return $APP.n(b)?b:""},set:function(b){return $APP.n(b)?this.setAttribute("heading",""+$APP.T.g(b)):this.removeAttribute("heading")},
|
|
21
21
|
enumerable:!0,configurable:!0});Object.defineProperty(a,"message",{get:function(){var b=this.getAttribute("message");return $APP.n(b)?b:""},set:function(b){return $APP.n(b)?this.setAttribute("message",""+$APP.T.g(b)):this.removeAttribute("message")},enumerable:!0,configurable:!0});Object.defineProperty(a,"icon",{get:function(){return this.getAttribute("icon")},set:function(b){return $APP.n(b)?this.setAttribute("icon",""+$APP.T.g(b)):this.removeAttribute("icon")},enumerable:!0,configurable:!0});Object.defineProperty(a,
|
|
22
|
-
"dismissible",{get:function(){return
|
|
23
|
-
set:function(b){return b==null?this.removeAttribute("timeout-ms"):this.setAttribute("timeout-ms",""+$APP.T.g(b|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"showProgress",{get:function(){return
|
|
24
|
-
c)&&
|
|
25
|
-
customElements.define("x-toast",
|
|
26
|
-
var
|
|
22
|
+
"dismissible",{get:function(){return Dr(this.getAttribute("dismissible"))},set:function(b){return $APP.n(b)?this.setAttribute("dismissible",""):this.setAttribute("dismissible","false")},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,configurable:!0});Object.defineProperty(a,"timeoutMs",{get:function(){return Fr(this.getAttribute("timeout-ms"))},
|
|
23
|
+
set:function(b){return b==null?this.removeAttribute("timeout-ms"):this.setAttribute("timeout-ms",""+$APP.T.g(b|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"showProgress",{get:function(){return Er(this.getAttribute("show-progress"))},set:function(b){return $APP.n(b)?this.setAttribute("show-progress",""):this.removeAttribute("show-progress")},enumerable:!0,configurable:!0})},is=function(a){a.dismiss=function(b){var c=$APP.r($APP.k(this,"__xToastExiting"));$APP.n(c?this.isConnected:
|
|
24
|
+
c)&&cs(this,typeof b==="string"?b:"api");return null}},ks=function(){var a=class extends HTMLElement{};a.observedAttributes=js;a.prototype.connectedCallback=function(){Rr(this);gs(this);fs(this);Ur(this);bs(this);return null};a.prototype.disconnectedCallback=function(){gs(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.N(c,d)&&(Ur(this),$APP.n(this.isConnected)&&$r(this));return null};hs(a.prototype);is(a.prototype);return a},ls=function(){$APP.n(customElements.get("x-toast"))||
|
|
25
|
+
customElements.define("x-toast",ks());return null},Qr=new $APP.K(null,"heading-el","heading-el",-1277272161),Ir=new $APP.K(null,"show-progress?","show-progress?",-1681518912),Pr=new $APP.K(null,"inner","inner",-1383171215),Or=new $APP.K(null,"message-el","message-el",-683533234),Nr=new $APP.K(null,"progress-bar","progress-bar",-123877022),Hr=new $APP.K(null,"show-progress-attr","show-progress-attr",1680262066);var js="type heading message icon dismissible disabled timeout-ms show-progress".split(" ");$APP.Pd(["x-toast-dismiss",new $APP.R(null,2,[$APP.V,new $APP.R(null,4,[$APP.Z,$APP.Y,$APP.Qi,$APP.Y,$APP.Al,$APP.Y,$APP.Bk,$APP.Y],null),$APP.km,!0],null)]);
|
|
26
|
+
var zr=new $APP.R(null,4,["info",$APP.ol,"success",$APP.Lk,"warning",$APP.im,"error",$APP.Ei],null),Br=new $APP.R(null,4,[$APP.ol,"info",$APP.Lk,"success",$APP.im,"warning",$APP.Ei,"error"],null),Tr=new $APP.R(null,4,[$APP.ol,"ℹ",$APP.Lk,"✓",$APP.im,"!",$APP.Ei,"⨯"],null);$APP.ha("baredom.exports.x_toast.init",ls);export const init=ls;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// x-toaster.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
+
|
|
3
|
+
export function init(): void;
|
|
4
|
+
|
|
5
|
+
export interface XToasterEventMap {
|
|
6
|
+
"x-toaster-dismiss": CustomEvent<{ type: string; reason: string; heading: string; message: string }>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface XToaster extends HTMLElement {
|
|
10
|
+
position: string;
|
|
11
|
+
maxToasts: number;
|
|
12
|
+
label: string;
|
|
13
|
+
toast(options: Record<string, any>): void;
|
|
14
|
+
|
|
15
|
+
addEventListener<K extends keyof XToasterEventMap>(
|
|
16
|
+
type: K,
|
|
17
|
+
listener: (this: XToaster, ev: XToasterEventMap[K]) => any,
|
|
18
|
+
options?: boolean | AddEventListenerOptions
|
|
19
|
+
): void;
|
|
20
|
+
addEventListener(
|
|
21
|
+
type: string,
|
|
22
|
+
listener: EventListenerOrEventListenerObject,
|
|
23
|
+
options?: boolean | AddEventListenerOptions
|
|
24
|
+
): void;
|
|
25
|
+
removeEventListener<K extends keyof XToasterEventMap>(
|
|
26
|
+
type: K,
|
|
27
|
+
listener: (this: XToaster, ev: XToasterEventMap[K]) => any,
|
|
28
|
+
options?: boolean | EventListenerOptions
|
|
29
|
+
): void;
|
|
30
|
+
removeEventListener(
|
|
31
|
+
type: string,
|
|
32
|
+
listener: EventListenerOrEventListenerObject,
|
|
33
|
+
options?: boolean | EventListenerOptions
|
|
34
|
+
): void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
declare global {
|
|
38
|
+
interface HTMLElementTagNameMap {
|
|
39
|
+
"x-toaster": XToaster;
|
|
40
|
+
}
|
|
41
|
+
}
|
package/dist/x-toaster.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
new $APP.R(null,3,[$APP.Xj,a.getAttribute("position"),
|
|
4
|
-
a.setAttribute("aria-label",d);a.setAttribute("data-position",c);a.__xToasterModel=b}},
|
|
5
|
-
e=a.dispatchEvent(e);$APP.n(e)&&c.target.dismiss("toaster-remove")}return null}a.addEventListener("x-toast-dismiss",b);$APP.ja(a,"__xToasterHandlers",{dismiss:b})},
|
|
6
|
-
""+$APP.T.g(b)):this.removeAttribute("position")},enumerable:!0,configurable:!0});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.N(b,""):b)?this.setAttribute("label",""+$APP.T.g(b)):this.removeAttribute("label")},enumerable:!0,configurable:!0});Object.defineProperty(a,"maxToasts",{get:function(){var b=
|
|
7
|
-
null?this.removeAttribute("max-toasts"):this.setAttribute("max-toasts",""+$APP.T.g(Math.floor(b)))},enumerable:!0,configurable:!0});Object.defineProperty(a,"toast",{value:function(b){b=$APP.n(b)?b:{};var c=$APP.k(this,"__xToasterModel");c=$APP.n(c)?c:
|
|
8
|
-
"heading");$APP.n(d)&&c.setAttribute("heading",d);d=$APP.k(b,"message");$APP.n(d)&&c.setAttribute("message",d);d=$APP.k(b,"icon");$APP.n(d)&&c.setAttribute("icon",d);$APP.k(b,"dismissible")===!1&&c.setAttribute("dismissible","false");d=$APP.k(b,"timeoutMs");$APP.n(d)&&c.setAttribute("timeout-ms",""+$APP.T.g(d));$APP.n($APP.k(b,"showProgress"))&&c.setAttribute("show-progress","");this.appendChild(c);return c},writable:!0,configurable:!0})},
|
|
9
|
-
|
|
2
|
+
var Fu=function(a){a=typeof a==="string"?a.trim().toLowerCase():null;return $APP.I(Eu,a)?a:"top-end"},Gu=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),$APP.r(isNaN(a))&&a>0?Math.floor(a):null):null},Iu=function(a){if(!$APP.n($APP.k(a,"__xToasterRefs"))){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("slot");c.textContent=Hu;b.appendChild(c);b.appendChild(d);a.__xToasterRefs=new $APP.R(null,2,[$APP.Hi,b,$APP.El,d],null)}},Lu=function(a){a=
|
|
3
|
+
new $APP.R(null,3,[$APP.Xj,a.getAttribute("position"),Ju,a.getAttribute("max-toasts"),$APP.pi,a.getAttribute("label")],null);var b=$APP.M(a),c=$APP.D(b,$APP.Xj);a=$APP.D(b,Ju);b=$APP.D(b,$APP.pi);c=Fu(c);a=Gu(a);return new $APP.R(null,3,[$APP.bn,c,Ku,$APP.n(a)?a:5,$APP.U,typeof b==="string"&&$APP.N(b.trim(),"")?b:"Notifications"],null)},Mu=function(a){var b=Lu(a);if($APP.N($APP.k(a,"__xToasterModel"),b)){b=$APP.M(b);var c=$APP.D(b,$APP.bn),d=$APP.D(b,$APP.U);Iu(a);a.setAttribute("role","region");
|
|
4
|
+
a.setAttribute("aria-label",d);a.setAttribute("data-position",c);a.__xToasterModel=b}},Nu=function(a){function b(c){var d=c.detail;if($APP.N($APP.k(d,"reason"),"toaster-remove")){c.preventDefault();var e=$APP.k(d,"type");var g=$APP.k(d,"reason"),h=$APP.k(d,"heading");d=$APP.k(d,"message");e=$APP.Hh(new $APP.R(null,4,[$APP.Z,$APP.n(e)?e:"info",$APP.Qi,$APP.n(g)?g:"",$APP.Al,$APP.n(h)?h:"",$APP.Bk,$APP.n(d)?d:""],null));e=new CustomEvent("x-toaster-dismiss",{detail:e,bubbles:!0,composed:!0,cancelable:!0});
|
|
5
|
+
e=a.dispatchEvent(e);$APP.n(e)&&c.target.dismiss("toaster-remove")}return null}a.addEventListener("x-toast-dismiss",b);$APP.ja(a,"__xToasterHandlers",{dismiss:b})},Ou=function(a){var b=$APP.k(a,"__xToasterHandlers");$APP.n(b)&&(b=$APP.k(b,"dismiss"),$APP.n(b)&&a.removeEventListener("x-toast-dismiss",b));a.__xToasterHandlers=null},Pu=function(a){a=a.prototype;Object.defineProperty(a,"position",{get:function(){return Fu(this.getAttribute("position"))},set:function(b){return $APP.n(b)?this.setAttribute("position",
|
|
6
|
+
""+$APP.T.g(b)):this.removeAttribute("position")},enumerable:!0,configurable:!0});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.N(b,""):b)?this.setAttribute("label",""+$APP.T.g(b)):this.removeAttribute("label")},enumerable:!0,configurable:!0});Object.defineProperty(a,"maxToasts",{get:function(){var b=Gu(this.getAttribute("max-toasts"));return $APP.n(b)?b:5},set:function(b){return b==
|
|
7
|
+
null?this.removeAttribute("max-toasts"):this.setAttribute("max-toasts",""+$APP.T.g(Math.floor(b)))},enumerable:!0,configurable:!0});Object.defineProperty(a,"toast",{value:function(b){b=$APP.n(b)?b:{};var c=$APP.k(this,"__xToasterModel");c=$APP.n(c)?c:Lu(this);var d=Ku.g(c);c=this.querySelectorAll("x-toast");var e=c.length;if(e>=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.k(b,"type");$APP.n(d)&&c.setAttribute("type",d);d=$APP.k(b,
|
|
8
|
+
"heading");$APP.n(d)&&c.setAttribute("heading",d);d=$APP.k(b,"message");$APP.n(d)&&c.setAttribute("message",d);d=$APP.k(b,"icon");$APP.n(d)&&c.setAttribute("icon",d);$APP.k(b,"dismissible")===!1&&c.setAttribute("dismissible","false");d=$APP.k(b,"timeoutMs");$APP.n(d)&&c.setAttribute("timeout-ms",""+$APP.T.g(d));$APP.n($APP.k(b,"showProgress"))&&c.setAttribute("show-progress","");this.appendChild(c);return c},writable:!0,configurable:!0})},Ru=function(){var a=class extends HTMLElement{};a.observedAttributes=
|
|
9
|
+
Qu;a.prototype.connectedCallback=function(){Iu(this);Ou(this);Nu(this);Mu(this);return null};a.prototype.disconnectedCallback=function(){Ou(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.N(c,d)&&Mu(this);return null};Pu(a);return a},Su=function(){$APP.n(customElements.get("x-toaster"))||customElements.define("x-toaster",Ru());return null},Ju=new $APP.K(null,"max-toasts-raw","max-toasts-raw",-815087069),Ku=new $APP.K(null,"max-toasts","max-toasts",-1982289139);var Qu=["position","max-toasts","label"];$APP.Pd(["x-toaster-dismiss",new $APP.R(null,2,[$APP.V,new $APP.R(null,4,[$APP.Z,$APP.Y,$APP.Qi,$APP.Y,$APP.Al,$APP.Y,$APP.Bk,$APP.Y],null),$APP.km,!0],null)]);var Eu=new $APP.S(null,new $APP.R(null,6,["top-center",null,"bottom-start",null,"bottom-end",null,"bottom-center",null,"top-end",null,"top-start",null],null),null);var Hu=":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.T.g("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.ha("baredom.exports.x_toaster.init",Su);export const init=Su;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// x-tooltip.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
+
|
|
3
|
+
export function init(): void;
|
|
4
|
+
|
|
5
|
+
export interface XTooltipEventMap {
|
|
6
|
+
"x-tooltip-show": CustomEvent<{}>;
|
|
7
|
+
"x-tooltip-hide": CustomEvent<{}>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface XTooltip extends HTMLElement {
|
|
11
|
+
text: string;
|
|
12
|
+
placement: string;
|
|
13
|
+
delay: number;
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
open: boolean;
|
|
16
|
+
|
|
17
|
+
addEventListener<K extends keyof XTooltipEventMap>(
|
|
18
|
+
type: K,
|
|
19
|
+
listener: (this: XTooltip, ev: XTooltipEventMap[K]) => any,
|
|
20
|
+
options?: boolean | AddEventListenerOptions
|
|
21
|
+
): void;
|
|
22
|
+
addEventListener(
|
|
23
|
+
type: string,
|
|
24
|
+
listener: EventListenerOrEventListenerObject,
|
|
25
|
+
options?: boolean | AddEventListenerOptions
|
|
26
|
+
): void;
|
|
27
|
+
removeEventListener<K extends keyof XTooltipEventMap>(
|
|
28
|
+
type: K,
|
|
29
|
+
listener: (this: XTooltip, ev: XTooltipEventMap[K]) => any,
|
|
30
|
+
options?: boolean | EventListenerOptions
|
|
31
|
+
): void;
|
|
32
|
+
removeEventListener(
|
|
33
|
+
type: string,
|
|
34
|
+
listener: EventListenerOrEventListenerObject,
|
|
35
|
+
options?: boolean | EventListenerOptions
|
|
36
|
+
): void;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare global {
|
|
40
|
+
interface HTMLElementTagNameMap {
|
|
41
|
+
"x-tooltip": XTooltip;
|
|
42
|
+
}
|
|
43
|
+
}
|
package/dist/x-tooltip.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
$APP.F(a),$APP.
|
|
4
|
-
(clearTimeout(b),a.__xTooltipShowTimer=null)},
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
a.removeEventListener("pointerenter",$APP.k(c,"pointerenter")),a.removeEventListener("pointerleave",$APP.k(c,"pointerleave")),a.removeEventListener("focusin",$APP.k(c,"focusin")),a.removeEventListener("focusout",$APP.k(c,"focusout")),a.removeEventListener("keydown",$APP.k(c,"keydown")),b.removeEventListener("slotchange",$APP.k(c,"slotchange")))}},
|
|
8
|
-
c,$APP.F(d))}})},
|
|
9
|
-
""+$APP.T.g(b)):this.removeAttribute("delay")}})},
|
|
10
|
-
e=document.createElement("span"),g=document.createElement("slot"),h=document.createElement("div"),l=document.createElement("div"),m=document.createElement("div"),p=document.createElement("span"),q=document.createElement("slot");var v=$APP.k(
|
|
2
|
+
var ou=function(a){a=new $APP.R(null,5,[$APP.Kh,a.getAttribute("text"),$APP.hn,a.getAttribute("placement"),lu,a.getAttribute("delay"),$APP.Nl,a.hasAttribute("disabled"),$APP.Gi,a.hasAttribute("open")],null);var b=$APP.M(a),c=$APP.D(b,$APP.Kh),d=$APP.D(b,$APP.hn),e=$APP.D(b,lu);a=$APP.D(b,$APP.Nl);b=$APP.D(b,$APP.Gi);c=$APP.n(c)?c:"";d=$APP.I(mu,d)?d:"top";e!=null?(e=parseInt(e,10),e=$APP.n(isNaN(e))?400:$APP.sh.i($APP.oh.i(e,0),5E3)):e=400;return new $APP.R(null,5,[$APP.Bl,c,$APP.Qj,d,nu,e,$APP.X,
|
|
3
|
+
$APP.F(a),$APP.Nm,$APP.F(b)],null)},pu=function(a){var b=$APP.k(a,"__xTooltipRefs");if($APP.n(b)){a=ou(a);var c=$APP.M(a);a=$APP.D(c,$APP.Bl);var d=$APP.D(c,$APP.Qj),e=$APP.D(c,$APP.Nm);c=$APP.k(b,"panel");b=$APP.k(b,"text");c.setAttribute("data-placement",d);d=""+$APP.T.g($APP.r(e));c.setAttribute("aria-hidden",d);b.textContent=a}},qu=function(a,b){return a.dispatchEvent(new CustomEvent(b,{detail:{},bubbles:!0,composed:!0,cancelable:!1}))},ru=function(a){var b=$APP.k(a,"__xTooltipShowTimer");$APP.n(b)&&
|
|
4
|
+
(clearTimeout(b),a.__xTooltipShowTimer=null)},su=function(a,b){if($APP.n(a.hasAttribute("disabled")))return null;ru(a);if($APP.n($APP.n(b)?b:a.hasAttribute("open"))){if($APP.n(a.hasAttribute("open")))return null;a.setAttribute("open","");return qu(a,"x-tooltip-show")}b=ou(a);b=$APP.M(b);b=$APP.D(b,nu);return b===0?(a.setAttribute("open",""),qu(a,"x-tooltip-show")):$APP.Cg(a,"__xTooltipShowTimer",setTimeout(function(){a.__xTooltipShowTimer=null;return $APP.n(a.isConnected)?(a.setAttribute("open",""),
|
|
5
|
+
qu(a,"x-tooltip-show")):null},b))},tu=function(a){ru(a);return $APP.n(a.hasAttribute("open"))?(a.removeAttribute("open"),qu(a,"x-tooltip-hide")):null},uu=function(a){var b=$APP.k(a,"__xTooltipRefs");if($APP.n(b)){var c=$APP.k(b,"triggerSlot").assignedElements();b=$APP.k(a,"__xTooltipId");var d=$APP.k(a,"__xTooltipTriggerEl");$APP.n(d)&&(d.removeAttribute("aria-describedby"),a.__xTooltipTriggerEl=null);if(c.length>0){c=c[0];c.setAttribute("aria-describedby",b);a.__xTooltipTriggerEl=c;return}}return null},
|
|
6
|
+
vu=function(a){return{pointerenter:function(){return su(a,!1)},pointerleave:function(){return tu(a)},focusin:function(){return su(a,!0)},focusout:function(b){b=b.relatedTarget;return b==null||$APP.r(a.contains(b))?tu(a):null},keydown:function(b){b=$APP.B.i(b.key,"Escape");return $APP.n(b?a.hasAttribute("open"):b)?tu(a):null},slotchange:function(){return uu(a)}}},wu=function(a){var b=$APP.k(a,"__xTooltipRefs");if($APP.n(b)){var c=$APP.k(a,"__xTooltipHandlers");$APP.n(c)&&(b=$APP.k(b,"triggerSlot"),
|
|
7
|
+
a.removeEventListener("pointerenter",$APP.k(c,"pointerenter")),a.removeEventListener("pointerleave",$APP.k(c,"pointerleave")),a.removeEventListener("focusin",$APP.k(c,"focusin")),a.removeEventListener("focusout",$APP.k(c,"focusout")),a.removeEventListener("keydown",$APP.k(c,"keydown")),b.removeEventListener("slotchange",$APP.k(c,"slotchange")))}},xu=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return $APP.Eg(this,
|
|
8
|
+
c,$APP.F(d))}})},yu=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){return d!=null&&$APP.N(d)?this.setAttribute(c,""+$APP.T.g(d)):this.removeAttribute(c)}})},zu=function(a){Object.defineProperty(a,"delay",{configurable:!0,enumerable:!0,get:function(){var b=this.getAttribute("delay");return b!=null?(b=parseInt(b,10),$APP.n(isNaN(b))?null:b):null},set:function(b){return b!=null&&$APP.N(b)?this.setAttribute("delay",
|
|
9
|
+
""+$APP.T.g(b)):this.removeAttribute("delay")}})},Cu=function(){var a=class extends HTMLElement{},b=a.prototype;Object.defineProperty(a,"observedAttributes",{get:function(){return Au}});yu(b,"text","text");yu(b,"placement","placement");zu(b);xu(b,"disabled","disabled");xu(b,"open","open");b.show=function(){return su(this,!0)};b.hide=function(){return tu(this)};b.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xTooltipRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),
|
|
10
|
+
e=document.createElement("span"),g=document.createElement("slot"),h=document.createElement("div"),l=document.createElement("div"),m=document.createElement("div"),p=document.createElement("span"),q=document.createElement("slot");var v=$APP.k(Bu,"n")+1;Bu.n=v;v="x-tt-"+$APP.T.g(v);d.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(200px,calc(100% - 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;}}";
|
|
11
11
|
e.setAttribute("part","trigger");h.setAttribute("part","panel");h.setAttribute("role","tooltip");h.setAttribute("id",v);h.setAttribute("aria-hidden","true");h.setAttribute("data-placement","top");l.setAttribute("part","arrow");l.setAttribute("aria-hidden","true");m.setAttribute("part","body");p.setAttribute("part","text");q.setAttribute("name","content");e.appendChild(g);m.appendChild(p);m.appendChild(q);h.appendChild(l);h.appendChild(m);c.appendChild(d);c.appendChild(e);c.appendChild(h);this.__xTooltipId=
|
|
12
|
-
v;this.__xTooltipRefs={trigger:e,triggerSlot:g,panel:h,arrow:l,body:m,text:p,contentSlot:q}}
|
|
13
|
-
$APP.k(c,"keydown")),d.addEventListener("slotchange",$APP.k(c,"slotchange"))));
|
|
14
|
-
return c};return a},
|
|
12
|
+
v;this.__xTooltipRefs={trigger:e,triggerSlot:g,panel:h,arrow:l,body:m,text:p,contentSlot:q}}wu(this);this.__xTooltipHandlers=vu(this);d=$APP.k(this,"__xTooltipRefs");$APP.n(d)&&(c=$APP.k(this,"__xTooltipHandlers"),$APP.n(c)&&(d=$APP.k(d,"triggerSlot"),this.addEventListener("pointerenter",$APP.k(c,"pointerenter")),this.addEventListener("pointerleave",$APP.k(c,"pointerleave")),this.addEventListener("focusin",$APP.k(c,"focusin")),this.addEventListener("focusout",$APP.k(c,"focusout")),this.addEventListener("keydown",
|
|
13
|
+
$APP.k(c,"keydown")),d.addEventListener("slotchange",$APP.k(c,"slotchange"))));pu(this);return uu(this)};b.disconnectedCallback=function(){ru(this);wu(this);var c=$APP.k(this,"__xTooltipTriggerEl");$APP.n(c)?(c.removeAttribute("aria-describedby"),this.__xTooltipTriggerEl=null,c=void 0):c=null;return c};b.attributeChangedCallback=function(){if($APP.n($APP.k(this,"__xTooltipRefs"))){pu(this);var c=this.hasAttribute("disabled");c=$APP.n($APP.n(c)?this.hasAttribute("open"):c)?tu(this):null}else c=null;
|
|
14
|
+
return c};return a},Du=function(){return $APP.n(customElements.get("x-tooltip"))?null:customElements.define("x-tooltip",Cu())},nu=new $APP.K(null,"delay","delay",-574225219),lu=new $APP.K(null,"delay-raw","delay-raw",886290425);var mu=new $APP.S(null,new $APP.R(null,4,["right",null,"top",null,"bottom",null,"left",null],null),null),Au=["text","placement","delay","disabled","open"];$APP.Pd(["x-tooltip-show",new $APP.R(null,2,[$APP.km,!1,$APP.V,$APP.Qd],null),"x-tooltip-hide",new $APP.R(null,2,[$APP.km,!1,$APP.V,$APP.Qd],null)]);var Bu={n:0};$APP.ha("baredom.exports.x_tooltip.init",Du);export const init=Du;
|