@vanelsas/baredom 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +7 -5
- package/dist/base.js +347 -347
- package/dist/x-alert.js +15 -15
- package/dist/x-avatar-group.js +11 -11
- package/dist/x-avatar.js +15 -15
- package/dist/x-badge.js +11 -11
- package/dist/x-breadcrumbs.js +12 -12
- package/dist/x-button.js +15 -15
- package/dist/x-cancel-dialogue.js +13 -13
- package/dist/x-card.js +7 -7
- package/dist/x-chart.js +47 -47
- package/dist/x-checkbox.js +8 -8
- package/dist/x-chip.js +6 -6
- package/dist/x-collapse.js +10 -10
- package/dist/x-command-palette.js +23 -23
- package/dist/x-container.js +6 -6
- package/dist/x-context-menu.js +19 -19
- package/dist/x-copy.js +22 -22
- package/dist/x-currency-field.js +22 -22
- package/dist/x-date-picker.js +37 -37
- package/dist/x-divider.js +12 -12
- package/dist/x-drawer.js +11 -11
- package/dist/x-dropdown.js +5 -5
- package/dist/x-fieldset.js +6 -6
- package/dist/x-file-download.js +4 -4
- package/dist/x-form-field.js +15 -15
- package/dist/x-form.js +10 -10
- package/dist/x-gaussian-blur.js +32 -32
- package/dist/x-grid.js +7 -7
- package/dist/x-kinetic-typography.js +61 -61
- package/dist/x-menu-item.js +10 -10
- package/dist/x-menu.js +10 -10
- package/dist/x-modal.js +12 -12
- package/dist/x-navbar.js +13 -13
- package/dist/x-notification-center.js +9 -9
- package/dist/x-organic-divider.js +17 -17
- package/dist/x-organic-shape.js +14 -14
- package/dist/x-pagination.js +16 -16
- package/dist/x-popover.js +6 -6
- package/dist/x-progress-circle.js +9 -9
- package/dist/x-progress.js +10 -10
- package/dist/x-radio.js +11 -11
- package/dist/x-ripple-effect.js +12 -12
- package/dist/x-scroll-parallax.js +19 -19
- package/dist/x-scroll-stack.js +20 -0
- package/dist/x-scroll-story.js +35 -35
- package/dist/x-scroll-timeline.js +42 -42
- package/dist/x-scroll.js +40 -40
- package/dist/x-search-field.js +7 -7
- package/dist/x-select.js +9 -9
- package/dist/x-sidebar.js +16 -16
- package/dist/x-skeleton.js +5 -5
- package/dist/x-slider.js +16 -16
- package/dist/x-spacer.js +5 -5
- package/dist/x-spinner.js +5 -5
- package/dist/x-stat.js +11 -11
- package/dist/x-stepper.js +16 -16
- package/dist/x-switch.js +10 -10
- package/dist/x-tab.js +5 -5
- package/dist/x-table-cell.js +23 -23
- package/dist/x-table-row.js +8 -8
- package/dist/x-table.js +15 -15
- package/dist/x-tabs.js +11 -11
- package/dist/x-text-area.js +17 -17
- package/dist/x-timeline-item.js +23 -23
- package/dist/x-timeline.js +9 -9
- package/dist/x-toast.js +19 -19
- package/dist/x-toaster.js +8 -8
- package/dist/x-typography.js +10 -10
- package/package.json +6 -2
package/dist/x-tabs.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
$APP.Zj,a.hasAttribute("loop")],null)},
|
|
4
|
-
b){var c=a.hasAttribute("selected");$APP.n($APP.n(b)?$APP.q(c):b)?a.setAttribute("selected",""):(b=$APP.q(b),$APP.n(b?c:b)&&a.removeAttribute("selected"))},
|
|
5
|
-
b));$APP.n($APP.n(c)?$APP.
|
|
6
|
-
b,$APP.
|
|
7
|
-
$APP.n(c)?b:a},
|
|
8
|
-
$APP.
|
|
9
|
-
d=null;k=$APP.n(d)?$APP.C.h(k,"auto")?
|
|
10
|
-
|
|
11
|
-
d.setAttribute("part","base");d.className="base";d.appendChild(e);b.appendChild(c);b.appendChild(d);this.__x_tabs_root=b;this.__x_tabs_base=d;this.__x_tabs_slot=e;
|
|
12
|
-
b.disconnect():null};a.prototype.attributeChangedCallback=function(){return
|
|
2
|
+
var px=function(a){var b=$APP.N(a);a=$APP.H(b,$APP.si);var c=$APP.H(b,$APP.li),d=$APP.H(b,mx),e=$APP.H(b,$APP.W);b=$APP.H(b,$APP.Zj);c=$APP.K(nx,c)?c:"horizontal";d=$APP.K(ox,d)?d:"auto";return new $APP.Q(null,5,[$APP.si,a,$APP.li,c,mx,d,$APP.W,e,$APP.Zj,$APP.J(b)],null)},qx=function(a){return $APP.l(a,"__x_tabs_initialized")===!0},rx=function(a){return new $APP.Q(null,5,[$APP.si,a.getAttribute("value"),$APP.li,a.getAttribute("orientation"),mx,a.getAttribute("activation"),$APP.W,a.getAttribute("label"),
|
|
3
|
+
$APP.Zj,a.hasAttribute("loop")],null)},sx=function(a){return $APP.fe($APP.Ld(function(b){return $APP.C.h("X-TAB",b.tagName)},$APP.ic(a.children)))},tx=function(a){return $APP.q(a.hasAttribute("disabled"))},ux=function(a){return a.getAttribute("value")},vx=function(a){return $APP.Dd(function(b){return tx(b)?b:null},a)},wx=function(a,b){var c=a.getAttribute("value");$APP.n($APP.n(b)?$APP.O(c,b):b)?a.setAttribute("value",b):(b=b==null||$APP.C.h(b,""),$APP.n(b?c:b)&&a.removeAttribute("value"))},xx=function(a,
|
|
4
|
+
b){var c=a.hasAttribute("selected");$APP.n($APP.n(b)?$APP.q(c):b)?a.setAttribute("selected",""):(b=$APP.q(b),$APP.n(b?c:b)&&a.removeAttribute("selected"))},yx=function(a,b){var c=a.getAttribute("tabindex");$APP.O(c,b)&&a.setAttribute("tabindex",b)},zx=function(a,b){a=a.getAttribute("controls");$APP.n($APP.n(a)?$APP.O(a,""):a)&&(a=document.getElementById(a),$APP.n(a)&&($APP.n(b)?a.removeAttribute("hidden"):a.setAttribute("hidden","")))},Ax=function(a){var b=sx(a),c=a.getAttribute("value"),d=$APP.If($APP.Gd(ux,
|
|
5
|
+
b));$APP.n($APP.n(c)?$APP.K(d,c):c)||(c=vx(b),c=$APP.n(c)?ux(c):null);if($APP.n(c)){a:{d=$APP.u(b);for(var e=null,g=0,h=0;;)if(h<g){var k=e.H(null,h),m=$APP.C.h(ux(k),c);xx(k,m);m&&tx(k)?yx(k,"0"):yx(k,"-1");h+=1}else if(d=$APP.u(d))$APP.Ac(d)?(e=$APP.ob(d),d=$APP.pb(d),k=e,g=$APP.B(e),e=k):(k=$APP.w(d),e=$APP.C.h(ux(k),c),xx(k,e),e&&tx(k)?yx(k,"0"):yx(k,"-1"),d=$APP.z(d),e=null,g=0),h=0;else break a}a:for(b=$APP.u(b),d=null,g=e=0;;)if(g<e)k=d.H(null,g),zx(k,$APP.C.h(ux(k),c)),g+=1;else if(b=$APP.u(b))d=
|
|
6
|
+
b,$APP.Ac(d)?(b=$APP.ob(d),e=$APP.pb(d),d=b,k=$APP.B(b),b=e,e=k):(k=$APP.w(d),zx(k,$APP.C.h(ux(k),c)),b=$APP.z(d),d=null,e=0),g=0;else break a;wx(a,c)}return c},Bx=function(a,b){var c=a.getAttribute("value");return $APP.n($APP.n(b)?$APP.O(c,b):b)?(wx(a,b),Ax(a),a.dispatchEvent(new CustomEvent("value-change",{detail:{value:$APP.n(b)?b:""},bubbles:!0,composed:!0}))):null},Cx=function(a,b,c){b=$APP.B(b)-1;var d=a+1;return d<=b?d:$APP.n(c)?0:a},Dx=function(a,b,c){var d=a-1;b=$APP.B(b)-1;return d>=0?d:
|
|
7
|
+
$APP.n(c)?b:a},Ex=function(a){var b=$APP.l(a,"__x_tabs_base"),c=px(rx(a));$APP.n(b)&&(b.setAttribute("role","tablist"),b.setAttribute("aria-orientation",$APP.li.g(c)),c=$APP.W.g(c),$APP.n($APP.n(c)?$APP.O(c,""):c)?b.setAttribute("aria-label",c):b.removeAttribute("aria-label"));return Ax(a)},Fx=function(a){var b=new MutationObserver(function(){return Ex(a)});b.observe(a,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value","selected","disabled","controls"]});a.__x_tabs_observer=b},Gx=function(a){function b(d){a:{var e=
|
|
8
|
+
$APP.fe($APP.Ld(tx,sx(a))),g=px(rx(a)),h=$APP.li.g(g);var k=mx.g(g);g=$APP.Zj.g(g);var m=d.key,p=e.indexOf(document.activeElement);if(p>=0&&(h=$APP.C.h(h,"horizontal")&&$APP.C.h(m,"ArrowRight")?Cx(p,e,g):$APP.C.h(h,"horizontal")&&$APP.C.h(m,"ArrowLeft")?Dx(p,e,g):$APP.C.h(h,"vertical")&&$APP.C.h(m,"ArrowDown")?Cx(p,e,g):$APP.C.h(h,"vertical")&&$APP.C.h(m,"ArrowUp")?Dx(p,e,g):$APP.C.h(m,"Home")?0:$APP.C.h(m,"End")?$APP.B(e)-1:null,h!=null)){d.preventDefault();d=$APP.E(e,h,null);$APP.n(d)?d.focus():
|
|
9
|
+
d=null;k=$APP.n(d)?$APP.C.h(k,"auto")?Bx(a,ux(d)):null:null;break a}k=null}return k}function c(d){d.stopPropagation();return Bx(a,d.detail.value)}a.addEventListener("tab-select",c);a.addEventListener("keydown",b);a.__x_tabs_on_tab_select=c;a.__x_tabs_on_keydown=b;Fx(a)},Hx=function(a){Object.defineProperty(a.prototype,"value",{get:function(){return this.getAttribute("value")},set:function(b){return $APP.n(b)?this.setAttribute("value",b):this.removeAttribute("value")},configurable:!0,enumerable:!0})},
|
|
10
|
+
Jx=function(){var a=class extends HTMLElement{};a.observedAttributes=Ix;a.prototype.connectedCallback=function(){if(qx(this)){Gx(this);var b=Ex(this)}else{if(!qx(this)){b=this.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("slot");c.textContent=":host{display:block;color-scheme:light dark;}.base{display:flex;flex-direction:row;}.base[aria-orientation\x3d'vertical']{flex-direction:column;}::slotted(x-tab){margin-inline-end:var(--x-tabs-gap,8px);}:host([orientation\x3d'vertical']) ::slotted(x-tab){margin-inline-end:0;margin-block-end:var(--x-tabs-gap,8px);}";
|
|
11
|
+
d.setAttribute("part","base");d.className="base";d.appendChild(e);b.appendChild(c);b.appendChild(d);this.__x_tabs_root=b;this.__x_tabs_base=d;this.__x_tabs_slot=e;Gx(this);this.__x_tabs_initialized=!0}Ex(this);b=this}return b};a.prototype.disconnectedCallback=function(){var b=$APP.l(this,"__x_tabs_on_tab_select");$APP.n(b)&&this.removeEventListener("tab-select",b);b=$APP.l(this,"__x_tabs_on_keydown");$APP.n(b)&&this.removeEventListener("keydown",b);b=$APP.l(this,"__x_tabs_observer");return $APP.n(b)?
|
|
12
|
+
b.disconnect():null};a.prototype.attributeChangedCallback=function(){return qx(this)?Ex(this):null};Hx(a);return a},Kx=function(){return $APP.n(customElements.get("x-tabs"))?null:customElements.define("x-tabs",Jx())},mx=new $APP.M(null,"activation","activation",2128521072);var Ix=["value","orientation","activation","label","loop"],nx=new $APP.R(null,new $APP.Q(null,2,["vertical",null,"horizontal",null],null),null),ox=new $APP.R(null,new $APP.Q(null,2,["auto",null,"manual",null],null),null);$APP.zd(["value-change",new $APP.Q(null,1,[$APP.Y,new $APP.Q(null,1,[$APP.si,$APP.X],null)],null)]);$APP.ja("baredom.exports.x_tabs.init",Kx);export const init=Kx;
|
package/dist/x-text-area.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
c):b.setValidity({},"",c)},
|
|
4
|
-
a.hasAttribute("readonly"),a.getAttribute("value"),a.getAttribute("autocomplete"),a.getAttribute("minlength"),a.getAttribute("placeholder")]);var h=$APP.
|
|
5
|
-
m=$APP.n(m)?m:"";y=typeof y==="string"&&$APP.
|
|
6
|
-
c.name=$APP.mj.g(g);c.placeholder=$APP.Mj.g(g);c.disabled=$APP.V.g(g);c.readOnly=$APP.uk.g(g);c.required=$APP.
|
|
7
|
-
$APP.n($APP.n(A)?D:A)?"hint error":$APP.n(A)?"hint":$APP.n(D)?"error":null;$APP.n(
|
|
8
|
-
"__xTextAreaInternals");return $APP.n(d)?
|
|
9
|
-
$APP.l(a,"__xTextAreaRefs");if($APP.n(b)){b=$APP.l(b,"textarea");var c=b.value;var d=a.getAttribute("name");d=$APP.n(d)?d:"";var e=$APP.l(a,"__xTextAreaInternals");$APP.n(e)&&(e.setFormValue(c),
|
|
10
|
-
a.__xTextAreaHandlers=null;return}}return null},
|
|
11
|
-
enumerable:!0,get:function(){var e=
|
|
12
|
-
b);var c=$APP.l(this,"__xTextAreaRefs");return $APP.n(c)?$APP.l(c,"textarea").value=b:null}})},
|
|
2
|
+
var DN=function(a){return typeof a==="string"?(a=parseInt(a,10),$APP.q(isNaN(a))&&a>0?a:null):null},EN=function(a,b,c){return a.setAttribute(b,c)},FN=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},GN=function(a,b,c){var d=a.hasAttribute("error");var e=a.getAttribute("error");e=$APP.n(e)?e:"";a=a.hasAttribute("required");var g=c.value;return $APP.n(d)?b.setValidity({customError:!0},e,c):$APP.n($APP.n(a)?$APP.C.h(g,""):a)?b.setValidity({valueMissing:!0},"Please fill in this field.",
|
|
3
|
+
c):b.setValidity({},"",c)},PN=function(a){var b=$APP.l(a,"__xTextAreaRefs");if($APP.n(b)){var c=$APP.l(b,"textarea"),d=$APP.l(b,"label"),e=$APP.l(b,"hint");b=$APP.l(b,"error");var g=$APP.gf([HN,$APP.Dh,$APP.Ai,$APP.$h,$APP.ui,IN,$APP.aj,JN,$APP.Tg,$APP.Cj,$APP.Rj,$APP.Ch,KN,$APP.gi],[a.getAttribute("resize"),a.getAttribute("label"),a.getAttribute("name"),a.getAttribute("error"),a.getAttribute("hint"),a.getAttribute("rows"),a.hasAttribute("disabled"),a.getAttribute("maxlength"),a.hasAttribute("required"),
|
|
4
|
+
a.hasAttribute("readonly"),a.getAttribute("value"),a.getAttribute("autocomplete"),a.getAttribute("minlength"),a.getAttribute("placeholder")]);var h=$APP.N(g),k=$APP.H(h,KN),m=$APP.H(h,$APP.gi),p=$APP.H(h,HN),r=$APP.H(h,$APP.Dh),v=$APP.H(h,$APP.Ai),x=$APP.H(h,$APP.$h),y=$APP.H(h,$APP.ui),A=$APP.H(h,IN);g=$APP.H(h,$APP.aj);var D=$APP.H(h,JN),G=$APP.H(h,$APP.Tg),I=$APP.H(h,$APP.Cj),F=$APP.H(h,$APP.Rj);h=$APP.H(h,$APP.Ch);var P=$APP.n(x)?x:"",la=$APP.n(y)?y:"",Ca=$APP.n(r)?r:"";G=$APP.J(G);I=$APP.J(I);
|
|
5
|
+
m=$APP.n(m)?m:"";y=typeof y==="string"&&$APP.O(y,"")&&y!=null;v=$APP.n(v)?v:"";F=$APP.n(F)?F:"";k=DN(k);r=typeof r==="string"&&$APP.O(r,"")&&r!=null;x=typeof x==="string"&&$APP.O(x,"")&&x!=null;p=typeof p==="string"&&$APP.K(LN,p)?p:"vertical";A=DN(A);g=$APP.gf([$APP.zh,$APP.uk,$APP.Mj,$APP.Jh,$APP.mj,$APP.si,MN,$APP.Fi,$APP.Oh,NN,$APP.qj,ON,$APP.Yi,$APP.W,$APP.Vh,$APP.sj,$APP.V],[G,I,m,y,v,F,k,r,x,p,la,DN(D),$APP.n(A)?A:3,Ca,P,$APP.n(h)?h:"",$APP.J(g)]);D=$APP.Oh.g(g);A=$APP.Jh.g(g);h=$APP.Fi.g(g);
|
|
6
|
+
c.name=$APP.mj.g(g);c.placeholder=$APP.Mj.g(g);c.disabled=$APP.V.g(g);c.readOnly=$APP.uk.g(g);c.required=$APP.zh.g(g);c.rows=$APP.Yi.g(g);c.autocomplete=$APP.sj.g(g);P=ON.g(g);$APP.n(P)?EN(c,"maxlength",""+$APP.S.g(P)):c.removeAttribute("maxlength");P=MN.g(g);$APP.n(P)?EN(c,"minlength",""+$APP.S.g(P)):c.removeAttribute("minlength");a.style.setProperty("--x-text-area-resize",NN.g(g));EN(c,"aria-required",$APP.n($APP.zh.g(g))?"true":"false");c.setAttribute("aria-invalid",$APP.n(D)?"true":"false");P=
|
|
7
|
+
$APP.n($APP.n(A)?D:A)?"hint error":$APP.n(A)?"hint":$APP.n(D)?"error":null;$APP.n(P)?c.setAttribute("aria-describedby",P):c.removeAttribute("aria-describedby");d.textContent=$APP.W.g(g);$APP.n(h)?d.classList.remove("label-hidden"):d.classList.add("label-hidden");e.textContent=$APP.qj.g(g);$APP.n(A)?e.classList.remove("hint-hidden"):e.classList.add("hint-hidden");b.textContent=$APP.Vh.g(g);$APP.n(D)?b.classList.remove("error-hidden"):b.classList.add("error-hidden");FN(a,"data-invalid",D);d=$APP.l(a,
|
|
8
|
+
"__xTextAreaInternals");return $APP.n(d)?GN(a,d,c):null}return null},QN=function(a,b,c){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:!1}))},RN=function(a){return function(){var b=$APP.l(a,"__xTextAreaRefs");if($APP.n(b)){b=$APP.l(b,"textarea");var c=b.value;var d=a.getAttribute("name");d=$APP.n(d)?d:"";var e=$APP.l(a,"__xTextAreaInternals");$APP.n(e)&&(e.setFormValue(c),GN(a,e,b));return QN(a,"x-text-area-input",{name:d,value:c})}return null}},SN=function(a){return function(){var b=
|
|
9
|
+
$APP.l(a,"__xTextAreaRefs");if($APP.n(b)){b=$APP.l(b,"textarea");var c=b.value;var d=a.getAttribute("name");d=$APP.n(d)?d:"";var e=$APP.l(a,"__xTextAreaInternals");$APP.n(e)&&(e.setFormValue(c),GN(a,e,b));return QN(a,"x-text-area-change",{name:d,value:c})}return null}},TN=function(a){var b=$APP.l(a,"__xTextAreaRefs");if($APP.n(b)){var c=$APP.l(a,"__xTextAreaHandlers");if($APP.n(c)){b=$APP.l(b,"textarea");b.removeEventListener("input",$APP.l(c,"input"));b.removeEventListener("change",$APP.l(c,"change"));
|
|
10
|
+
a.__xTextAreaHandlers=null;return}}return null},UN=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.O(d)?EN(this,c,""+$APP.S.g(d)):this.removeAttribute(c)}})},VN=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return FN(this,c,$APP.J(d))}})},WN=function(a,b,c,d){Object.defineProperty(a,b,{configurable:!0,
|
|
11
|
+
enumerable:!0,get:function(){var e=DN(this.getAttribute(c));return $APP.n(e)?e:d},set:function(e){return e!=null&&$APP.O(e)&&e>0?EN(this,c,""+$APP.S.g(Math.floor(e))):this.removeAttribute(c)}})},XN=function(a){Object.defineProperty(a,"value",{configurable:!0,enumerable:!0,get:function(){var b=$APP.l(this,"__xTextAreaRefs");if($APP.n(b))return $APP.l(b,"textarea").value;b=this.getAttribute("value");return $APP.n(b)?b:""},set:function(b){b=b!=null&&$APP.O(b)?""+$APP.S.g(b):"";this.setAttribute("value",
|
|
12
|
+
b);var c=$APP.l(this,"__xTextAreaRefs");return $APP.n(c)?$APP.l(c,"textarea").value=b:null}})},ZN=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=!0;Object.defineProperty(a,"observedAttributes",{get:function(){return YN}});XN(b);UN(b,"name","name");UN(b,"placeholder","placeholder");UN(b,"autocomplete","autocomplete");VN(b,"disabled","disabled");VN(b,"readOnly","readonly");VN(b,"required","required");WN(b,"rows","rows",3);WN(b,"maxLength","maxlength",null);WN(b,"minLength",
|
|
13
13
|
"minlength",null);b.connectedCallback=function(){if(!$APP.n($APP.l(this,"__xTextAreaRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("div"),g=document.createElement("label"),h=document.createElement("div"),k=document.createElement("textarea"),m=document.createElement("span"),p=document.createElement("span");d.textContent=":host{display:block;color-scheme:light dark;--x-text-area-label-color:#374151;--x-text-area-label-font-size:0.875rem;--x-text-area-bg:#ffffff;--x-text-area-color:#111827;--x-text-area-border:1px solid #d1d5db;--x-text-area-border-radius:6px;--x-text-area-padding:0.5rem 0.75rem;--x-text-area-focus-ring-color:#2563eb;--x-text-area-error-color:#dc2626;--x-text-area-hint-color:#6b7280;--x-text-area-disabled-opacity:0.45;--x-text-area-min-height:5rem;--x-text-area-font-size:1rem;--x-text-area-resize:vertical;}@media (prefers-color-scheme:dark){:host{--x-text-area-label-color:#d1d5db;--x-text-area-bg:#1f2937;--x-text-area-color:#f9fafb;--x-text-area-border:1px solid #4b5563;--x-text-area-focus-ring-color:#3b82f6;--x-text-area-error-color:#f87171;--x-text-area-hint-color:#9ca3af;}}[part\x3dfield]{display:flex;flex-direction:column;gap:0.25rem;}[part\x3dlabel]{display:block;font-size:var(--x-text-area-label-font-size);font-weight:500;color:var(--x-text-area-label-color);}.label-hidden{display:none;}[part\x3dtextarea-wrapper]{display:block;}[part\x3dtextarea]{display:block;width:100%;box-sizing:border-box;min-height:var(--x-text-area-min-height);padding:var(--x-text-area-padding);background:var(--x-text-area-bg);color:var(--x-text-area-color);border:var(--x-text-area-border);border-radius:var(--x-text-area-border-radius);font-size:var(--x-text-area-font-size);line-height:1.5;font-family:inherit;outline:none;resize:var(--x-text-area-resize);transition:border-color 120ms ease,box-shadow 120ms ease;}[part\x3dtextarea]:focus{border-color:var(--x-text-area-focus-ring-color);box-shadow:0 0 0 3px color-mix(in srgb,var(--x-text-area-focus-ring-color) 20%,transparent);}:host([data-invalid]) [part\x3dtextarea]{border-color:var(--x-text-area-error-color);}:host([data-invalid]) [part\x3dtextarea]:focus{box-shadow:0 0 0 3px color-mix(in srgb,var(--x-text-area-error-color) 20%,transparent);}[part\x3dtextarea]:disabled{opacity:var(--x-text-area-disabled-opacity);cursor:not-allowed;}[part\x3dhint]{display:block;font-size:0.8125rem;color:var(--x-text-area-hint-color);}.hint-hidden{display:none;}[part\x3derror]{display:block;font-size:0.8125rem;color:var(--x-text-area-error-color);}.error-hidden{display:none;}@media (prefers-reduced-motion:reduce){[part\x3dtextarea]{transition:none;}}";
|
|
14
14
|
e.setAttribute("part","field");g.setAttribute("part","label");g.setAttribute("id","label");g.setAttribute("for","textarea");h.setAttribute("part","textarea-wrapper");k.setAttribute("part","textarea");k.setAttribute("id","textarea");k.setAttribute("aria-labelledby","label");m.setAttribute("part","hint");m.setAttribute("id","hint");m.setAttribute("aria-live","polite");p.setAttribute("part","error");p.setAttribute("id","error");p.setAttribute("role","alert");p.setAttribute("aria-live","assertive");h.appendChild(k);
|
|
15
|
-
e.appendChild(g);e.appendChild(h);e.appendChild(m);e.appendChild(p);c.appendChild(d);c.appendChild(e);this.__xTextAreaRefs={field:e,label:g,textarea:k,hint:m,error:p};$APP.n(this.attachInternals)&&(this.__xTextAreaInternals=this.attachInternals())}
|
|
16
|
-
$APP.l(this,"__xTextAreaRefs");$APP.n(c)&&(c=$APP.l(c,"textarea"),d=
|
|
17
|
-
"disabled",$APP.
|
|
18
|
-
|
|
19
|
-
$APP.
|
|
20
|
-
null),new $APP.Q(null,2,[$APP.Z,$APP.
|
|
15
|
+
e.appendChild(g);e.appendChild(h);e.appendChild(m);e.appendChild(p);c.appendChild(d);c.appendChild(e);this.__xTextAreaRefs={field:e,label:g,textarea:k,hint:m,error:p};$APP.n(this.attachInternals)&&(this.__xTextAreaInternals=this.attachInternals())}TN(this);c=$APP.l(this,"__xTextAreaRefs");$APP.n(c)&&(c=$APP.l(c,"textarea"),d=this.getAttribute("value"),$APP.n(d)&&(c.value=d));c=$APP.l(this,"__xTextAreaInternals");$APP.n(c)&&(d=c.setFormValue,e=this.getAttribute("value"),d.call(c,$APP.n(e)?e:""));c=
|
|
16
|
+
$APP.l(this,"__xTextAreaRefs");$APP.n(c)&&(c=$APP.l(c,"textarea"),d=RN(this),e=SN(this),c.addEventListener("input",d),c.addEventListener("change",e),this.__xTextAreaHandlers={input:d,change:e});return PN(this)};b.disconnectedCallback=function(){return TN(this)};b.attributeChangedCallback=function(c,d,e){$APP.C.h(c,"value")&&(c=$APP.l(this,"__xTextAreaRefs"),$APP.n(c)&&(c=$APP.l(c,"textarea"),$APP.O(c.value,e)&&(c.value=$APP.n(e)?e:"")));return PN(this)};b.formDisabledCallback=function(c){FN(this,
|
|
17
|
+
"disabled",$APP.J(c));return PN(this)};b.formResetCallback=function(){this.removeAttribute("value");var c=$APP.l(this,"__xTextAreaRefs");$APP.n(c)&&($APP.l(c,"textarea").value="");c=$APP.l(this,"__xTextAreaInternals");$APP.n(c)&&c.setFormValue("");return PN(this)};return a},$N=function(){return $APP.n(customElements.get("x-text-area"))?null:customElements.define("x-text-area",ZN())},MN=new $APP.M(null,"minlength","minlength",259053545),KN=new $APP.M(null,"minlength-raw","minlength-raw",-1245403779),
|
|
18
|
+
JN=new $APP.M(null,"maxlength-raw","maxlength-raw",-886656470),HN=new $APP.M(null,"resize-raw","resize-raw",-287517888),ON=new $APP.M(null,"maxlength","maxlength",-1163911985),IN=new $APP.M(null,"rows-raw","rows-raw",-1828357145),NN=new $APP.M(null,"resize","resize",297367086);var YN="label name value placeholder hint error disabled readonly required rows maxlength minlength autocomplete resize".split(" "),LN=new $APP.R(null,new $APP.Q(null,4,["none",null,"vertical",null,"both",null,"horizontal",null],null),null);
|
|
19
|
+
$APP.gf([$APP.Fj,$APP.mj,$APP.si,new $APP.M(null,"minLength","minLength",-1538722770),$APP.Yi,$APP.Ij,new $APP.M(null,"maxLength","maxLength",-1633020073),$APP.sj,$APP.dh],[new $APP.Q(null,2,[$APP.Z,$APP.Yj,$APP.T,"disabled"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.T,"name"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.T,"value"],null),new $APP.Q(null,2,[$APP.Z,$APP.U,$APP.T,"minlength"],null),new $APP.Q(null,2,[$APP.Z,$APP.U,$APP.T,"rows"],null),new $APP.Q(null,2,[$APP.Z,$APP.Yj,$APP.T,"readonly"],
|
|
20
|
+
null),new $APP.Q(null,2,[$APP.Z,$APP.U,$APP.T,"maxlength"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.T,"autocomplete"],null),new $APP.Q(null,2,[$APP.Z,$APP.Yj,$APP.T,"required"],null)]);$APP.ja("baredom.exports.x_text_area.init",$N);export const init=$N;
|
package/dist/x-timeline-item.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var Uk=function(a){a=$APP.
|
|
3
|
-
b){a=$APP.
|
|
4
|
-
$APP.
|
|
5
|
-
pl,$APP.yk,$APP.V,ql],[Zk(h),c,m,$APP.
|
|
6
|
-
p=document.createElement("slot"),r=document.createElement("span"),v=document.createElement("div"),x=document.createElement("div"),y=document.createElement("div"),A=document.createElement("div"),D=document.createElement("slot"),
|
|
2
|
+
var Uk=function(a){a=$APP.H(Tk,typeof a==="string"?a.toLowerCase():null);return $APP.n(a)?a:$APP.wh},Wk=function(a){a=$APP.H(Vk,a);return $APP.n(a)?a:"pending"},Zk=function(a){a=$APP.H(Xk,typeof a==="string"?a.toLowerCase():null);return $APP.n(a)?a:Yk},$k=function(a){return typeof a==="string"?(a=a.trim(),$APP.O(a,"")&&$APP.O(a.toLowerCase(),"none")?a:null):null},al=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),typeof a==="number"&&$APP.q(isNaN(a))&&a>=0?a:null):null},cl=function(a,
|
|
3
|
+
b){a=$APP.H(bl,typeof a==="string"?a.toLowerCase():null);$APP.n(a)?b=a:(b=$APP.H(bl,typeof b==="string"?b.toLowerCase():null),b=$APP.n(b)?b:$APP.Gj);return b},dl=function(a,b,c){a=Wk(a);c=c!=null?"Step "+$APP.S.g(c+1)+": ":null;return""+$APP.S.g(c)+$APP.S.g(typeof b==="string"&&$APP.O(b,"")?""+$APP.S.g(b)+" ":null)+"("+$APP.S.g(a)+")"},rl=function(a){var b=$APP.N(a),c=$APP.H(b,el);a=$APP.H(b,$APP.V);var d=$APP.H(b,$APP.Uj),e=$APP.H(b,$APP.Dh),g=$APP.H(b,fl),h=$APP.H(b,gl),k=$APP.H(b,hl),m=$APP.H(b,
|
|
4
|
+
$APP.mi),p=$APP.H(b,il),r=$APP.H(b,$APP.ah),v=$APP.H(b,jl);b=$APP.H(b,$APP.rj);var x=Uk(m),y=$k(b),A=$APP.n($APP.n(r)?y==null:r)?$APP.qk:y!=null?$APP.Ni:$APP.yh;m=function(){var D=A instanceof $APP.M?A.ra:null;switch(D){case "default":return D=$APP.H(kl,x),$APP.n(D)?D:$APP.H(kl,$APP.wh);case "custom":return y;case "hidden":return null;default:throw Error("No matching clause: "+$APP.S.g(D));}}();c=al(c);d=cl(k,d);e=$APP.n(e)?e:"";v=$APP.n(v)?v:"";return $APP.gf([ll,ml,nl,fl,il,$APP.xh,ol,$APP.Xg,$APP.W,
|
|
5
|
+
pl,$APP.yk,$APP.V,ql],[Zk(h),c,m,$APP.J(g),$APP.J(p),$APP.C.h(A,$APP.Ni)?y:null,v,x,e,dl(x,e,c),A,$APP.J(a),d])},sl=function(a){a=$APP.N(a);a=$APP.H(a,$APP.V);return $APP.q(a)},Nl=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"),g=document.createElement("slot"),h=document.createElement("span"),k=document.createElement("div"),m=document.createElement("div"),
|
|
6
|
+
p=document.createElement("slot"),r=document.createElement("span"),v=document.createElement("div"),x=document.createElement("div"),y=document.createElement("div"),A=document.createElement("div"),D=document.createElement("slot"),G=document.createElement("div"),I=document.createElement("slot");c.textContent=":host{display:block;color-scheme:light dark;--x-timeline-item-marker-size:2rem;--x-timeline-item-marker-bg:rgba(0,0,0,0.06);--x-timeline-item-marker-color:rgba(0,0,0,0.45);--x-timeline-item-connector-color: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:rgba(0,0,0,0.5);--x-timeline-item-label-font-size:0.8125rem;--x-timeline-item-title-font-size:0.9375rem;--x-timeline-item-stripe-bg:rgba(0,0,0,0.025);--x-timeline-item-motion:150ms;--x-timeline-item-motion-ease: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:rgba(255,255,255,0.10);--x-timeline-item-marker-color:rgba(255,255,255,0.55);--x-timeline-item-connector-color:rgba(255,255,255,0.15);--x-timeline-item-label-color:rgba(255,255,255,0.5);--x-timeline-item-stripe-bg:rgba(255,255,255,0.03);}}:host([data-status\x3d'active']){--x-timeline-item-marker-bg:rgba(0,102,204,1);--x-timeline-item-marker-color:#fff;--x-timeline-item-connector-color:rgba(0,102,204,0.4);}:host([data-status\x3d'complete']){--x-timeline-item-marker-bg:rgba(16,140,72,1);--x-timeline-item-marker-color:#fff;--x-timeline-item-connector-color:rgba(16,140,72,0.5);}:host([data-status\x3d'error']){--x-timeline-item-marker-bg:rgba(190,20,40,1);--x-timeline-item-marker-color:#fff;--x-timeline-item-connector-color:rgba(190,20,40,0.4);}:host([data-status\x3d'warning']){--x-timeline-item-marker-bg:rgba(204,120,0,1);--x-timeline-item-marker-color:#fff;--x-timeline-item-connector-color:rgba(204,120,0,0.4);}@media (prefers-color-scheme:dark){:host([data-status\x3d'active']){--x-timeline-item-marker-bg:rgba(80,160,255,1);--x-timeline-item-connector-color:rgba(80,160,255,0.4);}:host([data-status\x3d'complete']){--x-timeline-item-marker-bg:rgba(60,210,120,1);--x-timeline-item-connector-color:rgba(60,210,120,0.5);}:host([data-status\x3d'error']){--x-timeline-item-marker-bg:rgba(255,90,110,1);--x-timeline-item-connector-color:rgba(255,90,110,0.4);}:host([data-status\x3d'warning']){--x-timeline-item-marker-bg:rgba(255,190,90,1);--x-timeline-item-connector-color:rgba(255,190,90,0.4);}}:host([data-striped]){background:var(--x-timeline-item-stripe-bg);border-radius: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 rgba(0,102,204,0.55);outline-offset:2px;}@media (prefers-color-scheme:dark){:host(:not([disabled])):focus-visible{outline-color: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);k.setAttribute("class","track-col");m.setAttribute("class","marker");p.setAttribute("name","icon");r.setAttribute("class","default-icon");r.setAttribute("aria-hidden","true");p.appendChild(r);m.appendChild(p);v.setAttribute("class","connector");k.appendChild(m);k.appendChild(v);x.setAttribute("class","content-col");y.setAttribute("class",
|
|
8
|
-
"title");A.setAttribute("class","body");A.appendChild(D);
|
|
9
|
-
$APP.
|
|
10
|
-
ol),e=$APP.
|
|
11
|
-
"listitem");$APP.n(h)?(a.setAttribute("aria-disabled","true"),a.tabIndex=-1):(a.removeAttribute("aria-disabled"),a.tabIndex=0);e=$APP.
|
|
12
|
-
(a.__xTimelineItemEntered=!0,a.setAttribute("data-entering",""),a.addEventListener("animationend",function d(c){return $APP.C.h(c.target,a)?(a.removeEventListener("animationend",d),a.removeAttribute("data-entering")):null}))},Tl=function(a){var b=$APP.l(a,"__xTimelineItemModel");var c=$APP.n(b)?b:Ol(a);b=a.dispatchEvent;var d=CustomEvent,e=$APP.
|
|
13
|
-
composed:!0,cancelable:!0}))},Ul=function(a){function b(d){var e=d.key;if($APP.C.h(e,"Enter")||$APP.C.h(e," "))e=$APP.l(a,"__xTimelineItemModel"),e=$APP.n(e)?e:Ol(a),sl(e)&&(d.preventDefault(),Tl(a));return null}function c(){var d=$APP.l(a,"__xTimelineItemModel");d=$APP.n(d)?d:Ol(a);sl(d)&&Tl(a);return null}a.addEventListener("click",c);a.addEventListener("keydown",b);$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)}a.__xTimelineItemHandlers=null},Wl=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.
|
|
15
|
-
return $APP.n(b)?b:""},set:function(b){return $APP.n($APP.n(b)?$APP.
|
|
16
|
-
set:function(b){return $APP.n(b)?this.setAttribute("icon",""+$APP.
|
|
17
|
-
b:"start"},set:function(b){return $APP.n(b)?this.setAttribute("position",""+$APP.
|
|
18
|
-
Ul(this);var b=this.getAttribute("data-position");$APP.n(b)&&(this.__xTimelineItemParentPos=b);Rl(this);Sl(this);b=$APP.l(this,"__xTimelineItemModel");var c=$APP.n(b)?b:Ol(this);b=this.dispatchEvent;var d=CustomEvent,e=$APP.
|
|
19
|
-
a.prototype.disconnectedCallback=function(){var b=$APP.l(this,"__xTimelineItemModel");var c=$APP.n(b)?b:Ol(this);Vl(this);this.__xTimelineItemEntered=null;b=document;var d=b.dispatchEvent,e=CustomEvent,g=$APP.
|
|
20
|
-
"data-position"),c=!$APP.n(c?$APP.l(this,"__xTimelineItemSelfPos"):c);c&&($APP.C.h(b,"data-position")&&(this.__xTimelineItemParentPos=d),Rl(this));return null};Wl(a.prototype);return a},Zl=function(){$APP.n(customElements.get("x-timeline-item"))||customElements.define("x-timeline-item",Yl());return null},jl=new $APP.
|
|
21
|
-
"marker-icon",424963779),ll=new $APP.
|
|
22
|
-
"data-last?",-1110326839),
|
|
23
|
-
new $APP.
|
|
24
|
-
$APP.
|
|
25
|
-
var Tk=new $APP.Q(null,5,["pending",$APP.
|
|
8
|
+
"title");A.setAttribute("class","body");A.appendChild(D);G.setAttribute("class","actions");I.setAttribute("name","actions");G.appendChild(I);x.appendChild(y);x.appendChild(A);x.appendChild(G);d.appendChild(e);d.appendChild(k);d.appendChild(x);b.appendChild(c);b.appendChild(d);b=$APP.gf([ll,tl,$APP.Ah,$APP.kk,ul,vl,$APP.ak,wl,$APP.Yh,xl,yl,Jl,Kl,Ll,$APP.gj,Ml],[v,h,m,r,e,k,A,D,b,I,y,x,d,G,p,g]);a.__xTimelineItemRefs=b;return $APP.l(a,"__xTimelineItemRefs")},Ol=function(a){return rl($APP.gf([$APP.Uj,
|
|
9
|
+
$APP.Dh,fl,gl,hl,$APP.mi,il,$APP.ah,jl,$APP.rj,el,$APP.V],[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")]))},Rl=function(a){var b=Ol(a);if($APP.O($APP.l(a,"__xTimelineItemModel"),b)){b=$APP.N(b);var c=$APP.H(b,$APP.W),d=$APP.H(b,
|
|
10
|
+
ol),e=$APP.H(b,$APP.Xg),g=$APP.H(b,ql),h=$APP.H(b,$APP.V),k=$APP.H(b,nl),m=$APP.H(b,pl),p=Nl(a),r=$APP.N(p);p=$APP.H(r,tl);var v=$APP.H(r,$APP.Ah),x=$APP.H(r,yl);r=$APP.H(r,$APP.kk);a.setAttribute("data-status",Wk(e));a.__xTimelineItemSelfPos=!0;a.setAttribute("data-position",$APP.Jf(g));a.__xTimelineItemSelfPos=null;$APP.C.h(ll.g(b),Pl)?a.setAttribute("data-connector","dashed"):$APP.C.h(ll.g(b),Ql)?a.setAttribute("data-connector","none"):a.removeAttribute("data-connector");a.setAttribute("role",
|
|
11
|
+
"listitem");$APP.n(h)?(a.setAttribute("aria-disabled","true"),a.tabIndex=-1):(a.removeAttribute("aria-disabled"),a.tabIndex=0);e=$APP.O(d,"")?d:$APP.O(c,"")?c:null;$APP.n(e)?a.setAttribute("aria-label",e):a.removeAttribute("aria-label");v.setAttribute("aria-label",m);p.textContent=c;r.textContent=k!=null?k:"";$APP.O(d,"")?(x.removeAttribute("hidden"),x.textContent=d):(x.setAttribute("hidden",""),x.textContent="");a.__xTimelineItemModel=b}},Sl=function(a){$APP.n($APP.l(a,"__xTimelineItemEntered"))||
|
|
12
|
+
(a.__xTimelineItemEntered=!0,a.setAttribute("data-entering",""),a.addEventListener("animationend",function d(c){return $APP.C.h(c.target,a)?(a.removeEventListener("animationend",d),a.removeAttribute("data-entering")):null}))},Tl=function(a){var b=$APP.l(a,"__xTimelineItemModel");var c=$APP.n(b)?b:Ol(a);b=a.dispatchEvent;var d=CustomEvent,e=$APP.N(c);c=$APP.H(e,$APP.Xg);e=$APP.H(e,$APP.W);c=new $APP.Q(null,2,[$APP.Xg,Wk(c),$APP.W,e],null);b.call(a,new d("x-timeline-item-click",{detail:$APP.Mg(c),bubbles:!0,
|
|
13
|
+
composed:!0,cancelable:!0}))},Ul=function(a){function b(d){var e=d.key;if($APP.C.h(e,"Enter")||$APP.C.h(e," "))e=$APP.l(a,"__xTimelineItemModel"),e=$APP.n(e)?e:Ol(a),sl(e)&&(d.preventDefault(),Tl(a));return null}function c(){var d=$APP.l(a,"__xTimelineItemModel");d=$APP.n(d)?d:Ol(a);sl(d)&&Tl(a);return null}a.addEventListener("click",c);a.addEventListener("keydown",b);$APP.ma(a,"__xTimelineItemHandlers",{click:c,keydown:b})},Vl=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)}a.__xTimelineItemHandlers=null},Wl=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.O(b,""):b)?this.setAttribute("label",""+$APP.S.g(b)):this.removeAttribute("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.O(b,""):b)?this.setAttribute("title",""+$APP.S.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.S.g(b)):this.removeAttribute("status")},enumerable:!0,configurable:!0});Object.defineProperty(a,"icon",{get:function(){return this.getAttribute("icon")},
|
|
16
|
+
set:function(b){return $APP.n(b)?this.setAttribute("icon",""+$APP.S.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.S.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.S.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})},Yl=function(){var a=class extends HTMLElement{};a.observedAttributes=Xl;a.prototype.connectedCallback=function(){Nl(this);Vl(this);
|
|
18
|
+
Ul(this);var b=this.getAttribute("data-position");$APP.n(b)&&(this.__xTimelineItemParentPos=b);Rl(this);Sl(this);b=$APP.l(this,"__xTimelineItemModel");var c=$APP.n(b)?b:Ol(this);b=this.dispatchEvent;var d=CustomEvent,e=$APP.N(c);c=$APP.H(e,$APP.Xg);var g=$APP.H(e,$APP.W),h=$APP.H(e,ql);e=$APP.H(e,$APP.V);c=new $APP.Q(null,4,[$APP.Xg,Wk(c),$APP.W,g,$APP.sk,$APP.Jf(h),$APP.Fj,$APP.J(e)],null);b.call(this,new d("x-timeline-item-connected",{detail:$APP.Mg(c),bubbles:!0,composed:!0,cancelable:!1}));return null};
|
|
19
|
+
a.prototype.disconnectedCallback=function(){var b=$APP.l(this,"__xTimelineItemModel");var c=$APP.n(b)?b:Ol(this);Vl(this);this.__xTimelineItemEntered=null;b=document;var d=b.dispatchEvent,e=CustomEvent,g=$APP.N(c);c=$APP.H(g,$APP.Xg);g=$APP.H(g,$APP.W);c=new $APP.Q(null,2,[$APP.Xg,Wk(c),$APP.W,g],null);d.call(b,new e("x-timeline-item-disconnected",{detail:$APP.Mg(c),bubbles:!1,composed:!1,cancelable:!1}));return null};a.prototype.attributeChangedCallback=function(b,c,d){if(c=$APP.O(c,d))c=$APP.C.h(b,
|
|
20
|
+
"data-position"),c=!$APP.n(c?$APP.l(this,"__xTimelineItemSelfPos"):c);c&&($APP.C.h(b,"data-position")&&(this.__xTimelineItemParentPos=d),Rl(this));return null};Wl(a.prototype);return a},Zl=function(){$APP.n(customElements.get("x-timeline-item"))||customElements.define("x-timeline-item",Yl());return null},jl=new $APP.M(null,"title-raw","title-raw",976469452),vl=new $APP.M(null,"track-col","track-col",629248272),xl=new $APP.M(null,"actions-slot","actions-slot",1424248629),nl=new $APP.M(null,"marker-icon",
|
|
21
|
+
"marker-icon",424963779),ll=new $APP.M(null,"connector","connector",-1517293248),Yk=new $APP.M(null,"solid","solid",-2023773691),yl=new $APP.M(null,"title-el","title-el",-401767816),ol=new $APP.M(null,"title","title",636505583),gl=new $APP.M(null,"connector-raw","connector-raw",106333796),wl=new $APP.M(null,"default-slot","default-slot",-1145647151),ql=new $APP.M(null,"effective-position","effective-position",840072317),ul=new $APP.M(null,"label-col","label-col",1883390160),il=new $APP.M(null,"data-last?",
|
|
22
|
+
"data-last?",-1110326839),tl=new $APP.M(null,"label-text","label-text",-1566972381),fl=new $APP.M(null,"data-striped?","data-striped?",906911587),hl=new $APP.M(null,"data-position-raw","data-position-raw",256144356),Ll=new $APP.M(null,"actions-el","actions-el",1486248509),Jl=new $APP.M(null,"content-col","content-col",767367449),Pl=new $APP.M(null,"dashed","dashed",-1449249319),el=new $APP.M(null,"data-index-raw","data-index-raw",491574874),Kl=new $APP.M(null,"item-div","item-div",1630512700),$l=
|
|
23
|
+
new $APP.M(null,"active","active",1895962068),ml=new $APP.M(null,"data-index","data-index",1161508385),Ml=new $APP.M(null,"label-slot","label-slot",-1755862561),Ql=new $APP.M(null,"none","none",1333468478),pl=new $APP.M(null,"marker-aria","marker-aria",-353426855);var Xl="label title status icon connector position disabled data-last data-index data-position data-striped".split(" ");
|
|
24
|
+
$APP.zd(["x-timeline-item-connected",new $APP.Q(null,2,[$APP.Y,new $APP.Q(null,4,[$APP.Xg,$APP.X,$APP.W,$APP.X,$APP.sk,$APP.X,$APP.Fj,$APP.Yj],null),$APP.Dj,!1],null),"x-timeline-item-disconnected",new $APP.Q(null,2,[$APP.Y,new $APP.Q(null,2,[$APP.Xg,$APP.X,$APP.W,$APP.X],null),$APP.Dj,!1],null),"x-timeline-item-click",new $APP.Q(null,2,[$APP.Y,new $APP.Q(null,2,[$APP.Xg,$APP.X,$APP.W,$APP.X],null),$APP.Dj,!0],null)]);
|
|
25
|
+
var Tk=new $APP.Q(null,5,["pending",$APP.wh,"active",$l,"complete",$APP.gk,"error",$APP.Vh,"warning",$APP.Bj],null),Vk=new $APP.Q(null,5,[$APP.wh,"pending",$l,"active",$APP.gk,"complete",$APP.Vh,"error",$APP.Bj,"warning"],null),kl=new $APP.Q(null,5,[$APP.wh,"○",$l,"●",$APP.gk,"✓",$APP.Vh,"✕",$APP.Bj,"!"],null),Xk=new $APP.Q(null,3,["solid",Yk,"dashed",Pl,"none",Ql],null),bl=new $APP.Q(null,2,["start",$APP.Gj,"end",$APP.ci],null);$APP.ja("baredom.exports.x_timeline_item.init",Zl);export const init=Zl;
|
package/dist/x-timeline.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
d.setAttribute("part","label");d.setAttribute("hidden","");b.appendChild(c);b.appendChild(d);b.appendChild(e);a.__xTimelineRefs=new $APP.Q(null,3,[$APP.
|
|
4
|
-
$APP.
|
|
5
|
-
c=$APP.
|
|
6
|
-
e=e.detail;typeof g==="string"?(g=parseInt(g,10),g=$APP.n(isNaN(g))?null:g):g=null;var h=$APP.l(e,"status");e=$APP.l(e,"label");e=$APP.
|
|
7
|
-
b);$APP.
|
|
8
|
-
"label",{get:function(){var b=this.getAttribute("label");return $APP.n(b)?b:""},set:function(b){return $APP.n($APP.n(b)?$APP.
|
|
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})},
|
|
10
|
-
|
|
2
|
+
var gM=function(a){a=typeof a==="string"?a.trim().toLowerCase():null;return $APP.K(fM,a)?a:"start"},hM=function(a,b){switch(a){case "start":return"start";case "end":return"end";case "alternating":return $APP.Sc(b,2)===0?"start":"end";default:return"start"}},jM=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:inherit;--x-timeline-label-font-size: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.Q(null,3,[$APP.Yh,b,iM,d,$APP.Pi,e],null);return $APP.l(a,"__xTimelineRefs")},kM=function(a){a=new $APP.Q(null,3,[$APP.Dh,a.getAttribute("label"),$APP.Uj,a.getAttribute("position"),$APP.Ph,a.hasAttribute("striped")],null);var b=$APP.N(a);a=$APP.H(b,$APP.Dh);var c=$APP.H(b,$APP.Uj);b=$APP.H(b,$APP.Ph);return new $APP.Q(null,3,[$APP.W,$APP.n(a)?a:"",$APP.sk,gM(c),
|
|
4
|
+
$APP.Ph,$APP.J(b)],null)},lM=function(a){var b=kM(a);if($APP.O($APP.l(a,"__xTimelineModel"),b)){b=$APP.N(b);var c=$APP.H(b,$APP.W),d=jM(a);d=$APP.N(d);d=$APP.H(d,iM);a.setAttribute("role","list");$APP.O(c,"")?a.setAttribute("aria-label",c):a.removeAttribute("aria-label");$APP.O(c,"")?(d.textContent=c,d.removeAttribute("hidden")):(d.textContent="",d.setAttribute("hidden",""));a.__xTimelineModel=b}},mM=function(a){var b=$APP.l(a,"__xTimelineModel");b=$APP.n(b)?b:kM(a);var c=$APP.N(b);b=$APP.H(c,$APP.sk);
|
|
5
|
+
c=$APP.H(c,$APP.Ph);a=a.querySelectorAll("x-timeline-item");for(var d=a.length,e=0;;)if(e<d){var g=a[e],h=$APP.C.h(e,d-1);g.setAttribute("data-index",""+$APP.S.g(e));h?g.setAttribute("data-last",""):g.removeAttribute("data-last");g.setAttribute("data-position",hM(b,e));$APP.n(c)?g.setAttribute("data-striped",""):g.removeAttribute("data-striped");e+=1}else break},nM=function(a){function b(){$APP.n(a.isConnected)&&mM(a);return null}function c(e){e.stopPropagation();var g=e.target.getAttribute("data-index");
|
|
6
|
+
e=e.detail;typeof g==="string"?(g=parseInt(g,10),g=$APP.n(isNaN(g))?null:g):g=null;var h=$APP.l(e,"status");e=$APP.l(e,"label");e=$APP.Mg(new $APP.Q(null,3,[$APP.sh,$APP.n(g)?g:0,$APP.Xg,$APP.n(h)?h:"",$APP.W,$APP.n(e)?e:""],null));a.dispatchEvent(new CustomEvent("x-timeline-select",{detail:e,bubbles:!0,composed:!0,cancelable:!1}));return null}function d(){mM(a);return null}a.addEventListener("x-timeline-item-connected",d);a.addEventListener("x-timeline-item-click",c);document.addEventListener("x-timeline-item-disconnected",
|
|
7
|
+
b);$APP.ma(a,"__xTimelineHandlers",{"item-connected":d,"item-click":c,"item-disconnected-doc":b})},oM=function(a){var b=$APP.l(a,"__xTimelineHandlers");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)}a.__xTimelineHandlers=null},pM=function(a){Object.defineProperty(a,
|
|
8
|
+
"label",{get:function(){var b=this.getAttribute("label");return $APP.n(b)?b:""},set:function(b){return $APP.n($APP.n(b)?$APP.O(b,""):b)?this.setAttribute("label",""+$APP.S.g(b)):this.removeAttribute("label")},enumerable:!0,configurable:!0});Object.defineProperty(a,"position",{get:function(){return gM(this.getAttribute("position"))},set:function(b){return $APP.n(b)?this.setAttribute("position",""+$APP.S.g(b)):this.removeAttribute("position")},enumerable:!0,configurable:!0});Object.defineProperty(a,
|
|
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})},rM=function(){var a=class extends HTMLElement{};a.observedAttributes=qM;a.prototype.connectedCallback=function(){jM(this);lM(this);oM(this);nM(this);mM(this);return null};a.prototype.disconnectedCallback=function(){oM(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.O(c,d)&&(lM(this),
|
|
10
|
+
mM(this));return null};pM(a.prototype);return a},sM=function(){$APP.n(customElements.get("x-timeline"))||customElements.define("x-timeline",rM());return null},iM=new $APP.M(null,"label-div","label-div",1505730697);var qM=["label","position","striped"];$APP.zd(["x-timeline-select",new $APP.Q(null,2,[$APP.Y,new $APP.Q(null,3,[$APP.sh,$APP.U,$APP.Xg,$APP.X,$APP.W,$APP.X],null),$APP.Dj,!1],null)]);var fM=new $APP.R(null,new $APP.Q(null,3,["start",null,"end",null,"alternating",null],null),null);$APP.ja("baredom.exports.x_timeline.init",sM);export const init=sM;
|
package/dist/x-toast.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var zn=function(a){a=$APP.
|
|
3
|
-
a.trim(),$APP.
|
|
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:""}()])},Jn=function(a){var b=$APP.
|
|
2
|
+
var zn=function(a){a=$APP.H(yn,typeof a==="string"?a.toLowerCase():null);return $APP.n(a)?a:$APP.ji},Bn=function(a){a=$APP.H(An,a);return $APP.n(a)?a:"info"},Cn=function(a){return a==null?!0:$APP.O((""+$APP.S.g(a)).trim().toLowerCase(),"false")},Dn=function(a){return a==null?!1:$APP.O((""+$APP.S.g(a)).trim().toLowerCase(),"false")},En=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),typeof a==="number"&&$APP.q(isNaN(a))&&a>0?a:null):null},Fn=function(a){return typeof a==="string"?(a=
|
|
3
|
+
a.trim(),$APP.O(a,"")&&$APP.O(a.toLowerCase(),"none")?a:null):null},In=function(a){var b=$APP.N(a),c=$APP.H(b,$APP.bh),d=$APP.H(b,$APP.Ci);a=$APP.H(b,$APP.$i);var e=$APP.H(b,$APP.aj),g=$APP.H(b,$APP.Kh),h=$APP.H(b,$APP.ah),k=$APP.H(b,Gn),m=$APP.H(b,$APP.Nh);b=$APP.H(b,$APP.rj);m=zn(m);b=Fn(b);h=$APP.n($APP.n(h)?b==null:h)?$APP.qk:b!=null?$APP.Ni:$APP.yh;return $APP.gf([Hn,$APP.fi,$APP.Z,$APP.xh,$APP.yk,$APP.V,$APP.Pj,$APP.bh,$APP.Ci],[Dn(k),Cn(a),m,$APP.C.h(h,$APP.Ni)?b:null,h,$APP.J(e),En(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:""}()])},Jn=function(a){var b=$APP.N(a);a=$APP.H(b,$APP.fi);b=$APP.H(b,$APP.V);return $APP.n(a)?$APP.q(b):a},Kn=function(a,b){var c=$APP.N(a);a=$APP.H(c,$APP.Z);var d=$APP.H(c,$APP.Ci);c=$APP.H(c,$APP.bh);return new $APP.Q(null,4,[$APP.Z,Bn(a),$APP.hi,b,$APP.Ci,d,$APP.bh,c],null)},Ln=function(a){var b=$APP.N(a);a=$APP.H(b,Hn);b=$APP.H(b,$APP.Pj);return $APP.J($APP.n(a)?
|
|
5
5
|
b!=null&&b>0:a)},Rn=function(a){var b=$APP.l(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"),k=document.createElement("span"),m=document.createElement("div"),p=document.createElement("span"),r=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:12px;--x-toast-padding-y:14px;--x-toast-padding-x:16px;--x-toast-gap:12px;--x-toast-font-size:0.875rem;--x-toast-heading-font-size:0.9375rem;--x-toast-heading-weight:600;--x-toast-min-width:280px;--x-toast-max-width:480px;--x-toast-border-width:1px;--x-toast-shadow:0 4px 16px rgba(0,0,0,0.12),0 1px 4px rgba(0,0,0,0.08);--x-toast-motion-fast:120ms;--x-toast-motion-ease: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:rgba(0,0,0,0.6);--x-toast-dismiss-color:rgba(0,0,0,0.50);--x-toast-dismiss-hover-bg:rgba(0,0,0,0.06);--x-toast-progress-height:3px;--x-toast-progress-bg:rgba(0,0,0,0.08);--x-toast-info-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:#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:#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:#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:0 4px 20px rgba(0,0,0,0.40),0 1px 6px rgba(0,0,0,0.30);--x-toast-focus-ring:rgba(255,255,255,0.75);--x-toast-dismiss-color:rgba(255,255,255,0.65);--x-toast-dismiss-hover-bg:rgba(255,255,255,0.12);--x-toast-progress-bg:rgba(255,255,255,0.10);--x-toast-info-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:#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:#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:#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");k.setAttribute("part","default-icon");h.appendChild(k);g.appendChild(h);m.setAttribute("part","body");p.setAttribute("part","heading");r.setAttribute("part","message");m.appendChild(p);m.appendChild(r);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.
|
|
9
|
-
$APP.Ci],[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")]))},Un=function(a){var b=Sn(a);if($APP.
|
|
10
|
-
v=$APP.
|
|
11
|
-
"")?"none":"";D.textContent=e;g?(A.textContent="",v.style.display="none"):(A.textContent=h,v.style.display="inline");$APP.n(k)?(
|
|
12
|
-
"Escape"):a.removeAttribute("aria-keyshortcuts");a.__xToastModel=b}},Vn=function(){return $APP.
|
|
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.gf([Mn,$APP.kk,Nn,$APP.Eh,$APP.ak,On,$APP.Yh,$APP.xj,Pn,$APP.Wg,$APP.gj,Qn],[A,k,r,v,m,e,b,d,y,g,h,p]);a.__xToastRefs=b;return $APP.l(a,"__xToastRefs")},Sn=function(a){return In($APP.gf([$APP.$i,$APP.aj,$APP.Kh,$APP.ah,Gn,$APP.rj,$APP.Nh,$APP.bh,
|
|
9
|
+
$APP.Ci],[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")]))},Un=function(a){var b=Sn(a);if($APP.O($APP.l(a,"__xToastModel"),b)){b=$APP.N(b);var c=$APP.H(b,$APP.Z),d=$APP.H(b,$APP.Ci),e=$APP.H(b,$APP.bh),g=$APP.H(b,$APP.yk),h=$APP.H(b,$APP.xh),k=$APP.H(b,$APP.fi),m=$APP.H(b,$APP.V),p=$APP.H(b,$APP.Pj),r=Rn(a),
|
|
10
|
+
v=$APP.N(r),x=$APP.H(v,$APP.gj);r=$APP.H(v,Qn);var y=$APP.H(v,Mn),A=$APP.H(v,$APP.kk),D=$APP.H(v,Nn),G=$APP.H(v,$APP.Eh),I=$APP.H(v,$APP.xj),F=$APP.H(v,Pn);v=$APP.H(v,$APP.Wg);x=$APP.n(x)?x.assignedNodes().length>0:null;$APP.C.h(g,$APP.Ni)||(h=$APP.H(Tn,c),h=$APP.n(h)?h:$APP.H(Tn,$APP.ji));g=$APP.q(x)&&$APP.C.h(g,$APP.qk);x=Ln(b);a.setAttribute("data-type",Bn(c));var P=I.setAttribute;c=$APP.C.h(c,$APP.Bj)||$APP.C.h(c,$APP.Vh)?"alert":"status";P.call(I,"role",c);r.textContent=d;r.style.display=$APP.C.h(d,
|
|
11
|
+
"")?"none":"";D.textContent=e;g?(A.textContent="",v.style.display="none"):(A.textContent=h,v.style.display="inline");$APP.n(k)?(G.disabled=$APP.J(m),G.style.display="inline-flex"):(G.disabled=!0,G.style.display="none");x?(F.style.display="block",y.style.setProperty("--x-toast-timeout",""+$APP.S.g(p)+"ms")):F.style.display="none";d=$APP.n(k)?$APP.q(m):k;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}},Vn=function(){return $APP.J(window.matchMedia("(prefers-reduced-motion:reduce)").matches)},Wn=function(a){a=typeof a==="string"?a.trim():"";return $APP.C.h(a,"")||$APP.C.h(a,"0")||$APP.C.h(a,"0ms")||$APP.C.h(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
13
|
a))):0},Xn=function(a){var b=window.getComputedStyle(a);a=Wn(b.getPropertyValue("--x-toast-exit-duration"));b=Wn(b.getPropertyValue("--x-motion-exit-duration"));return a>0?a:b>0?b:180},Yn=function(a){var b=$APP.l(a,"__xToastTimeout");$APP.n(b)&&(clearTimeout(b),a.__xToastTimeout=null)},$n=function(a){Yn(a);var b=function(){var c=$APP.l(a,"__xToastModel");return $APP.n(c)?c:Sn(a)}();$APP.n(function(){var c=Jn(b);return $APP.n(c)?typeof $APP.Pj.g(b)==="number"&&$APP.q($APP.l(a,"__xToastExiting")):c}())&&
|
|
14
|
-
$APP.
|
|
15
|
-
$APP.l(a,"__xToastModel");$APP.n($APP.n(b)?Ln(b):b)&&a.setAttribute("data-progress-active","");return $n(a)},bo=function(a){if(!$APP.n($APP.l(a,"__xToastEntered")))if(a.__xToastEntered=!0,a.setAttribute("data-entering",""),Vn())a.removeAttribute("data-entering"),ao(a);else{var b=Rn(a);b=$APP.
|
|
16
|
-
"__xToastExiting"))){a.__xToastExiting=!0;Yn(a);a.removeAttribute("data-entering");a.removeAttribute("data-progress-active");var b=Xn(a);if(b===0||Vn())a.remove();else{var c=Rn(a);c=$APP.
|
|
17
|
-
$APP.
|
|
14
|
+
$APP.ma(a,"__xToastTimeout",setTimeout(function(){a.__xToastTimeout=null;if($APP.n(function(){var d=a.isConnected;return $APP.n(d)?$APP.q($APP.l(a,"__xToastExiting")):d}())){var c=function(){var d=$APP.l(a,"__xToastModel");return $APP.n(d)?d:Sn(a)}();if($APP.n(Jn(c)))return c=$APP.Mg(Kn(c,"timeout")),c=new CustomEvent("x-toast-dismiss",{detail:c,bubbles:!0,composed:!0,cancelable:!0}),c=a.dispatchEvent(c),$APP.n(c)?Zn.g?Zn.g(a):Zn.call(null,a):null}return null},$APP.Pj.g(b)));return null},ao=function(a){var b=
|
|
15
|
+
$APP.l(a,"__xToastModel");$APP.n($APP.n(b)?Ln(b):b)&&a.setAttribute("data-progress-active","");return $n(a)},bo=function(a){if(!$APP.n($APP.l(a,"__xToastEntered")))if(a.__xToastEntered=!0,a.setAttribute("data-entering",""),Vn())a.removeAttribute("data-entering"),ao(a);else{var b=Rn(a);b=$APP.N(b);var c=$APP.H(b,$APP.xj);c.addEventListener("animationend",function g(e){return $APP.C.h(e.target,c)?(c.removeEventListener("animationend",g),a.removeAttribute("data-entering"),ao(a)):null})}},Zn=function(a){if(!$APP.n($APP.l(a,
|
|
16
|
+
"__xToastExiting"))){a.__xToastExiting=!0;Yn(a);a.removeAttribute("data-entering");a.removeAttribute("data-progress-active");var b=Xn(a);if(b===0||Vn())a.remove();else{var c=Rn(a);c=$APP.N(c);var d=$APP.H(c,$APP.xj),e=function k(h){return $APP.C.h(h.target,d)?(d.removeEventListener("animationend",k),h=$APP.l(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.ma(a,"__xToastExitTimer",setTimeout(function(){var h=a.isConnected;return $APP.n($APP.n(h)?$APP.l(a,"__xToastExiting"):h)?(d.removeEventListener("animationend",e),a.__xToastExitTimer=null,a.remove()):null},b+60))}}return null},co=function(a,b){var c=$APP.l(a,"__xToastModel");c=$APP.n(c)?c:Sn(a);b=$APP.Mg(Kn(c,b));b=new CustomEvent("x-toast-dismiss",{detail:b,bubbles:!0,composed:!0,cancelable:!0});b=a.dispatchEvent(b);$APP.n(b)&&Zn(a)},eo=function(a,b){var c=function(){var d=$APP.l(a,"__xToastModel");
|
|
18
18
|
return $APP.n(d)?d:Sn(a)}();$APP.n(function(){var d=Jn(c);return $APP.n(d)?$APP.q($APP.l(a,"__xToastExiting")):d}())&&(b.preventDefault(),co(a,"button"));return null},fo=function(a,b){if($APP.C.h(b.key,"Escape")){var c=function(){var d=$APP.l(a,"__xToastModel");return $APP.n(d)?d:Sn(a)}();$APP.n(function(){var d=Jn(c);return $APP.n(d)?$APP.q($APP.l(a,"__xToastExiting")):d}())&&(b.preventDefault(),co(a,"keyboard"))}return null},go=function(a){function b(e){return fo(a,e)}function c(e){return eo(a,
|
|
19
|
-
e)}var d=Rn(a);d=$APP.
|
|
20
|
-
b)}a.__xToastHandlers=null},io=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.
|
|
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.
|
|
19
|
+
e)}var d=Rn(a);d=$APP.N(d);$APP.H(d,$APP.Eh).addEventListener("click",c);a.addEventListener("keydown",b);$APP.ma(a,"__xToastHandlers",{click:c,keydown:b})},ho=function(a){Yn(a);var b=$APP.l(a,"__xToastExitTimer");$APP.n(b)&&(clearTimeout(b),a.__xToastExitTimer=null);b=$APP.l(a,"__xToastHandlers");var c=$APP.l(a,"__xToastRefs");if($APP.n($APP.n(b)?c:b)){c=$APP.Eh.g(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",
|
|
20
|
+
b)}a.__xToastHandlers=null},io=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.S.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.S.g(b)):this.removeAttribute("heading")},
|
|
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.S.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.S.g(b)):this.removeAttribute("icon")},enumerable:!0,configurable:!0});Object.defineProperty(a,
|
|
22
22
|
"dismissible",{get:function(){return Cn(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 En(this.getAttribute("timeout-ms"))},
|
|
23
|
-
set:function(b){return b==null?this.removeAttribute("timeout-ms"):this.setAttribute("timeout-ms",""+$APP.
|
|
24
|
-
c)&&co(this,typeof b==="string"?b:"api");return null}},lo=function(){var a=class extends HTMLElement{};a.observedAttributes=ko;a.prototype.connectedCallback=function(){Rn(this);ho(this);go(this);Un(this);bo(this);return null};a.prototype.disconnectedCallback=function(){ho(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.
|
|
25
|
-
customElements.define("x-toast",lo());return null},Qn=new $APP.
|
|
26
|
-
var yn=new $APP.Q(null,4,["info",$APP.
|
|
23
|
+
set:function(b){return b==null?this.removeAttribute("timeout-ms"):this.setAttribute("timeout-ms",""+$APP.S.g(b|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"showProgress",{get:function(){return Dn(this.getAttribute("show-progress"))},set:function(b){return $APP.n(b)?this.setAttribute("show-progress",""):this.removeAttribute("show-progress")},enumerable:!0,configurable:!0})},jo=function(a){a.dismiss=function(b){var c=$APP.q($APP.l(this,"__xToastExiting"));$APP.n(c?this.isConnected:
|
|
24
|
+
c)&&co(this,typeof b==="string"?b:"api");return null}},lo=function(){var a=class extends HTMLElement{};a.observedAttributes=ko;a.prototype.connectedCallback=function(){Rn(this);ho(this);go(this);Un(this);bo(this);return null};a.prototype.disconnectedCallback=function(){ho(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.O(c,d)&&(Un(this),$APP.n(this.isConnected)&&$n(this));return null};io(a.prototype);jo(a.prototype);return a},mo=function(){$APP.n(customElements.get("x-toast"))||
|
|
25
|
+
customElements.define("x-toast",lo());return null},Qn=new $APP.M(null,"heading-el","heading-el",-1277272161),On=new $APP.M(null,"inner","inner",-1383171215),Pn=new $APP.M(null,"progress-el","progress-el",-184081515),Nn=new $APP.M(null,"message-el","message-el",-683533234),Hn=new $APP.M(null,"show-progress?","show-progress?",-1681518912),Mn=new $APP.M(null,"progress-bar","progress-bar",-123877022),Gn=new $APP.M(null,"show-progress-attr","show-progress-attr",1680262066);var ko="type heading message icon dismissible disabled timeout-ms show-progress".split(" ");$APP.zd(["x-toast-dismiss",new $APP.Q(null,2,[$APP.Y,new $APP.Q(null,4,[$APP.Z,$APP.X,$APP.hi,$APP.X,$APP.Ci,$APP.X,$APP.bh,$APP.X],null),$APP.Dj,!0],null)]);
|
|
26
|
+
var yn=new $APP.Q(null,4,["info",$APP.ji,"success",$APP.kh,"warning",$APP.Bj,"error",$APP.Vh],null),An=new $APP.Q(null,4,[$APP.ji,"info",$APP.kh,"success",$APP.Bj,"warning",$APP.Vh,"error"],null),Tn=new $APP.Q(null,4,[$APP.ji,"ℹ",$APP.kh,"✓",$APP.Bj,"!",$APP.Vh,"⨯"],null);$APP.ja("baredom.exports.x_toast.init",mo);export const init=mo;
|
package/dist/x-toaster.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var mq=function(a){a=typeof a==="string"?a.trim().toLowerCase():null;return $APP.
|
|
3
|
-
new $APP.Q(null,3,[$APP.Uj,a.getAttribute("position"),qq,a.getAttribute("max-toasts"),$APP.
|
|
4
|
-
a.setAttribute("aria-label",d);a.setAttribute("data-position",c);a.__xToasterModel=b}},uq=function(a){function b(c){var d=c.detail;if($APP.
|
|
5
|
-
e=a.dispatchEvent(e);$APP.n(e)&&c.target.dismiss("toaster-remove")}return null}a.addEventListener("x-toast-dismiss",b);$APP.
|
|
6
|
-
""+$APP.
|
|
7
|
-
null?this.removeAttribute("max-toasts"):this.setAttribute("max-toasts",""+$APP.
|
|
8
|
-
"heading");$APP.n(d)&&c.setAttribute("heading",d);d=$APP.l(b,"message");$APP.n(d)&&c.setAttribute("message",d);d=$APP.l(b,"icon");$APP.n(d)&&c.setAttribute("icon",d);$APP.l(b,"dismissible")===!1&&c.setAttribute("dismissible","false");d=$APP.l(b,"timeoutMs");$APP.n(d)&&c.setAttribute("timeout-ms",""+$APP.
|
|
9
|
-
xq;a.prototype.connectedCallback=function(){pq(this);vq(this);uq(this);tq(this);return null};a.prototype.disconnectedCallback=function(){vq(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.
|
|
2
|
+
var mq=function(a){a=typeof a==="string"?a.trim().toLowerCase():null;return $APP.K(lq,a)?a:"top-end"},nq=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),$APP.q(isNaN(a))&&a>0?Math.floor(a):null):null},pq=function(a){if(!$APP.n($APP.l(a,"__xToasterRefs"))){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("slot");c.textContent=oq;b.appendChild(c);b.appendChild(d);a.__xToasterRefs=new $APP.Q(null,2,[$APP.Yh,b,$APP.Pi,d],null)}},sq=function(a){a=
|
|
3
|
+
new $APP.Q(null,3,[$APP.Uj,a.getAttribute("position"),qq,a.getAttribute("max-toasts"),$APP.Dh,a.getAttribute("label")],null);var b=$APP.N(a),c=$APP.H(b,$APP.Uj);a=$APP.H(b,qq);b=$APP.H(b,$APP.Dh);c=mq(c);a=nq(a);return new $APP.Q(null,3,[$APP.sk,c,rq,$APP.n(a)?a:5,$APP.W,typeof b==="string"&&$APP.O(b.trim(),"")?b:"Notifications"],null)},tq=function(a){var b=sq(a);if($APP.O($APP.l(a,"__xToasterModel"),b)){b=$APP.N(b);var c=$APP.H(b,$APP.sk),d=$APP.H(b,$APP.W);pq(a);a.setAttribute("role","region");
|
|
4
|
+
a.setAttribute("aria-label",d);a.setAttribute("data-position",c);a.__xToasterModel=b}},uq=function(a){function b(c){var d=c.detail;if($APP.O($APP.l(d,"reason"),"toaster-remove")){c.preventDefault();var e=$APP.l(d,"type");var g=$APP.l(d,"reason"),h=$APP.l(d,"heading");d=$APP.l(d,"message");e=$APP.Mg(new $APP.Q(null,4,[$APP.Z,$APP.n(e)?e:"info",$APP.hi,$APP.n(g)?g:"",$APP.Ci,$APP.n(h)?h:"",$APP.bh,$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.ma(a,"__xToasterHandlers",{dismiss:b})},vq=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));a.__xToasterHandlers=null},wq=function(a){a=a.prototype;Object.defineProperty(a,"position",{get:function(){return mq(this.getAttribute("position"))},set:function(b){return $APP.n(b)?this.setAttribute("position",
|
|
6
|
+
""+$APP.S.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.O(b,""):b)?this.setAttribute("label",""+$APP.S.g(b)):this.removeAttribute("label")},enumerable:!0,configurable:!0});Object.defineProperty(a,"maxToasts",{get:function(){var b=nq(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.S.g(Math.floor(b)))},enumerable:!0,configurable:!0});Object.defineProperty(a,"toast",{value:function(b){b=$APP.n(b)?b:{};var c=$APP.l(this,"__xToasterModel");c=$APP.n(c)?c:sq(this);var d=rq.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.l(b,"type");$APP.n(d)&&c.setAttribute("type",d);d=$APP.l(b,
|
|
8
|
+
"heading");$APP.n(d)&&c.setAttribute("heading",d);d=$APP.l(b,"message");$APP.n(d)&&c.setAttribute("message",d);d=$APP.l(b,"icon");$APP.n(d)&&c.setAttribute("icon",d);$APP.l(b,"dismissible")===!1&&c.setAttribute("dismissible","false");d=$APP.l(b,"timeoutMs");$APP.n(d)&&c.setAttribute("timeout-ms",""+$APP.S.g(d));$APP.n($APP.l(b,"showProgress"))&&c.setAttribute("show-progress","");this.appendChild(c);return c},writable:!0,configurable:!0})},yq=function(){var a=class extends HTMLElement{};a.observedAttributes=
|
|
9
|
+
xq;a.prototype.connectedCallback=function(){pq(this);vq(this);uq(this);tq(this);return null};a.prototype.disconnectedCallback=function(){vq(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.O(c,d)&&tq(this);return null};wq(a);return a},zq=function(){$APP.n(customElements.get("x-toaster"))||customElements.define("x-toaster",yq());return null},rq=new $APP.M(null,"max-toasts","max-toasts",-1982289139),qq=new $APP.M(null,"max-toasts-raw","max-toasts-raw",-815087069);var xq=["position","max-toasts","label"];$APP.zd(["x-toaster-dismiss",new $APP.Q(null,2,[$APP.Y,new $APP.Q(null,4,[$APP.Z,$APP.X,$APP.hi,$APP.X,$APP.Ci,$APP.X,$APP.bh,$APP.X],null),$APP.Dj,!0],null)]);var lq=new $APP.R(null,new $APP.Q(null,6,["top-center",null,"bottom-start",null,"bottom-end",null,"bottom-center",null,"top-end",null,"top-start",null],null),null);var oq=":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,480px);box-sizing:border-box;pointer-events:none;color-scheme:light dark;}::slotted("+$APP.S.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.ja("baredom.exports.x_toaster.init",zq);export const init=zq;
|
package/dist/x-typography.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
return $APP.l(a,"__xTypographyRefs")},
|
|
4
|
-
null);if($APP.
|
|
5
|
-
(c=h.style,c.removeProperty("display"),c.removeProperty("-webkit-box-orient"),c.removeProperty("overflow"),c.removeProperty("-webkit-line-clamp"));a.__xTypographyModel=b}},
|
|
6
|
-
return $APP.n(b)?b:"left"},set:function(b){return $APP.n(b)?this.setAttribute("align",""+$APP.
|
|
7
|
-
null?this.removeAttribute("line-clamp"):this.setAttribute("line-clamp",""+$APP.
|
|
8
|
-
|
|
9
|
-
$APP.
|
|
10
|
-
$APP.
|
|
11
|
-
$APP.
|
|
2
|
+
var $w=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),typeof a==="number"&&$APP.q(isNaN(a))&&a>0?a:null):null},bx=function(a){var b=$APP.l(a,"__xTypographyRefs");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=ax;d.setAttribute("part","container");d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__xTypographyRefs=new $APP.Q(null,2,[$APP.Yh,b,$APP.xj,d],null);
|
|
3
|
+
return $APP.l(a,"__xTypographyRefs")},hx=function(a){var b=new $APP.Q(null,4,[$APP.ri,a.getAttribute("variant"),$APP.qi,a.getAttribute("align"),cx,a.getAttribute("truncate"),dx,a.getAttribute("line-clamp")],null);var c=$APP.N(b),d=$APP.H(c,$APP.ri),e=$APP.H(c,$APP.qi);b=$APP.H(c,cx);c=$APP.H(c,dx);d=typeof d==="string"?d.toLowerCase():null;d=$APP.K(ex,d)?d:"body1";e=typeof e==="string"?e.toLowerCase():null;e=$APP.K(fx,e)?e:"left";b=new $APP.Q(null,4,[$APP.th,d,$APP.hj,e,$APP.di,b!=null,gx,$w(c)],
|
|
4
|
+
null);if($APP.O($APP.l(a,"__xTypographyModel"),b)){b=$APP.N(b);e=$APP.H(b,$APP.th);d=$APP.H(b,$APP.hj);var g=$APP.H(b,$APP.di);c=$APP.H(b,gx);var h=bx(a);h=$APP.N(h);h=$APP.H(h,$APP.xj);a.setAttribute("data-variant",e);a.setAttribute("data-align",d);$APP.n(g)?h.setAttribute("data-truncate",""):h.removeAttribute("data-truncate");c!=null&&$APP.q(g)?(e=h.style,e.display="-webkit-box",e.setProperty("-webkit-box-orient","vertical"),e.overflow="hidden",e.setProperty("-webkit-line-clamp",""+$APP.S.g(c))):
|
|
5
|
+
(c=h.style,c.removeProperty("display"),c.removeProperty("-webkit-box-orient"),c.removeProperty("overflow"),c.removeProperty("-webkit-line-clamp"));a.__xTypographyModel=b}},ix=function(a){Object.defineProperty(a,"variant",{get:function(){var b=this.getAttribute("variant");return $APP.n(b)?b:"body1"},set:function(b){return $APP.n(b)?this.setAttribute("variant",""+$APP.S.g(b)):this.removeAttribute("variant")},enumerable:!0,configurable:!0});Object.defineProperty(a,"align",{get:function(){var b=this.getAttribute("align");
|
|
6
|
+
return $APP.n(b)?b:"left"},set:function(b){return $APP.n(b)?this.setAttribute("align",""+$APP.S.g(b)):this.removeAttribute("align")},enumerable:!0,configurable:!0});Object.defineProperty(a,"truncate",{get:function(){return this.hasAttribute("truncate")},set:function(b){return $APP.n(b)?this.setAttribute("truncate",""):this.removeAttribute("truncate")},enumerable:!0,configurable:!0});Object.defineProperty(a,"lineClamp",{get:function(){return $w(this.getAttribute("line-clamp"))},set:function(b){return b==
|
|
7
|
+
null?this.removeAttribute("line-clamp"):this.setAttribute("line-clamp",""+$APP.S.g(b|0))},enumerable:!0,configurable:!0})},kx=function(){var a=class extends HTMLElement{};a.observedAttributes=jx;a.prototype.connectedCallback=function(){bx(this);hx(this);return null};a.prototype.disconnectedCallback=function(){return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.O(c,d)&&hx(this);return null};ix(a.prototype);return a},lx=function(){$APP.n(customElements.get("x-typography"))||customElements.define("x-typography",
|
|
8
|
+
kx());return null},dx=new $APP.M(null,"line-clamp-raw","line-clamp-raw",-1982923204),gx=new $APP.M(null,"line-clamp","line-clamp",-1079334403),cx=new $APP.M(null,"truncate-raw","truncate-raw",1178232402);var jx=["variant","align","truncate","line-clamp"],ex=new $APP.R(null,new $APP.Q(null,16,["subtitle2",null,"overline",null,"h3",null,"body1",null,"body2",null,"small",null,"subtitle1",null,"h2",null,"kbd",null,"h4",null,"h5",null,"blockquote",null,"h1",null,"caption",null,"code",null,"h6",null],null),null),fx=new $APP.R(null,new $APP.Q(null,4,["right",null,"justify",null,"center",null,"left",null],null),null);var ax=":host{display:block;color-scheme:light dark;font-family:var(--x-typography-font-family,"+$APP.S.g("system-ui,-apple-system,sans-serif")+");color:var(--x-typography-color,inherit);}[part\x3dcontainer]{margin:0;padding:0;}:host(:not([data-variant])),:host([data-variant\x3d'body1']){font-size:1rem;font-weight:400;line-height:1.5;letter-spacing:normal;}:host([data-variant\x3d'h1']){font-size:2.5rem;font-weight:700;line-height:1.2;letter-spacing:-0.02em;}:host([data-variant\x3d'h2']){font-size:2rem;font-weight:700;line-height:1.25;letter-spacing:-0.015em;}:host([data-variant\x3d'h3']){font-size:1.75rem;font-weight:600;line-height:1.3;letter-spacing:-0.01em;}:host([data-variant\x3d'h4']){font-size:1.5rem;font-weight:600;line-height:1.35;letter-spacing:-0.005em;}:host([data-variant\x3d'h5']){font-size:1.25rem;font-weight:600;line-height:1.4;letter-spacing:normal;}:host([data-variant\x3d'h6']){font-size:1.125rem;font-weight:600;line-height:1.4;letter-spacing:normal;}:host([data-variant\x3d'subtitle1']){font-size:1.125rem;font-weight:500;line-height:1.4;letter-spacing:0.005em;}:host([data-variant\x3d'subtitle2']){font-size:0.875rem;font-weight:500;line-height:1.4;letter-spacing:0.01em;}:host([data-variant\x3d'body2']){font-size:0.875rem;font-weight:400;line-height:1.5;letter-spacing:normal;}:host([data-variant\x3d'caption']){font-size:0.75rem;font-weight:400;line-height:1.4;letter-spacing:0.02em;}:host([data-variant\x3d'overline']){font-size:0.625rem;font-weight:600;line-height:1.5;letter-spacing:0.1em;text-transform:uppercase;}:host([data-variant\x3d'small']){font-size:0.8125rem;font-weight:400;line-height:1.4;letter-spacing:normal;}:host([data-variant\x3d'blockquote']){font-size:1.125rem;font-weight:400;line-height:1.6;letter-spacing:normal;font-style:italic;}:host([data-variant\x3d'blockquote']) [part\x3dcontainer]{border-left:3px solid var(--x-typography-blockquote-border-color,"+
|
|
9
|
+
$APP.S.g("rgba(0,0,0,0.2)")+");padding:var(--x-typography-blockquote-padding,0 0 0 1em);}@media (prefers-color-scheme:dark){:host([data-variant\x3d'blockquote']) [part\x3dcontainer]{border-left-color:var(--x-typography-blockquote-border-color,"+$APP.S.g("rgba(255,255,255,0.25)")+");}}:host([data-variant\x3d'code']){font-family:var(--x-typography-mono-font-family,"+$APP.S.g('ui-monospace,"SFMono-Regular","SF Mono",Menlo,Consolas,monospace')+");font-size:0.875rem;font-weight:400;line-height:1.5;}:host([data-variant\x3d'code']) [part\x3dcontainer]{background:var(--x-typography-code-bg,"+
|
|
10
|
+
$APP.S.g("rgba(0,0,0,0.06)")+");border-radius:var(--x-typography-code-radius,4px);padding:var(--x-typography-code-padding,0.15em 0.35em);}@media (prefers-color-scheme:dark){:host([data-variant\x3d'code']) [part\x3dcontainer]{background:var(--x-typography-code-bg,"+$APP.S.g("rgba(255,255,255,0.1)")+");}}:host([data-variant\x3d'kbd']){font-family:var(--x-typography-mono-font-family,"+$APP.S.g('ui-monospace,"SFMono-Regular","SF Mono",Menlo,Consolas,monospace')+");font-size:0.875rem;font-weight:400;line-height:1.5;}:host([data-variant\x3d'kbd']) [part\x3dcontainer]{background:var(--x-typography-kbd-bg,"+
|
|
11
|
+
$APP.S.g("rgba(0,0,0,0.06)")+");border:1px solid var(--x-typography-kbd-border,"+$APP.S.g("rgba(0,0,0,0.15)")+");border-radius:var(--x-typography-kbd-radius,4px);padding:var(--x-typography-kbd-padding,0.15em 0.4em);}@media (prefers-color-scheme:dark){:host([data-variant\x3d'kbd']) [part\x3dcontainer]{background:var(--x-typography-kbd-bg,"+$APP.S.g("rgba(255,255,255,0.1)")+");border-color:var(--x-typography-kbd-border,"+$APP.S.g("rgba(255,255,255,0.2)")+");}}:host([data-align\x3d'left']){text-align:left;}:host([data-align\x3d'center']){text-align:center;}:host([data-align\x3d'right']){text-align:right;}:host([data-align\x3d'justify']){text-align:justify;}[part\x3dcontainer][data-truncate]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}";$APP.ja("baredom.exports.x_typography.init",lx);export const init=lx;
|