@vanelsas/baredom 0.1.2-alpha
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 +30 -0
- package/LICENSE +21 -0
- package/README.md +444 -0
- package/dist/base.js +352 -0
- package/dist/x-alert.js +20 -0
- package/dist/x-avatar-group.js +12 -0
- package/dist/x-avatar.js +18 -0
- package/dist/x-badge.js +12 -0
- package/dist/x-breadcrumbs.js +15 -0
- package/dist/x-button.js +17 -0
- package/dist/x-cancel-dialogue.js +20 -0
- package/dist/x-card.js +8 -0
- package/dist/x-chart.js +45 -0
- package/dist/x-checkbox.js +12 -0
- package/dist/x-chip.js +10 -0
- package/dist/x-collapse.js +13 -0
- package/dist/x-command-palette.js +33 -0
- package/dist/x-container.js +7 -0
- package/dist/x-context-menu.js +20 -0
- package/dist/x-copy.js +26 -0
- package/dist/x-currency-field.js +22 -0
- package/dist/x-date-picker.js +37 -0
- package/dist/x-divider.js +11 -0
- package/dist/x-drawer.js +13 -0
- package/dist/x-dropdown.js +12 -0
- package/dist/x-fieldset.js +7 -0
- package/dist/x-file-download.js +9 -0
- package/dist/x-form-field.js +16 -0
- package/dist/x-form.js +11 -0
- package/dist/x-grid.js +8 -0
- package/dist/x-menu-item.js +11 -0
- package/dist/x-menu.js +13 -0
- package/dist/x-modal.js +14 -0
- package/dist/x-navbar.js +13 -0
- package/dist/x-notification-center.js +10 -0
- package/dist/x-pagination.js +17 -0
- package/dist/x-popover.js +13 -0
- package/dist/x-progress-circle.js +12 -0
- package/dist/x-progress.js +11 -0
- package/dist/x-radio.js +13 -0
- package/dist/x-search-field.js +17 -0
- package/dist/x-select.js +12 -0
- package/dist/x-sidebar.js +27 -0
- package/dist/x-skeleton.js +8 -0
- package/dist/x-slider.js +17 -0
- package/dist/x-spacer.js +6 -0
- package/dist/x-spinner.js +7 -0
- package/dist/x-stat.js +10 -0
- package/dist/x-stepper.js +17 -0
- package/dist/x-switch.js +12 -0
- package/dist/x-tab.js +9 -0
- package/dist/x-table-cell.js +26 -0
- package/dist/x-table-row.js +11 -0
- package/dist/x-table.js +16 -0
- package/dist/x-tabs.js +12 -0
- package/dist/x-text-area.js +20 -0
- package/dist/x-timeline-item.js +25 -0
- package/dist/x-timeline.js +10 -0
- package/dist/x-toast.js +26 -0
- package/dist/x-toaster.js +9 -0
- package/package.json +275 -0
package/dist/x-alert.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var cq=function(a){a=$APP.I($APP.hj,a);return $APP.n(a)?a:"info"},dq=function(a){return a==null?!0:$APP.N((""+$APP.S.g(a)).trim().toLowerCase(),"false")},eq=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),typeof a==="number"&&$APP.p(isNaN(a))&&a>0?a:null):null},fq=function(a){var b=$APP.M(a);a=$APP.I(b,$APP.vh);b=$APP.I(b,$APP.U);return $APP.n(a)?$APP.p(b):a},gq=function(a,b){var c=$APP.M(a);a=$APP.I(c,$APP.Z);c=$APP.I(c,$APP.Mh);return new $APP.P(null,3,[$APP.Z,cq(a),$APP.xh,b,$APP.Mh,
|
|
3
|
+
c],null)},iq=function(a){var b=$APP.l(a,"__xAlertRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("span"),f=document.createElement("slot"),h=document.createElement("span"),k=document.createElement("span"),m=document.createElement("button"),q=document.createElement("span");c.textContent=":host{display:block;color-scheme:light dark;--x-alert-radius:10px;--x-alert-padding-y:10px;--x-alert-padding-x:12px;--x-alert-gap:10px;--x-alert-font-size:0.875rem;--x-alert-motion-fast:120ms;--x-alert-motion-ease:cubic-bezier(0.2,0,0,1);--x-alert-enter-duration:140ms;--x-alert-exit-duration:160ms;--x-alert-press-scale:0.98;--x-alert-disabled-opacity:0.55;--x-alert-focus-ring:rgba(0,0,0,0.6);--x-alert-dismiss-color:rgba(0,0,0,0.62);--x-alert-dismiss-hover-bg:rgba(0,0,0,0.06);--x-alert-info-bg:rgba(0,102,204,0.08);--x-alert-info-border:rgba(0,102,204,0.35);--x-alert-info-color:rgba(0,60,120,0.95);--x-alert-success-bg:rgba(16,140,72,0.10);--x-alert-success-border:rgba(16,140,72,0.35);--x-alert-success-color:rgba(10,90,46,0.95);--x-alert-warning-bg:rgba(204,120,0,0.12);--x-alert-warning-border:rgba(204,120,0,0.45);--x-alert-warning-color:rgba(120,70,0,0.95);--x-alert-error-bg:rgba(190,20,40,0.10);--x-alert-error-border:rgba(190,20,40,0.45);--x-alert-error-color:rgba(120,10,20,0.95);--x-alert-bg:transparent;--x-alert-border-color:transparent;--x-alert-color:inherit;}@media (prefers-color-scheme:dark){:host{--x-alert-focus-ring:rgba(255,255,255,0.75);--x-alert-dismiss-color:rgba(255,255,255,0.75);--x-alert-dismiss-hover-bg:rgba(255,255,255,0.14);--x-alert-info-bg:rgba(80,160,255,0.18);--x-alert-info-border:rgba(80,160,255,0.42);--x-alert-info-color:rgba(230,245,255,0.92);--x-alert-success-bg:rgba(60,210,120,0.18);--x-alert-success-border:rgba(60,210,120,0.42);--x-alert-success-color:rgba(235,255,245,0.92);--x-alert-warning-bg:rgba(255,190,90,0.20);--x-alert-warning-border:rgba(255,190,90,0.46);--x-alert-warning-color:rgba(255,248,235,0.92);--x-alert-error-bg:rgba(255,90,110,0.18);--x-alert-error-border:rgba(255,90,110,0.46);--x-alert-error-color:rgba(255,235,238,0.92);}}:host([data-type\x3d'info']){--x-alert-bg:var(--x-alert-info-bg);--x-alert-border-color:var(--x-alert-info-border);--x-alert-color:var(--x-alert-info-color);}:host([data-type\x3d'success']){--x-alert-bg:var(--x-alert-success-bg);--x-alert-border-color:var(--x-alert-success-border);--x-alert-color:var(--x-alert-success-color);}:host([data-type\x3d'warning']){--x-alert-bg:var(--x-alert-warning-bg);--x-alert-border-color:var(--x-alert-warning-border);--x-alert-color:var(--x-alert-warning-color);}:host([data-type\x3d'error']){--x-alert-bg:var(--x-alert-error-bg);--x-alert-border-color:var(--x-alert-error-border);--x-alert-color:var(--x-alert-error-color);}[part\x3dcontainer]{display:flex;align-items:flex-start;gap:var(--x-alert-gap);padding:var(--x-alert-padding-y) var(--x-alert-padding-x);border:1px solid var(--x-alert-border-color);border-radius:var(--x-alert-radius);background:var(--x-alert-bg);color:var(--x-alert-color);font-size:var(--x-alert-font-size);transition:background var(--x-alert-motion-fast) var(--x-alert-motion-ease),border-color var(--x-alert-motion-fast) var(--x-alert-motion-ease),color var(--x-alert-motion-fast) var(--x-alert-motion-ease),opacity var(--x-alert-motion-fast) var(--x-alert-motion-ease),transform var(--x-alert-motion-fast) var(--x-alert-motion-ease);}[part\x3dicon]{flex:0 0 auto;line-height:1;margin-top:0.05em;}slot[name\x3dicon]::slotted(*){display:block;}[part\x3dtext]{flex:1 1 auto;line-height:1.25;min-width:0;overflow-wrap:anywhere;}[part\x3ddismiss]{flex:0 0 auto;appearance:none;border:0;background:transparent;color:var(--x-alert-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-alert-motion-fast) var(--x-alert-motion-ease),transform var(--x-alert-motion-fast) var(--x-alert-motion-ease);}:host(:not([disabled])) [part\x3ddismiss]:hover{background:var(--x-alert-dismiss-hover-bg);}:host(:not([disabled])) [part\x3ddismiss]:active{transform:scale(var(--x-alert-press-scale));}[part\x3ddismiss]:focus{outline:none;}:host(:not([disabled])) [part\x3ddismiss]:focus-visible{outline:2px solid var(--x-alert-focus-ring);outline-offset:2px;}:host([disabled]){opacity:var(--x-alert-disabled-opacity);}:host([disabled]) [part\x3ddismiss]{cursor:default;pointer-events:none;}:host([data-entering]) [part\x3dcontainer]{animation:x-alert-enter var(--x-alert-enter-duration) var(--x-alert-motion-ease) both;}@keyframes x-alert-enter{from{opacity:0;transform:translateY(4px);}to{opacity:1;transform:translateY(0);}}:host([data-exiting]) [part\x3dcontainer]{animation:x-alert-exit var(--x-alert-exit-duration) var(--x-alert-motion-ease) forwards;}@keyframes x-alert-exit{from{opacity:1;transform:translateY(0);}to{opacity:0;transform:translateY(4px);}}@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;}}";
|
|
4
|
+
d.setAttribute("part","container");e.setAttribute("part","icon");e.setAttribute("aria-hidden","true");f.setAttribute("name","icon");h.setAttribute("part","default-icon");f.appendChild(h);e.appendChild(f);k.setAttribute("part","text");m.setAttribute("part","dismiss");m.setAttribute("type","button");q.setAttribute("aria-hidden","true");q.textContent="×";m.appendChild(q);d.appendChild(e);d.appendChild(k);d.appendChild(m);b.appendChild(c);b.appendChild(d);a.__xAlertRefs=new $APP.P(null,7,[$APP.sh,b,$APP.ri,
|
|
5
|
+
d,$APP.Fg,e,$APP.di,f,$APP.Ui,h,hq,k,$APP.eh,m],null);return $APP.l(a,"__xAlertRefs")},jq=function(a){a=new $APP.P(null,7,[$APP.jh,a.getAttribute("type"),$APP.Mh,a.getAttribute("text"),$APP.Kg,a.hasAttribute("icon"),$APP.ni,a.getAttribute("icon"),$APP.Zh,a.getAttribute("dismissible"),$APP.$h,a.hasAttribute("disabled"),$APP.hh,a.getAttribute("timeout-ms")],null);var b=$APP.M(a),c=$APP.I(b,$APP.jh);a=$APP.I(b,$APP.Mh);var d=$APP.I(b,$APP.Kg),e=$APP.I(b,$APP.ni),f=$APP.I(b,$APP.Zh),h=$APP.I(b,$APP.$h);
|
|
6
|
+
b=$APP.I(b,$APP.hh);c=$APP.I($APP.gj,typeof c==="string"?c.toLowerCase():null);c=$APP.n(c)?c:$APP.yh;typeof e==="string"?(e=e.trim(),e=$APP.N(e,"")&&$APP.N(e.toLowerCase(),"none")?e:null):e=null;d=$APP.n($APP.n(d)?e==null:d)?$APP.Zi:e!=null?$APP.Oh:$APP.ah;return new $APP.P(null,7,[$APP.Z,c,$APP.Mh,$APP.n(a)?a:"",$APP.ej,d,$APP.$g,$APP.D.h(d,$APP.Oh)?e:null,$APP.vh,dq(f),$APP.U,$APP.J(h),$APP.Fi,eq(b)],null)},kq=function(a){var b=jq(a);if($APP.N($APP.l(a,"__xAlertModel"),b)){b=$APP.M(b);var c=$APP.I(b,
|
|
7
|
+
$APP.Z),d=$APP.I(b,$APP.Mh),e=$APP.I(b,$APP.ej),f=$APP.I(b,$APP.$g),h=$APP.I(b,$APP.vh),k=$APP.I(b,$APP.U),m=iq(a),q=$APP.M(m);m=$APP.I(q,$APP.ri);var r=$APP.I(q,$APP.Fg),u=$APP.I(q,$APP.di),w=$APP.I(q,$APP.Ui),z=$APP.I(q,hq);q=$APP.I(q,$APP.eh);u=$APP.n(u)?u.assignedNodes().length>0:null;$APP.D.h(e,$APP.Oh)||(f=$APP.I($APP.ij,c),f=$APP.n(f)?f:$APP.I($APP.ij,$APP.yh));e=$APP.p(u)&&$APP.D.h(e,$APP.Zi);a.setAttribute("data-type",cq(c));u=m.setAttribute;c=$APP.D.h(c,$APP.ui)||$APP.D.h(c,$APP.qh)?"alert":
|
|
8
|
+
"status";u.call(m,"role",c);z.textContent=d;e?(w.textContent="",r.style.display="none"):(w.textContent=f,r.style.display="inline");$APP.n(h)?(q.disabled=$APP.J(k),q.style.display="inline-flex"):(q.disabled=!0,q.style.display="none");q.setAttribute("aria-label","Dismiss alert");d=$APP.n(h)?$APP.p(k):h;a.tabIndex=$APP.n(d)?0:-1;$APP.n(k)?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled");$APP.n(d)?a.setAttribute("aria-keyshortcuts","Escape"):a.removeAttribute("aria-keyshortcuts");
|
|
9
|
+
a.__xAlertModel=b}},lq=function(a){a=typeof a==="string"?a.trim():"";return $APP.D.h(a,"")||$APP.D.h(a,"0")||$APP.D.h(a,"0ms")||$APP.D.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*a))):0},mq=function(a){var b=window.getComputedStyle(a);a=lq(b.getPropertyValue("--x-alert-exit-duration"));b=lq(b.getPropertyValue("--x-motion-exit-duration"));
|
|
10
|
+
return a>0?a:b>0?b:160},nq=function(a){var b=$APP.l(a,"__xAlertTimeout");$APP.n(b)&&(clearTimeout(b),a.__xAlertTimeout=null)},pq=function(a){nq(a);var b=function(){var c=$APP.l(a,"__xAlertModel");return $APP.n(c)?c:jq(a)}();$APP.n(function(){var c=fq(b);return $APP.n(c)?typeof $APP.Fi.g(b)==="number"&&$APP.p($APP.l(a,"__xAlertExiting")):c}())&&$APP.ma(a,"__xAlertTimeout",setTimeout(function(){a.__xAlertTimeout=null;if($APP.n(function(){var d=a.isConnected;return $APP.n(d)?$APP.p($APP.l(a,"__xAlertExiting")):
|
|
11
|
+
d}())){var c=function(){var d=$APP.l(a,"__xAlertModel");return $APP.n(d)?d:jq(a)}();if($APP.n(fq(c)))return c=$APP.xg(gq(c,"timeout")),c=new CustomEvent("x-alert-dismiss",{detail:c,bubbles:!0,composed:!0,cancelable:!0}),c=a.dispatchEvent(c),$APP.n(c)?oq.g?oq.g(a):oq.call(null,a):null}return null},$APP.Fi.g(b)))},qq=function(a){if(!$APP.n($APP.l(a,"__xAlertEntered"))){a.__xAlertEntered=!0;a.setAttribute("data-entering","");var b=iq(a);b=$APP.M(b);var c=$APP.I(b,$APP.ri);c.addEventListener("animationend",
|
|
12
|
+
function f(e){return $APP.D.h(e.target,c)?(c.removeEventListener("animationend",f),a.removeAttribute("data-entering")):null})}},oq=function(a){if(!$APP.n($APP.l(a,"__xAlertExiting"))){a.__xAlertExiting=!0;nq(a);a.removeAttribute("data-entering");var b=mq(a);if(b===0||$APP.J(window.matchMedia("(prefers-reduced-motion:reduce)").matches))a.remove();else{var c=iq(a);c=$APP.M(c);var d=$APP.I(c,$APP.ri),e=function k(h){return $APP.D.h(h.target,d)?(d.removeEventListener("animationend",k),h=$APP.l(a,"__xAlertExitTimer"),
|
|
13
|
+
$APP.n(h)&&(clearTimeout(h),a.__xAlertExitTimer=null),$APP.n(a.isConnected)?a.remove():null):null};a.setAttribute("data-exiting","");d.addEventListener("animationend",e);$APP.ma(a,"__xAlertExitTimer",setTimeout(function(){var h=a.isConnected;return $APP.n($APP.n(h)?$APP.l(a,"__xAlertExiting"):h)?(d.removeEventListener("animationend",e),a.__xAlertExitTimer=null,a.remove()):null},b+60))}}return null},rq=function(a,b){var c=$APP.l(a,"__xAlertModel");c=$APP.n(c)?c:jq(a);b=$APP.xg(gq(c,b));b=new CustomEvent("x-alert-dismiss",
|
|
14
|
+
{detail:b,bubbles:!0,composed:!0,cancelable:!0});b=a.dispatchEvent(b);$APP.n(b)&&oq(a)},sq=function(a,b){var c=function(){var d=$APP.l(a,"__xAlertModel");return $APP.n(d)?d:jq(a)}();$APP.n(function(){var d=fq(c);return $APP.n(d)?$APP.p($APP.l(a,"__xAlertExiting")):d}())&&(b.preventDefault(),rq(a,"button"));return null},tq=function(a,b){if($APP.D.h(b.key,"Escape")){var c=function(){var d=$APP.l(a,"__xAlertModel");return $APP.n(d)?d:jq(a)}();$APP.n(function(){var d=fq(c);return $APP.n(d)?$APP.p($APP.l(a,
|
|
15
|
+
"__xAlertExiting")):d}())&&(b.preventDefault(),rq(a,"keyboard"))}return null},uq=function(a){function b(e){return tq(a,e)}function c(e){return sq(a,e)}var d=iq(a);d=$APP.M(d);$APP.I(d,$APP.eh).addEventListener("click",c);a.addEventListener("keydown",b);$APP.ma(a,"__xAlertHandlers",{click:c,keydown:b})},vq=function(a){nq(a);var b=$APP.l(a,"__xAlertExitTimer");$APP.n(b)&&(clearTimeout(b),a.__xAlertExitTimer=null);b=$APP.l(a,"__xAlertHandlers");var c=$APP.l(a,"__xAlertRefs");if($APP.n($APP.n(b)?c:b)){c=
|
|
16
|
+
$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",b)}a.__xAlertHandlers=null},wq=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,"text",{get:function(){var b=this.getAttribute("text");
|
|
17
|
+
return $APP.n(b)?b:""},set:function(b){return $APP.n(b)?this.setAttribute("text",""+$APP.S.g(b)):this.removeAttribute("text")},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,"disabled",{get:function(){return this.hasAttribute("disabled")},set:function(b){return $APP.n(b)?this.setAttribute("disabled",
|
|
18
|
+
""):this.removeAttribute("disabled")},enumerable:!0,configurable:!0});Object.defineProperty(a,"dismissible",{get:function(){return dq(this.getAttribute("dismissible"))},set:function(b){return $APP.n(b)?this.setAttribute("dismissible",""):this.setAttribute("dismissible","false")},enumerable:!0,configurable:!0});Object.defineProperty(a,"timeoutMs",{get:function(){return eq(this.getAttribute("timeout-ms"))},set:function(b){return b==null?this.removeAttribute("timeout-ms"):this.setAttribute("timeout-ms",
|
|
19
|
+
""+$APP.S.g(b|0))},enumerable:!0,configurable:!0})},yq=function(){var a=class extends HTMLElement{};a.observedAttributes=xq;a.prototype.connectedCallback=function(){iq(this);vq(this);uq(this);kq(this);qq(this);pq(this);return null};a.prototype.disconnectedCallback=function(){vq(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.N(c,d)&&(kq(this),$APP.n(this.isConnected)&&pq(this));return null};wq(a.prototype);return a},zq=function(){$APP.n(customElements.get("x-alert"))||
|
|
20
|
+
customElements.define("x-alert",yq());return null},xq="type text icon dismissible disabled timeout-ms".split(" "),hq=new $APP.K(null,"text-el","text-el",-1615414066);$APP.ka("app.exports.x_alert.init",zq);export const init=zq;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var Aq=function(a,b,c){c=typeof c==="string"?c.trim().toLowerCase():null;return $APP.Cc(a,c)?c:b},Bq=function(a){if(typeof a==="string"){a=parseInt(a,10);var b=isFinite(a);return $APP.n($APP.n(b)?a>0:b)?a:null}return null},Dq=function(a){var b=$APP.l(a,"__xAvatarGroupRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("slot"),e=document.createElement("span");c.textContent=":host{display:inline-flex;align-items:center;flex-direction:row;color-scheme:light dark;--x-avatar-group-overflow-bg:rgba(0,0,0,0.08);--x-avatar-group-overflow-color:rgba(0,0,0,0.70);--x-avatar-group-overflow-border:rgba(0,0,0,0.14);--x-avatar-group-overflow-ring:#ffffff;--x-avatar-group-size:32px;--x-avatar-group-font-size:0.75rem;}@media (prefers-color-scheme:dark){:host{--x-avatar-group-overflow-bg:rgba(255,255,255,0.10);--x-avatar-group-overflow-color:rgba(255,255,255,0.75);--x-avatar-group-overflow-border:rgba(255,255,255,0.18);--x-avatar-group-overflow-ring:#0b0c0f;}}:host([data-size\x3d'xs']){--x-avatar-group-size:20px;--x-avatar-group-font-size:0.625rem;}:host([data-size\x3d'sm']){--x-avatar-group-size:24px;--x-avatar-group-font-size:0.6875rem;}:host([data-size\x3d'md']){--x-avatar-group-size:32px;--x-avatar-group-font-size:0.75rem;}:host([data-size\x3d'lg']){--x-avatar-group-size:40px;--x-avatar-group-font-size:0.875rem;}:host([data-size\x3d'xl']){--x-avatar-group-size:48px;--x-avatar-group-font-size:1rem;}:host([data-direction\x3d'rtl']){flex-direction:row-reverse;}[part\x3doverflow]{display:none;flex-shrink:0;width:var(--x-avatar-group-size);height:var(--x-avatar-group-size);border-radius:999px;background:var(--x-avatar-group-overflow-bg);color:var(--x-avatar-group-overflow-color);border:1px solid var(--x-avatar-group-overflow-border);box-shadow:0 0 0 2px var(--x-avatar-group-overflow-ring);font-size:var(--x-avatar-group-font-size);font-weight:600;line-height:1;align-items:center;justify-content:center;user-select:none;box-sizing:border-box;white-space:nowrap;}::slotted(x-avatar){flex-shrink:0;}@media (prefers-reduced-motion:reduce){::slotted(x-avatar){transition:none !important;}}";
|
|
3
|
+
e.setAttribute("part","overflow");e.setAttribute("aria-hidden","true");b.appendChild(c);b.appendChild(d);b.appendChild(e);a.__xAvatarGroupRefs=new $APP.P(null,2,[$APP.Qh,d,Cq,e],null);return $APP.l(a,"__xAvatarGroupRefs")},Kq=function(a){a=new $APP.P(null,6,[$APP.hi,a.getAttribute("size"),Eq,a.getAttribute("overlap"),$APP.ih,a.getAttribute("max"),Fq,a.getAttribute("direction"),$APP.$h,a.hasAttribute("disabled"),$APP.dh,a.getAttribute("label")],null);var b=$APP.M(a);a=$APP.I(b,$APP.hi);var c=$APP.I(b,
|
|
4
|
+
Eq),d=$APP.I(b,$APP.ih),e=$APP.I(b,Fq),f=$APP.I(b,$APP.$h);b=$APP.I(b,$APP.dh);a=Aq(Gq,"md",a);c=Aq(Hq,"md",c);d=Bq(d);e=Aq(Iq,"ltr",e);f=$APP.J(f);typeof b==="string"?(b=b.trim(),b=$APP.D.h(b,"")?null:b):b=null;return new $APP.P(null,6,[$APP.Ag,a,Jq,c,$APP.fh,d,$APP.ci,e,$APP.yi,f,$APP.W,b],null)},Mq=function(a,b){b=$APP.M(b);var c=$APP.I(b,$APP.Ag),d=$APP.I(b,Jq),e=$APP.I(b,$APP.fh),f=$APP.I(b,$APP.ci),h=$APP.I(b,$APP.yi),k=$APP.I(b,$APP.W),m=Dq(a);m=$APP.M(m);var q=$APP.I(m,$APP.Qh);m=$APP.I(m,
|
|
5
|
+
Cq);var r=$APP.hc(q.assignedElements());q=$APP.B(r);q=$APP.n($APP.n(e)?q>e:e)?new $APP.O(null,2,5,$APP.Xd,[e,q-e],null):new $APP.O(null,2,5,$APP.Xd,[q,0],null);e=$APP.H(q,0,null);q=$APP.H(q,1,null);var u=$APP.lc(Lq,d,"0px");a.setAttribute("data-size",c);a.setAttribute("data-overlap",d);a.setAttribute("data-direction",f);$APP.n(k)?(a.setAttribute("role","group"),a.setAttribute("aria-label",k)):(a.setAttribute("role","group"),a.removeAttribute("aria-label"));d=$APP.v($APP.Id.m($APP.og,r,$APP.Bf(0,Number.MAX_VALUE)));
|
|
6
|
+
f=null;for(r=k=0;;)if(r<k){var w=f.F(null,r),z=$APP.H(w,0,null);w=$APP.H(w,1,null);w<e?(z.style.display="",z.setAttribute("size",c),$APP.n(h)?z.setAttribute("disabled",""):z.removeAttribute("disabled"),z.style.marginInlineStart=w>0?u:"0px"):z.style.display="none";r+=1}else if(d=$APP.v(d))$APP.yc(d)?(k=$APP.ob(d),d=$APP.pb(d),f=k,k=$APP.B(k)):(k=$APP.x(d),f=$APP.H(k,0,null),k=$APP.H(k,1,null),k<e?(f.style.display="",f.setAttribute("size",c),$APP.n(h)?f.setAttribute("disabled",""):f.removeAttribute("disabled"),
|
|
7
|
+
f.style.marginInlineStart=k>0?u:"0px"):f.style.display="none",d=$APP.y(d),f=null,k=0),r=0;else break;q>0?(m.textContent="+"+$APP.S.g(q),m.setAttribute("role","img"),m.setAttribute("aria-label",""+$APP.S.g(q)+" more"),m.style.display="inline-flex",m.style.marginInlineStart=u):(m.textContent="",m.style.display="none");a.__xAvatarGroupModel=b},Nq=function(a){Mq(a,Kq(a));return null},Oq=function(a){function b(){return Nq(a)}var c=Dq(a);c=$APP.M(c);c=$APP.I(c,$APP.Qh);$APP.n(c)&&c.addEventListener("slotchange",
|
|
8
|
+
b);$APP.ma(a,"__xAvatarGroupHandlers",{slot:b})},Pq=function(a){var b=$APP.l(a,"__xAvatarGroupHandlers");if($APP.n(b)){var c=$APP.l(a,"__xAvatarGroupRefs");$APP.n(c)&&(c=$APP.Qh.g(c),b=$APP.l(b,"slot"),$APP.n($APP.n(c)?b:c)&&c.removeEventListener("slotchange",b))}a.__xAvatarGroupHandlers=null},Qq=function(a){Object.defineProperty(a,"label",{get:function(){return this.getAttribute("label")},set:function(b){return $APP.n(b)?this.setAttribute("label",""+$APP.S.g(b)):this.removeAttribute("label")},enumerable:!0,
|
|
9
|
+
configurable:!0})},Rq=function(a,b,c){Object.defineProperty(a,b,{get:function(){var d=this.getAttribute(b);return $APP.n(d)?d:c},set:function(d){return $APP.n(d)?this.setAttribute(b,""+$APP.S.g(d)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},Sq=function(a){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})},Tq=function(a){Object.defineProperty(a,
|
|
10
|
+
"max",{get:function(){return Bq(this.getAttribute("max"))},set:function(b){return b!=null?this.setAttribute("max",""+$APP.S.g(b)):this.removeAttribute("max")},enumerable:!0,configurable:!0})},Uq=function(a){Rq(a,"size","md");Rq(a,"overlap","md");Rq(a,"direction","ltr");Qq(a);Sq(a);Tq(a)},Wq=function(){var a=class extends HTMLElement{};a.observedAttributes=Vq;a.prototype.connectedCallback=function(){Dq(this);Pq(this);Oq(this);Nq(this);return null};a.prototype.disconnectedCallback=function(){Pq(this);
|
|
11
|
+
return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.N(c,d)&&(b=Kq(this),$APP.N($APP.l(this,"__xAvatarGroupModel"),b)&&Mq(this,b));return null};Uq(a.prototype);return a},Xq=function(){$APP.n(customElements.get("x-avatar-group"))||customElements.define("x-avatar-group",Wq());return null},Eq=new $APP.K(null,"overlap-raw","overlap-raw",1202229114),Cq=new $APP.K(null,"overflow","overflow",2058931880),Fq=new $APP.K(null,"direction-raw","direction-raw",560730236),Jq=new $APP.K(null,"overlap",
|
|
12
|
+
"overlap",-1673335644);var Vq="size overlap max direction disabled label".split(" "),Gq=new $APP.R(null,new $APP.P(null,5,["xs",null,"md",null,"lg",null,"xl",null,"sm",null],null),null),Hq=new $APP.R(null,new $APP.P(null,4,["none",null,"md",null,"lg",null,"sm",null],null),null),Iq=new $APP.R(null,new $APP.P(null,2,["ltr",null,"rtl",null],null),null),Lq=new $APP.P(null,4,"none 0px sm -4px md -8px lg -12px".split(" "),null);$APP.ka("app.exports.x_avatar_group.init",Xq);export const init=Xq;
|
package/dist/x-avatar.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var PE=function(a){return function(){function b(h,k){return $APP.p(a.h?a.h(h,k):a.call(null,h,k))}function c(h){return $APP.p(a.g?a.g(h):a.call(null,h))}function d(){return $APP.p(a.K?a.K():a.call(null))}var e=null,f=function(){function h(m,q,r){var u=null;if(arguments.length>2){u=0;for(var w=Array(arguments.length-2);u<w.length;)w[u]=arguments[u+2],++u;u=new $APP.Ib(w,0,null)}return k.call(this,m,q,u)}function k(m,q,r){return $APP.p($APP.td(a,m,q,r))}h.Y=2;h.X=function(m){var q=$APP.x(m);m=$APP.y(m);
|
|
3
|
+
var r=$APP.x(m);m=$APP.Mb(m);return k(q,r,m)};h.G=k;return h}();e=function(h,k,m){switch(arguments.length){case 0:return d.call(this);case 1:return c.call(this,h);case 2:return b.call(this,h,k);default:var q=null;if(arguments.length>2){q=0;for(var r=Array(arguments.length-2);q<r.length;)r[q]=arguments[q+2],++q;q=new $APP.Ib(r,0,null)}return f.G(h,k,q)}throw Error("Invalid arity: "+arguments.length);};e.Y=2;e.X=f.X;e.K=d;e.g=c;e.h=b;e.G=f.G;return e}()},QE=function(a,b){return $APP.Kd(PE(a),b)},RE=
|
|
4
|
+
function(a,b,c){c=typeof c==="string"?c.trim().toLowerCase():null;return $APP.Cc(a,c)?c:b},SE=function(a){return typeof a==="string"?(a=a.trim(),$APP.D.h(a,"")?null:a):null},TE=function(a){a=SE(a);if($APP.n(a)){var b=$APP.be(QE(function(c){return $APP.D.h(c,"")},a.split(/\s+/)));if($APP.v(b))return a=$APP.x(b)[0],b=$APP.B(b)>=2?$APP.x($APP.y(b))[0]:null,a=""+$APP.S.g(a)+$APP.S.g($APP.n(b)?b:""),$APP.D.h(a,"")?null:a.toUpperCase()}return null},WE=function(a){var b=$APP.M(a);a=$APP.I(b,UE);b=$APP.I(b,
|
|
5
|
+
VE);return $APP.n(a)?a:b},YE=function(a){var b=$APP.M(a);a=$APP.I(b,XE);b=$APP.I(b,$APP.ii);return $APP.n(a)?a:b},fF=function(a){var b=$APP.l(a,"__xAvatarRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("img"),f=document.createElement("span"),h=document.createElement("span"),k=document.createElement("span"),m=document.createElement("span"),q=document.createElement("slot");c.textContent=":host{display:inline-block;vertical-align:middle;position:relative;color-scheme:light dark;--x-avatar-size-xs:20px;--x-avatar-size-sm:24px;--x-avatar-size-md:32px;--x-avatar-size-lg:40px;--x-avatar-size-xl:48px;--x-avatar-radius:10px;--x-avatar-disabled-opacity:0.55;--x-avatar-bg:rgba(0,0,0,0.06);--x-avatar-border:rgba(0,0,0,0.14);--x-avatar-color:rgba(0,0,0,0.86);--x-avatar-ring:#ffffff;--x-avatar-status-online:rgba(16,140,72,0.95);--x-avatar-status-offline:rgba(0,0,0,0.45);--x-avatar-status-busy:rgba(190,20,40,0.95);--x-avatar-status-away:rgba(204,120,0,0.95);--x-avatar-status-color:transparent;--x-avatar-font-size:0.875rem;--x-avatar-size:var(--x-avatar-size-md);}@media (prefers-color-scheme:dark){:host{--x-avatar-bg:rgba(255,255,255,0.10);--x-avatar-border:rgba(255,255,255,0.18);--x-avatar-color:rgba(255,255,255,0.88);--x-avatar-ring:#0b0c0f;--x-avatar-status-online:rgba(60,210,120,0.95);--x-avatar-status-offline:rgba(255,255,255,0.45);--x-avatar-status-busy:rgba(255,90,110,0.95);--x-avatar-status-away:rgba(255,190,90,0.95);}}:host([data-size\x3d'xs']){--x-avatar-size:var(--x-avatar-size-xs);--x-avatar-font-size:0.625rem;}:host([data-size\x3d'sm']){--x-avatar-size:var(--x-avatar-size-sm);--x-avatar-font-size:0.75rem;}:host([data-size\x3d'md']){--x-avatar-size:var(--x-avatar-size-md);}:host([data-size\x3d'lg']){--x-avatar-size:var(--x-avatar-size-lg);--x-avatar-font-size:1rem;}:host([data-size\x3d'xl']){--x-avatar-size:var(--x-avatar-size-xl);--x-avatar-font-size:1.125rem;}:host([data-variant\x3d'brand']){--x-avatar-bg:rgba(0,102,204,0.10);--x-avatar-border:rgba(0,102,204,0.30);--x-avatar-color:rgba(0,60,120,0.90);}:host([data-variant\x3d'subtle']){--x-avatar-bg:rgba(0,0,0,0.03);--x-avatar-border:rgba(0,0,0,0.08);--x-avatar-color:rgba(0,0,0,0.55);}@media (prefers-color-scheme:dark){:host([data-variant\x3d'brand']){--x-avatar-bg:rgba(80,160,255,0.18);--x-avatar-border:rgba(80,160,255,0.40);--x-avatar-color:rgba(210,235,255,0.92);}:host([data-variant\x3d'subtle']){--x-avatar-bg:rgba(255,255,255,0.04);--x-avatar-border:rgba(255,255,255,0.08);--x-avatar-color:rgba(255,255,255,0.50);}}[part\x3droot]{width:var(--x-avatar-size);height:var(--x-avatar-size);display:inline-flex;align-items:center;justify-content:center;overflow:hidden;background:var(--x-avatar-bg);color:var(--x-avatar-color);border:1px solid var(--x-avatar-border);box-shadow:0 0 0 2px var(--x-avatar-ring);font-size:var(--x-avatar-font-size);font-weight:600;line-height:1;user-select:none;border-radius:999px;}:host([data-shape\x3d'square']) [part\x3droot]{border-radius:0;}:host([data-shape\x3d'rounded']) [part\x3droot]{border-radius:var(--x-avatar-radius);}:host([disabled]){opacity:var(--x-avatar-disabled-opacity);}[part\x3dimage]{width:100%;height:100%;object-fit:cover;display:none;}[part\x3dinitials],[part\x3dfallback]{display:none;padding:0 0.25em;}[part\x3dstatus]{position:absolute;right:-1px;bottom:-1px;width:0.34em;height:0.34em;min-width:10px;min-height:10px;border-radius:999px;border:2px solid var(--x-avatar-ring);background:var(--x-avatar-status-color);display:none;}[part\x3dbadge]{position:absolute;top:-4px;right:-4px;display:none;}slot[name\x3dbadge]::slotted(*){display:block;}@media (prefers-reduced-motion:reduce){[part\x3droot]{transition:none !important;}}";
|
|
6
|
+
d.setAttribute("part","root");e.setAttribute("part","image");e.setAttribute("alt","");f.setAttribute("part","initials");h.setAttribute("part","fallback");h.textContent="?";k.setAttribute("part","status");k.setAttribute("aria-hidden","true");m.setAttribute("part","badge");q.setAttribute("name","badge");m.appendChild(q);d.appendChild(e);d.appendChild(f);d.appendChild(h);b.appendChild(c);b.appendChild(d);b.appendChild(k);b.appendChild(m);a.__xAvatarRefs=new $APP.P(null,7,[ZE,d,$E,e,aF,f,bF,h,cF,k,dF,
|
|
7
|
+
m,eF,q],null);return $APP.l(a,"__xAvatarRefs")},iF=function(a,b){b=$APP.M(b);var c=$APP.I(b,gF),d=$APP.I(b,$APP.Ag),e=$APP.I(b,hF),f=$APP.I(b,$APP.Wg),h=$APP.I(b,$APP.Gg),k=$APP.I(b,$APP.yi),m=fF(a),q=$APP.M(m);m=$APP.I(q,$E);var r=$APP.I(q,aF),u=$APP.I(q,bF),w=$APP.I(q,cF),z=$APP.I(q,dF),A=$APP.I(q,eF),C=$APP.J($APP.l(a,"__xAvatarImgOk")),F=c!=null;q=WE(b);var E=YE(b);C=F&&C;F=!C&&q!=null;var Q=!C&&!F;A=$APP.n(A)?A.assignedNodes().length>0:null;a.setAttribute("data-size",d);a.setAttribute("data-shape",
|
|
8
|
+
e);a.setAttribute("data-variant",f);$APP.n(E)?(a.setAttribute("role","img"),a.setAttribute("aria-label",E),a.removeAttribute("aria-hidden")):(a.removeAttribute("role"),a.removeAttribute("aria-label"),a.setAttribute("aria-hidden","true"));$APP.n(k)?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled");c=$APP.n(c)?c:"";$APP.N(function(){var V=$APP.l(a,"__xAvatarLastSrc");return $APP.n(V)?V:""}(),c)&&(a.__xAvatarLastSrc=c,m.src=c);m.style.display=C?"block":"none";F&&(r.textContent=
|
|
9
|
+
q);r.style.display=F?"inline":"none";u.style.display=Q?"inline":"none";$APP.n(h)?(a.style.setProperty("--x-avatar-status-color",function(){switch(h){case "online":return"var(--x-avatar-status-online)";case "busy":return"var(--x-avatar-status-busy)";case "away":return"var(--x-avatar-status-away)";default:return"var(--x-avatar-status-offline)"}}()),w.style.display="block"):w.style.display="none";z.style.display=$APP.n(A)?"block":"none";a.__xAvatarModel=b},rF=function(a){var b=$APP.bf([jF,$APP.Eh,$APP.Kh,
|
|
10
|
+
kF,$APP.Bh,$APP.$h,lF,mF,$APP.hi],[a.getAttribute("initials"),a.getAttribute("variant"),a.getAttribute("name"),a.getAttribute("shape"),a.getAttribute("status"),a.hasAttribute("disabled"),a.getAttribute("alt"),a.getAttribute("src"),a.getAttribute("size")]);var c=$APP.M(b),d=$APP.I(c,jF),e=$APP.I(c,$APP.Eh),f=$APP.I(c,$APP.Kh);b=$APP.I(c,kF);var h=$APP.I(c,$APP.Bh),k=$APP.I(c,lF),m=$APP.I(c,$APP.$h),q=$APP.I(c,mF);c=$APP.I(c,$APP.hi);q=SE(q);k=SE(k);f=SE(f);d=SE(d);d=$APP.n(d)?d.length>3?d.slice(0,
|
|
11
|
+
3):d:null;var r=d==null?TE(f):null,u=[UE,$APP.yi,$APP.Wg,XE,$APP.ii,gF,$APP.Ag,$APP.Gg,VE,hF];m=$APP.J(m);e=RE(nF,"neutral",e);c=RE(oF,"md",c);h=typeof h==="string"?h.trim().toLowerCase():null;h=$APP.Cc(pF,h)?h:null;b=$APP.bf(u,[d,m,e,k,f,q,c,h,r,RE(qF,"circle",b)]);$APP.N($APP.l(a,"__xAvatarModel"),b)&&iF(a,b);return null},sF=function(a){function b(){return rF(a)}function c(){a.__xAvatarImgOk=!1;return rF(a)}function d(){a.__xAvatarImgOk=!0;return rF(a)}var e=fF(a),f=$APP.M(e);e=$APP.I(f,$E);f=$APP.I(f,
|
|
12
|
+
eF);e.addEventListener("load",d);e.addEventListener("error",c);$APP.n(f)&&f.addEventListener("slotchange",b);$APP.ma(a,"__xAvatarHandlers",{load:d,error:c,slot:b})},uF=function(a){var b=$APP.l(a,"__xAvatarHandlers");if($APP.n(b)){var c=$APP.l(a,"__xAvatarRefs");if($APP.n(c)){var d=$E.g(c);c=eF.g(c);var e=$APP.l(b,"load"),f=$APP.l(b,"error");b=$APP.l(b,"slot");$APP.n(e)&&d.removeEventListener("load",e);$APP.n(f)&&d.removeEventListener("error",f);$APP.n($APP.n(c)?b:c)&&c.removeEventListener("slotchange",
|
|
13
|
+
b)}}a.__xAvatarHandlers=null},vF=function(a,b){Object.defineProperty(a,b,{get:function(){return this.getAttribute(b)},set:function(c){return $APP.n(c)?this.setAttribute(b,""+$APP.S.g(c)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},wF=function(a,b,c){Object.defineProperty(a,b,{get:function(){var d=this.getAttribute(b);return $APP.n(d)?d:c},set:function(d){return $APP.n(d)?this.setAttribute(b,""+$APP.S.g(d)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},xF=function(a){vF(a,
|
|
14
|
+
"src");vF(a,"alt");vF(a,"name");vF(a,"initials");wF(a,"size","md");wF(a,"shape","circle");wF(a,"variant","neutral");vF(a,"status");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})},zF=function(){var a=class extends HTMLElement{};a.observedAttributes=yF;a.prototype.connectedCallback=function(){fF(this);uF(this);sF(this);rF(this);
|
|
15
|
+
return null};a.prototype.disconnectedCallback=function(){uF(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.N(c,d)&&($APP.D.h(b,"src")&&(this.__xAvatarImgOk=!1),rF(this));return null};xF(a.prototype);return a},AF=function(){$APP.n(customElements.get("x-avatar"))||customElements.define("x-avatar",zF());return null},gF=new $APP.K(null,"src","src",-1651076051),XE=new $APP.K(null,"alt","alt",-3214426),dF=new $APP.K(null,"badge-el","badge-el",1341875403),eF=new $APP.K(null,
|
|
16
|
+
"badge-slot","badge-slot",2030670001),kF=new $APP.K(null,"shape-raw","shape-raw",1588938757),aF=new $APP.K(null,"initials-el","initials-el",2044340724),jF=new $APP.K(null,"initials-raw","initials-raw",1031756224),$E=new $APP.K(null,"img","img",1442687358),VE=new $APP.K(null,"derived","derived",1986040597),mF=new $APP.K(null,"src-raw","src-raw",-510472785),lF=new $APP.K(null,"alt-raw","alt-raw",-1423153400),bF=new $APP.K(null,"fallback-el","fallback-el",-208030239),ZE=new $APP.K(null,"root-el","root-el",
|
|
17
|
+
1068654895),hF=new $APP.K(null,"shape","shape",1190694006),cF=new $APP.K(null,"status-el","status-el",2132204108),UE=new $APP.K(null,"initials","initials",-2130377215);var yF="src alt name initials size shape variant status disabled".split(" "),oF=new $APP.R(null,new $APP.P(null,5,["xs",null,"md",null,"lg",null,"xl",null,"sm",null],null),null),qF=new $APP.R(null,new $APP.P(null,3,["rounded",null,"square",null,"circle",null],null),null),nF=new $APP.R(null,new $APP.P(null,3,["neutral",null,"brand",null,"subtle",null],null),null),pF=new $APP.R(null,new $APP.P(null,4,["online",null,"away",null,"offline",null,"busy",null],null),null);
|
|
18
|
+
$APP.bf([UE,$APP.yi,$APP.Wg,XE,$APP.ii,gF,$APP.Ag,$APP.Gg,hF],[new $APP.P(null,1,[$APP.Z,$APP.X],null),new $APP.P(null,1,[$APP.Z,$APP.Li],null),new $APP.P(null,1,[$APP.Z,$APP.X],null),new $APP.P(null,1,[$APP.Z,$APP.X],null),new $APP.P(null,1,[$APP.Z,$APP.X],null),new $APP.P(null,1,[$APP.Z,$APP.X],null),new $APP.P(null,1,[$APP.Z,$APP.X],null),new $APP.P(null,1,[$APP.Z,$APP.X],null),new $APP.P(null,1,[$APP.Z,$APP.X],null)]);$APP.ka("app.exports.x_avatar.init",AF);export const init=AF;
|
package/dist/x-badge.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var mE=function(a,b,c){c=typeof c==="string"?c.trim().toLowerCase():null;return $APP.Cc(a,c)?c:b},nE=function(a,b){if(typeof a==="string"){a=parseInt(a,10);var c=isFinite(a);return $APP.n($APP.n(c)?a>=0:c)?a:b}return b},sE=function(a){var b=$APP.M(a);a=$APP.I(b,oE);var c=$APP.I(b,$APP.Hg),d=$APP.I(b,$APP.Mh);b=$APP.I(b,pE);return $APP.n(a)?qE:c!=null?$APP.Hg:d!=null?$APP.Mh:$APP.n(b)?pE:rE},tE=function(a){var b=$APP.M(a);a=$APP.I(b,$APP.Hg);var c=$APP.I(b,$APP.fh),d=$APP.I(b,$APP.Mh);b=sE(b);switch(b instanceof
|
|
3
|
+
$APP.K?b.oa:null){case "count":return a>c?""+$APP.S.g(c)+"+":""+$APP.S.g(a);case "text":return d;default:return null}},AE=function(a){var b=$APP.M(a);a=$APP.I(b,$APP.Ei);var c=$APP.I(b,uE),d=$APP.I(b,$APP.ki),e=$APP.I(b,vE),f=$APP.I(b,$APP.Eh),h=$APP.I(b,$APP.zg),k=$APP.I(b,oE),m=$APP.I(b,$APP.ih),q=$APP.I(b,wE);b=$APP.I(b,$APP.hi);m=nE(m,99);var r=$APP.n(q)?function(){var u=nE(q,null);return u!=null?u:null}():null;return $APP.bf([oE,$APP.Wg,xE,$APP.Ag,$APP.fh,$APP.Hg,$APP.Xi,pE,$APP.bi,$APP.Mh],
|
|
4
|
+
[$APP.J(k),mE(yE,"neutral",f),e!=null&&$APP.N(e,"false"),mE(zE,"md",b),m,r,d,c!=null&&$APP.N(c,"false"),a,typeof h==="string"?function(){var u=h.trim();return $APP.D.h(u,"")?null:u}():null])},CE=function(a){var b=$APP.l(a,"__xBadgeRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("slot"),f=document.createElement("span");c.textContent=":host{display:inline-flex;vertical-align:middle;align-items:center;justify-content:center;color-scheme:light dark;--x-badge-bg:rgba(0,0,0,0.08);--x-badge-color:rgba(0,0,0,0.80);--x-badge-border:rgba(0,0,0,0.12);--x-badge-font-size:0.75rem;--x-badge-height:1.25rem;--x-badge-padding:0 0.375rem;--x-badge-radius:0.25rem;}@media (prefers-color-scheme:dark){:host{--x-badge-bg:rgba(255,255,255,0.12);--x-badge-color:rgba(255,255,255,0.88);--x-badge-border:rgba(255,255,255,0.14);}}:host([data-variant\x3d'info']){--x-badge-bg:rgba(0,102,204,0.12);--x-badge-color:rgba(0,60,140,0.90);--x-badge-border:rgba(0,102,204,0.25);}:host([data-variant\x3d'success']){--x-badge-bg:rgba(16,140,72,0.12);--x-badge-color:rgba(0,90,45,0.90);--x-badge-border:rgba(16,140,72,0.25);}:host([data-variant\x3d'warning']){--x-badge-bg:rgba(204,120,0,0.12);--x-badge-color:rgba(140,70,0,0.90);--x-badge-border:rgba(204,120,0,0.25);}:host([data-variant\x3d'error']){--x-badge-bg:rgba(190,20,40,0.12);--x-badge-color:rgba(140,0,20,0.90);--x-badge-border:rgba(190,20,40,0.25);}@media (prefers-color-scheme:dark){:host([data-variant\x3d'info']){--x-badge-bg:rgba(80,160,255,0.18);--x-badge-color:rgba(210,235,255,0.95);--x-badge-border:rgba(80,160,255,0.35);}:host([data-variant\x3d'success']){--x-badge-bg:rgba(60,210,120,0.18);--x-badge-color:rgba(200,255,230,0.95);--x-badge-border:rgba(60,210,120,0.35);}:host([data-variant\x3d'warning']){--x-badge-bg:rgba(255,190,90,0.18);--x-badge-color:rgba(255,235,180,0.95);--x-badge-border:rgba(255,190,90,0.35);}:host([data-variant\x3d'error']){--x-badge-bg:rgba(255,90,110,0.18);--x-badge-color:rgba(255,210,215,0.95);--x-badge-border:rgba(255,90,110,0.35);}}:host([data-size\x3d'sm']){--x-badge-font-size:0.6875rem;--x-badge-height:1rem;--x-badge-padding:0 0.25rem;--x-badge-radius:0.1875rem;}[part\x3dbase]{display:inline-flex;align-items:center;justify-content:center;min-height:var(--x-badge-height);padding:var(--x-badge-padding);border-radius:var(--x-badge-radius);border:1px solid var(--x-badge-border);background:var(--x-badge-bg);color:var(--x-badge-color);font-size:var(--x-badge-font-size);font-weight:600;line-height:1;white-space:nowrap;user-select:none;box-sizing:border-box;}:host([data-pill]) [part\x3dbase]{border-radius:999px;}:host([data-dot]) [part\x3dbase]{min-width:var(--x-badge-height);padding:0;}:host([data-mode\x3d'dot']) [part\x3dlabel],:host([data-mode\x3d'empty']) [part\x3dbase]{display:none;}slot{display:none;}:host([data-mode\x3d'slot']) slot{display:contents;}:host([data-mode\x3d'slot']) [part\x3dlabel]{display:none;}@media (prefers-reduced-motion:reduce){[part\x3dbase]{transition:none !important;}}";
|
|
5
|
+
d.setAttribute("part","base");d.setAttribute("role","status");f.setAttribute("part","label");d.appendChild(e);d.appendChild(f);b.appendChild(c);b.appendChild(d);a.__xBadgeRefs=new $APP.P(null,3,[BE,d,$APP.Qh,e,$APP.Ri,f],null);return $APP.l(a,"__xBadgeRefs")},DE=function(a){var b=CE(a);b=$APP.M(b);b=$APP.I(b,$APP.Qh);return AE($APP.bf([$APP.Eh,$APP.zg,oE,$APP.ih,$APP.hi,wE,$APP.Ei,uE,$APP.ki,vE],[a.getAttribute("variant"),a.getAttribute("text"),$APP.n(b)?b.assignedNodes().length>0:null,a.getAttribute("max"),
|
|
6
|
+
a.getAttribute("size"),a.getAttribute("count"),a.getAttribute("aria-label"),a.getAttribute("dot"),a.getAttribute("aria-describedby"),a.getAttribute("pill")]))},EE=function(a){var b=DE(a);if($APP.N($APP.l(a,"__xBadgeModel"),b)){b=$APP.M(b);var c=$APP.I(b,$APP.Wg),d=$APP.I(b,$APP.Ag),e=$APP.I(b,xE),f=$APP.I(b,pE),h=$APP.I(b,$APP.bi),k=$APP.I(b,$APP.Xi),m=CE(a),q=$APP.M(m);m=$APP.I(q,BE);q=$APP.I(q,$APP.Ri);var r=sE(b),u=tE(b);a.setAttribute("data-variant",c);a.setAttribute("data-size",d);a.setAttribute("data-mode",
|
|
7
|
+
$APP.vf(r));$APP.n(e)?a.setAttribute("data-pill",""):a.removeAttribute("data-pill");$APP.n(f)?a.setAttribute("data-dot",""):a.removeAttribute("data-dot");q.textContent=$APP.n(u)?u:"";$APP.n(h)?m.setAttribute("aria-label",h):m.removeAttribute("aria-label");$APP.n(k)?m.setAttribute("aria-describedby",k):m.removeAttribute("aria-describedby");a.__xBadgeModel=b}return null},FE=function(a){function b(){return EE(a)}var c=CE(a);c=$APP.M(c);c=$APP.I(c,$APP.Qh);$APP.n(c)&&c.addEventListener("slotchange",b);
|
|
8
|
+
$APP.ma(a,"__xBadgeHandlers",{slot:b})},GE=function(a){var b=$APP.l(a,"__xBadgeHandlers");if($APP.n(b)){var c=$APP.l(a,"__xBadgeRefs");$APP.n(c)&&(c=$APP.Qh.g(c),b=$APP.l(b,"slot"),$APP.n($APP.n(c)?b:c)&&c.removeEventListener("slotchange",b))}a.__xBadgeHandlers=null},HE=function(a,b){Object.defineProperty(a,b,{get:function(){return this.getAttribute(b)},set:function(c){return $APP.n(c)?this.setAttribute(b,""+$APP.S.g(c)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},IE=function(a,b,c){Object.defineProperty(a,
|
|
9
|
+
b,{get:function(){var d=this.getAttribute(b);return $APP.n(d)?d:c},set:function(d){return $APP.n(d)?this.setAttribute(b,""+$APP.S.g(d)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},JE=function(a,b){Object.defineProperty(a,b,{get:function(){return this.hasAttribute(b)},set:function(c){return $APP.n(c)?this.setAttribute(b,""):this.removeAttribute(b)},enumerable:!0,configurable:!0})},KE=function(a,b,c){Object.defineProperty(a,b,{get:function(){return nE(this.getAttribute(b),c)},set:function(d){return d!=
|
|
10
|
+
null?this.setAttribute(b,""+$APP.S.g(d)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},LE=function(a){IE(a,"variant","neutral");IE(a,"size","md");JE(a,"pill");JE(a,"dot");HE(a,"text");HE(a,"aria-label");HE(a,"aria-describedby");KE(a,"count",null);KE(a,"max",99);Object.defineProperty(a,"displayText",{get:function(){return tE(DE(this))},enumerable:!0,configurable:!0})},NE=function(){var a=class extends HTMLElement{};a.observedAttributes=ME;a.prototype.connectedCallback=function(){CE(this);
|
|
11
|
+
GE(this);FE(this);EE(this);return null};a.prototype.disconnectedCallback=function(){GE(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.N(c,d)&&EE(this);return null};LE(a.prototype);return a},OE=function(){$APP.n(customElements.get("x-badge"))||customElements.define("x-badge",NE());return null},oE=new $APP.K(null,"has-slot?","has-slot?",181244965),rE=new $APP.K(null,"empty","empty",767870958),pE=new $APP.K(null,"dot","dot",1442709401),xE=new $APP.K(null,"pill","pill",-37707E3),
|
|
12
|
+
wE=new $APP.K(null,"count-raw","count-raw",-952861839),qE=new $APP.K(null,"slot","slot",240229571),uE=new $APP.K(null,"dot-raw","dot-raw",1754908187),vE=new $APP.K(null,"pill-raw","pill-raw",-557846051),BE=new $APP.K(null,"base","base",185279322);var ME="variant size pill dot count max text aria-label aria-describedby".split(" "),yE=new $APP.R(null,new $APP.P(null,5,["success",null,"neutral",null,"warning",null,"info",null,"error",null],null),null),zE=new $APP.R(null,new $APP.P(null,2,["md",null,"sm",null],null),null);$APP.ka("app.exports.x_badge.init",OE);export const init=OE;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var Ln=function(a,b,c){c=typeof c==="string"?c.trim().toLowerCase():null;return $APP.Cc(a,c)?c:b},Mn=function(a,b){if(typeof a==="string"){a=parseInt(a,10);var c=isFinite(a);return $APP.n($APP.n(c)?a>0:c)?a:b}return b},Nn=function(a){var b=$APP.l(a,"__xBreadcrumbsRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("nav"),e=document.createElement("ol"),f=document.createElement("slot");c.textContent=":host{display:block;color-scheme:light dark;--x-breadcrumbs-color:rgba(0,0,0,0.55);--x-breadcrumbs-color-current:rgba(0,0,0,0.88);--x-breadcrumbs-color-hover:rgba(0,0,0,0.80);--x-breadcrumbs-separator-color:rgba(0,0,0,0.35);--x-breadcrumbs-font-size:0.875rem;--x-breadcrumbs-gap:0.25rem;--x-breadcrumbs-disabled-opacity:0.55;}@media (prefers-color-scheme:dark){:host{--x-breadcrumbs-color:rgba(255,255,255,0.50);--x-breadcrumbs-color-current:rgba(255,255,255,0.90);--x-breadcrumbs-color-hover:rgba(255,255,255,0.75);--x-breadcrumbs-separator-color:rgba(255,255,255,0.30);}}:host([data-size\x3d'sm']){--x-breadcrumbs-font-size:0.75rem;}:host([data-size\x3d'lg']){--x-breadcrumbs-font-size:1rem;}:host([disabled]){opacity:var(--x-breadcrumbs-disabled-opacity);pointer-events:none;}[part\x3droot]{display:block;font-size:var(--x-breadcrumbs-font-size);}[part\x3dlist]{display:flex;flex-wrap:wrap;align-items:center;list-style:none;margin:0;padding:0;gap:var(--x-breadcrumbs-gap);}:host([data-wrap\x3d'false']) [part\x3dlist]{flex-wrap:nowrap;}.crumb{display:inline-flex;align-items:center;gap:var(--x-breadcrumbs-gap);}.crumb-content{color:var(--x-breadcrumbs-color);text-decoration:none;cursor:pointer;}.crumb-content:hover{color:var(--x-breadcrumbs-color-hover);}.crumb[data-current] .crumb-content{color:var(--x-breadcrumbs-color-current);font-weight:500;}:host([data-variant\x3d'subtle']) .crumb-content{opacity:0.75;}:host([data-variant\x3d'text']) .crumb-content{text-decoration:none;border-bottom:none;}.separator{color:var(--x-breadcrumbs-separator-color);user-select:none;aria-hidden:true;flex-shrink:0;}.ellipsis{display:inline-flex;align-items:center;gap:var(--x-breadcrumbs-gap);}.ellipsis-btn{color:var(--x-breadcrumbs-color);background:none;border:none;padding:0;cursor:pointer;font:inherit;line-height:1;}.ellipsis-btn:hover{color:var(--x-breadcrumbs-color-hover);}slot{display:none;}@media (prefers-reduced-motion:reduce){[part\x3dlist]{transition:none !important;}}";
|
|
3
|
+
d.setAttribute("part","root");e.setAttribute("part","list");d.appendChild(e);b.appendChild(c);b.appendChild(d);b.appendChild(f);a.__xBreadcrumbsRefs=new $APP.P(null,3,[$APP.nh,d,$APP.mh,e,$APP.Qh,f],null);return $APP.l(a,"__xBreadcrumbsRefs")},On=function(a){var b=document.createElement("span");b.setAttribute("class","separator");b.setAttribute("aria-hidden","true");b.textContent=a;return b},Pn=function(a){var b=document.createElement("li"),c=document.createElement("span"),d=document.createElement("button");
|
|
4
|
+
b.setAttribute("class","ellipsis");c.setAttribute("class","separator");c.setAttribute("aria-hidden","true");c.textContent=a;d.setAttribute("class","ellipsis-btn");d.setAttribute("aria-label","Show hidden breadcrumbs");d.textContent="…";b.appendChild(c);b.appendChild(d);return b},Qn=function(a,b){var c=document.createElement("li"),d=document.createElement("span");a=a.cloneNode(!0);c.setAttribute("class","crumb");d.setAttribute("class","crumb-content");d.appendChild(a);c.appendChild(d);$APP.n(b)&&(c.setAttribute("data-current",
|
|
5
|
+
""),d.setAttribute("aria-current","page"));return c},go=function(a){var b=$APP.bf([$APP.Eh,Rn,$APP.$h,Sn,Tn,$APP.hi,Un,Vn,$APP.Ei,Wn,$APP.ki],[a.getAttribute("variant"),a.getAttribute("max-items"),a.hasAttribute("disabled"),a.getAttribute("wrap"),a.getAttribute("items-after"),a.getAttribute("size"),a.hasAttribute("preserve-aria-current"),a.getAttribute("items-before"),a.getAttribute("aria-label"),a.getAttribute("separator"),a.getAttribute("aria-describedby")]);var c=$APP.M(b);b=$APP.I(c,$APP.Ei);
|
|
6
|
+
var d=$APP.I(c,Wn),e=$APP.I(c,$APP.ki),f=$APP.I(c,Rn),h=$APP.I(c,$APP.Eh),k=$APP.I(c,$APP.$h),m=$APP.I(c,Tn),q=$APP.I(c,Sn),r=$APP.I(c,$APP.hi),u=$APP.I(c,Un);c=$APP.I(c,Vn);u=$APP.J(u);m=Mn(m,2);q=q!=null&&$APP.N(q,"false");k=$APP.J(k);h=Ln(Xn,"default",h);if(typeof f==="string"){f=parseInt(f,10);var w=isFinite(f);f=$APP.n($APP.n(w)?f>0:w)?f:null}else f=null;b=$APP.bf([Yn,Zn,$n,$APP.yi,$APP.Wg,ao,$APP.Ag,$APP.Xi,bo,$APP.bi,$APP.ph],[u,m,q,k,h,f,Ln(co,"md",r),e,Mn(c,1),b,typeof d==="string"?d:"/"]);
|
|
7
|
+
b=$APP.M(b);d=$APP.I(b,$APP.Ag);e=$APP.I(b,$APP.Wg);r=$APP.I(b,$n);$APP.I(b,$APP.yi);c=$APP.I(b,$APP.bi);u=$APP.I(b,$APP.Xi);f=Nn(a);f=$APP.M(f);f=$APP.I(f,$APP.nh);a.setAttribute("data-size",d);a.setAttribute("data-variant",e);a.setAttribute("data-wrap",""+$APP.S.g($APP.J(r)));$APP.n(c)?f.setAttribute("aria-label",c):f.setAttribute("aria-label","Breadcrumb");$APP.n(u)?f.setAttribute("aria-describedby",u):f.removeAttribute("aria-describedby");e=$APP.M(b);d=$APP.I(e,$APP.ph);m=$APP.I(e,ao);h=$APP.I(e,
|
|
8
|
+
bo);f=$APP.I(e,Zn);e=$APP.I(e,Yn);r=Nn(a);r=$APP.M(r);c=$APP.I(r,$APP.Qh);r=$APP.I(r,$APP.mh);c=$APP.hc(c.assignedElements());u=$APP.B(c);m==null||u<=m?f=new $APP.P(null,3,[$APP.Wh,$APP.be($APP.Bf(0,u)),eo,-1,fo,u],null):(m=$APP.lg.h(h,$APP.kg.h(0,u-f)),f=$APP.lg.h(f,$APP.kg.h(0,u-m)),m=$APP.lg.h(m,u-f),m=$APP.kg.h(0,m),m=$APP.be($APP.Bf(0,m)),f=$APP.be($APP.Bf(u-f,u)),f=new $APP.P(null,3,[$APP.Wh,$APP.Ae.h(m,f),eo,$APP.B(m),fo,u],null));u=$APP.Wh.g(f);f=eo.g(f);r.innerHTML="";m=$APP.v($APP.Bd($APP.og,
|
|
9
|
+
u));h=null;for(k=q=0;;)if(k<q){var z=h.F(null,k);w=$APP.H(z,0,null);z=$APP.H(z,1,null);z=$APP.H(c,z,null);var A=$APP.D.h(w,$APP.B(u)-1)&&$APP.p(e);$APP.D.h(w,f)&&r.appendChild(Pn(d));w>0&&!$APP.D.h(w,f)&&r.appendChild(On(d));$APP.D.h(w,f)&&r.appendChild(On(d));$APP.n(z)&&r.appendChild(Qn(z,A));k+=1}else if(m=$APP.v(m))$APP.yc(m)?(q=$APP.ob(m),m=$APP.pb(m),h=q,q=$APP.B(q)):(q=$APP.x(m),h=$APP.H(q,0,null),q=$APP.H(q,1,null),q=$APP.H(c,q,null),k=$APP.D.h(h,$APP.B(u)-1)&&$APP.p(e),$APP.D.h(h,f)&&r.appendChild(Pn(d)),
|
|
10
|
+
h>0&&!$APP.D.h(h,f)&&r.appendChild(On(d)),$APP.D.h(h,f)&&r.appendChild(On(d)),$APP.n(q)&&r.appendChild(Qn(q,k)),m=$APP.y(m),h=null,q=0),k=0;else break;$APP.D.h(f,$APP.B(u))&&r.appendChild(Pn(d));a.__xBreadcrumbsModel=b;return null},ho=function(a){function b(){return go(a)}var c=Nn(a);c=$APP.M(c);c=$APP.I(c,$APP.Qh);$APP.n(c)&&c.addEventListener("slotchange",b);$APP.ma(a,"__xBreadcrumbsHandlers",{slot:b})},io=function(a){var b=$APP.l(a,"__xBreadcrumbsHandlers");if($APP.n(b)){var c=$APP.l(a,"__xBreadcrumbsRefs");
|
|
11
|
+
$APP.n(c)&&(c=$APP.Qh.g(c),b=$APP.l(b,"slot"),$APP.n($APP.n(c)?b:c)&&c.removeEventListener("slotchange",b))}a.__xBreadcrumbsHandlers=null},jo=function(a,b){Object.defineProperty(a,b,{get:function(){return this.getAttribute(b)},set:function(c){return $APP.n(c)?this.setAttribute(b,""+$APP.S.g(c)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},ko=function(a,b,c){Object.defineProperty(a,b,{get:function(){var d=this.getAttribute(b);return $APP.n(d)?d:c},set:function(d){return $APP.n(d)?this.setAttribute(b,
|
|
12
|
+
""+$APP.S.g(d)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},lo=function(a,b){Object.defineProperty(a,b,{get:function(){return this.hasAttribute(b)},set:function(c){return $APP.n(c)?this.setAttribute(b,""):this.removeAttribute(b)},enumerable:!0,configurable:!0})},mo=function(a,b,c){Object.defineProperty(a,b,{get:function(){return Mn(this.getAttribute(b),c)},set:function(d){return d!=null?this.setAttribute(b,""+$APP.S.g(d)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},no=
|
|
13
|
+
function(a){ko(a,"separator","/");ko(a,"size","md");ko(a,"variant","default");lo(a,"wrap");lo(a,"disabled");lo(a,"preserve-aria-current");mo(a,"max-items",null);mo(a,"items-before",1);mo(a,"items-after",2);jo(a,"aria-label");jo(a,"aria-describedby")},po=function(){var a=class extends HTMLElement{};a.observedAttributes=oo;a.prototype.connectedCallback=function(){Nn(this);io(this);ho(this);go(this);return null};a.prototype.disconnectedCallback=function(){io(this);return null};a.prototype.attributeChangedCallback=
|
|
14
|
+
function(b,c,d){$APP.N(c,d)&&go(this);return null};no(a.prototype);return a},qo=function(){$APP.n(customElements.get("x-breadcrumbs"))||customElements.define("x-breadcrumbs",po());return null},Rn=new $APP.K(null,"max-items-raw","max-items-raw",-340487390),Zn=new $APP.K(null,"items-after","items-after",358736705),$n=new $APP.K(null,"wrap","wrap",851669987),Sn=new $APP.K(null,"wrap-raw","wrap-raw",-1468030804),ao=new $APP.K(null,"max-items","max-items",-1969244147),Wn=new $APP.K(null,"separator-raw",
|
|
15
|
+
"separator-raw",1358337914),eo=new $APP.K(null,"ellipsis-at","ellipsis-at",-628372349),Un=new $APP.K(null,"preserve-aria-current-present?","preserve-aria-current-present?",729931506),Vn=new $APP.K(null,"items-before-raw","items-before-raw",1580997624),Tn=new $APP.K(null,"items-after-raw","items-after-raw",-1677187220),bo=new $APP.K(null,"items-before","items-before",-1151895719),Yn=new $APP.K(null,"preserve-aria-current","preserve-aria-current",682773185),fo=new $APP.K(null,"total","total",1916810418);var oo="separator size variant wrap max-items items-before items-after disabled preserve-aria-current aria-label aria-describedby".split(" "),co=new $APP.R(null,new $APP.P(null,3,["md",null,"lg",null,"sm",null],null),null),Xn=new $APP.R(null,new $APP.P(null,3,["subtle",null,"text",null,"default",null],null),null);$APP.ka("app.exports.x_breadcrumbs.init",qo);export const init=qo;
|
package/dist/x-button.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var Eu=function(a,b,c){return typeof a==="string"&&$APP.Cc(b,a)?a:c},Fu=function(a){var b=$APP.M(a);a=$APP.I(b,$APP.yi);b=$APP.I(b,$APP.Hh);return $APP.p($APP.n(a)?a:b)},Gu=function(a){return a.__xButtonState},Hu=function(a){return $APP.D.h(!0,a.__xButtonHover)},Iu=function(a,b){a.__xButtonHover=$APP.J(b)},Ju=function(a,b){a.__xButtonFocusVisible=$APP.J(b)},Ku=function(a){return a.__xButtonActiveSource},Lu=function(a,b){a.__xButtonActiveSource=b},Mu=function(a,b){return a.__xButtonLastActivationSource=
|
|
3
|
+
b},Ru=function(a){a=new $APP.P(null,7,[$APP.yi,a.hasAttribute("disabled"),$APP.Hh,a.hasAttribute("loading"),Nu,a.hasAttribute("pressed"),$APP.Z,a.getAttribute("type"),$APP.Wg,a.getAttribute("variant"),$APP.Ag,a.getAttribute("size"),$APP.W,a.getAttribute("label")],null);var b=$APP.M(a);a=$APP.I(b,$APP.yi);var c=$APP.I(b,$APP.Hh),d=$APP.I(b,Nu),e=$APP.I(b,$APP.Z),f=$APP.I(b,$APP.Wg),h=$APP.I(b,$APP.Ag);b=$APP.I(b,$APP.W);return new $APP.P(null,7,[$APP.yi,$APP.J(a),$APP.Hh,$APP.J(c),Nu,$APP.J(d),$APP.Z,
|
|
4
|
+
Eu(e,Ou,"button"),$APP.Wg,Eu(f,Pu,"primary"),$APP.Ag,Eu(h,Qu,"md"),$APP.W,typeof b==="string"?b:null],null)},Su=function(a,b,c){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:!1}))},Tu=function(a){return a.assignedNodes({flatten:!0})},Uu=function(a){return document.createElement(a)},Wu=function(a,b){var c=b.button,d=b["label-slot"],e=b["icon-start-slot"],f=b["icon-end-slot"],h=b["spinner-slot"];b=Ru(a);var k;a:{d=Tu(d);for(var m=0;;)if(m<d.length){var q=d[m],
|
|
5
|
+
r=q;if(k=$APP.D.h(r.nodeType,Node.TEXT_NODE))k=r.textContent,k=$APP.N("",($APP.n(k)?k:"").trim());if(!k){k=q;if(q=$APP.D.h(k.nodeType,Node.ELEMENT_NODE))q=k.textContent,q=$APP.N("",($APP.n(q)?q:"").trim());k=q}if(k){k=!0;break a}m+=1}else{k=!1;break a}k=void 0}e=Tu(e).length>0;f=Tu(f).length>0;h=Tu(h).length>0;d=Hu(a);m=Ku(a)!=null;q=$APP.D.h(!0,a.__xButtonFocusVisible);k=$APP.jg.m(b,Vu,k);r=$APP.M(k);k=$APP.I(r,$APP.W);r=$APP.I(r,Vu);k=$APP.p(r)&&typeof k==="string"&&$APP.N("",k)?k:null;c.setAttribute("type",
|
|
6
|
+
$APP.Z.g(b));r=$APP.yi.g(b);r=$APP.n(r)?r:$APP.Hh.g(b);c.disabled=r;r=$APP.M(b);r=$APP.I(r,$APP.Hh);r=$APP.n(r)?"true":null;$APP.n(r)?c.setAttribute("aria-busy",r):c.removeAttribute("aria-busy");$APP.n(Nu.g(b))?c.setAttribute("aria-pressed","true"):c.removeAttribute("aria-pressed");$APP.n(k)?c.setAttribute("aria-label",k):c.removeAttribute("aria-label");c.setAttribute("data-variant",$APP.Wg.g(b));c.setAttribute("data-size",$APP.Ag.g(b));c.setAttribute("data-loading",$APP.n($APP.Hh.g(b))?"true":"false");
|
|
7
|
+
c.setAttribute("data-disabled",$APP.n($APP.yi.g(b))?"true":"false");c.setAttribute("data-hover",d?"true":"false");c.setAttribute("data-active",m?"true":"false");c.setAttribute("data-focus-visible",q?"true":"false");c.setAttribute("data-has-icon-start",e?"true":"false");c.setAttribute("data-has-icon-end",f?"true":"false");c.setAttribute("data-has-spinner",h?"true":"false");a.setAttribute("data-variant",$APP.Wg.g(b));return a.setAttribute("data-size",$APP.Ag.g(b))},Xu=function(a){var b=Ku(a);return $APP.n(b)?
|
|
8
|
+
(Lu(a,null),Su(a,"press-end",{source:b}),b=Gu(a),$APP.n(b)?Wu(a,b):null):null},Yu=function(a){Fu(Ru(a))||(Iu(a,!1),Lu(a,null))},Zu=function(a,b){b.addEventListener("pointerenter",function(){if(Fu(Ru(a))){if(Hu(a))return null;Iu(a,!0);Wu(a,Gu(a));return Su(a,"hover-start",{})}return null});b.addEventListener("pointerleave",function(){Hu(a)&&(Iu(a,!1),Wu(a,Gu(a)),Fu(Ru(a))&&Su(a,"hover-end",{}));return $APP.D.h("pointer",Ku(a))?Xu(a):null})},$u=function(a,b){b.addEventListener("pointerdown",function(){if(Fu(Ru(a))){if($APP.n(Ku(a)))return null;
|
|
9
|
+
Mu(a,"pointer");Lu(a,"pointer");Wu(a,Gu(a));return Su(a,"press-start",{source:"pointer"})}return null});b.addEventListener("pointerup",function(){return $APP.D.h("pointer",Ku(a))?Xu(a):null});b.addEventListener("pointercancel",function(){return $APP.D.h("pointer",Ku(a))?Xu(a):null});b.addEventListener("keydown",function(c){c=c.key;if(Fu(Ru(a))&&($APP.D.h(c,"Enter")||$APP.D.h(c," "))){if($APP.D.h("keyboard",Ku(a)))return null;Mu(a,"keyboard");Lu(a,"keyboard");Wu(a,Gu(a));return Su(a,"press-start",
|
|
10
|
+
{source:"keyboard"})}return null});b.addEventListener("keyup",function(c){c=c.key;return $APP.D.h("keyboard",Ku(a))&&($APP.D.h(c,"Enter")||$APP.D.h(c," "))?Xu(a):null});b.addEventListener("blur",function(){return $APP.n(Ku(a))?Xu(a):null});b.addEventListener("click",function(){if(Fu(Ru(a))){var c=a.__xButtonLastActivationSource;Su(a,"press",{source:$APP.n(c)?c:"programmatic"});return Mu(a,null)}return null})},av=function(a,b){b.addEventListener("focus",function(){var c=b.matches(":focus-visible");
|
|
11
|
+
Ju(a,c);Wu(a,Gu(a));return $APP.n(c)?Su(a,"focus-visible",{}):null});b.addEventListener("blur",function(){Ju(a,!1);return Wu(a,Gu(a))})},bv=function(a,b){function c(){return Wu(a,b)}b["label-slot"].addEventListener("slotchange",c);b["icon-start-slot"].addEventListener("slotchange",c);b["icon-end-slot"].addEventListener("slotchange",c);b["spinner-slot"].addEventListener("slotchange",c)},cv=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},
|
|
12
|
+
set:function(d){return $APP.n($APP.J(d))?this.setAttribute(c,""):this.removeAttribute(c)}})},dv=function(){function a(){return Reflect.construct(HTMLElement,[],$APP.Ra(b))}var b=new $APP.Dd;$APP.Ed(b,a);return a},fv=function(){if($APP.n(customElements.get("x-button")))return null;var a=Object.create(HTMLElement.prototype),b=dv();Object.setPrototypeOf(b,HTMLElement);a.constructor=b;cv(a,"disabled","disabled");cv(a,"loading","loading");cv(a,"pressed","pressed");a.connectedCallback=function(){if(!$APP.n(Gu(this))){var c=
|
|
13
|
+
this.attachShadow({mode:"open"});var d=Uu("style"),e=Uu("button"),f=Uu("span"),h=Uu("span"),k=Uu("span"),m=Uu("span"),q=Uu("span"),r=Uu("span"),u=Uu("slot"),w=Uu("slot"),z=Uu("slot"),A=Uu("slot");d.textContent=":host{display:inline-block;vertical-align:middle;color-scheme:light dark;--x-button-radius:0.75rem;--x-button-gap:0.5rem;--x-button-padding-inline:0.95rem;--x-button-height-sm:2rem;--x-button-height-md:2.5rem;--x-button-height-lg:3rem;--x-button-font-size-sm:0.875rem;--x-button-font-size-md:0.9375rem;--x-button-font-size-lg:1rem;--x-button-font-weight:600;--x-button-icon-size-sm:0.875rem;--x-button-icon-size-md:1rem;--x-button-icon-size-lg:1.125rem;--x-button-spinner-size:1em;--x-button-spinner-stroke:2px;--x-button-shadow:0 1px 2px rgba(15,23,42,0.08),0 1px 1px rgba(15,23,42,0.04);--x-button-shadow-hover:0 4px 10px rgba(15,23,42,0.10),0 2px 4px rgba(15,23,42,0.06);--x-button-shadow-active:0 1px 2px rgba(15,23,42,0.08);--x-button-bg:#2563eb;--x-button-bg-hover:#1d4ed8;--x-button-bg-active:#1e40af;--x-button-bg-disabled:#cbd5e1;--x-button-fg:#ffffff;--x-button-fg-disabled:#ffffff;--x-button-border:transparent;--x-button-border-hover:transparent;--x-button-border-active:transparent;--x-button-secondary-bg:#ffffff;--x-button-secondary-bg-hover:#f8fafc;--x-button-secondary-bg-active:#f1f5f9;--x-button-secondary-fg:#0f172a;--x-button-secondary-border:#cbd5e1;--x-button-tertiary-bg:#f1f5f9;--x-button-tertiary-bg-hover:#e2e8f0;--x-button-tertiary-bg-active:#cbd5e1;--x-button-tertiary-fg:#0f172a;--x-button-ghost-bg:transparent;--x-button-ghost-bg-hover:#f8fafc;--x-button-ghost-bg-active:#f1f5f9;--x-button-ghost-fg:#334155;--x-button-danger-bg:#dc2626;--x-button-danger-bg-hover:#b91c1c;--x-button-danger-bg-active:#991b1b;--x-button-danger-fg:#ffffff;--x-button-focus-ring:#60a5fa;--x-button-transition-duration:140ms;--x-button-transition-easing:cubic-bezier(0.2,0,0,1);}@media (prefers-color-scheme: dark){:host{--x-button-shadow:0 1px 2px rgba(0,0,0,0.35),0 1px 1px rgba(0,0,0,0.2);--x-button-shadow-hover:0 6px 14px rgba(0,0,0,0.35),0 2px 6px rgba(0,0,0,0.24);--x-button-shadow-active:0 1px 2px rgba(0,0,0,0.3);--x-button-bg:#3b82f6;--x-button-bg-hover:#2563eb;--x-button-bg-active:#1d4ed8;--x-button-bg-disabled:#334155;--x-button-fg:#eff6ff;--x-button-fg-disabled:#94a3b8;--x-button-secondary-bg:#111827;--x-button-secondary-bg-hover:#1f2937;--x-button-secondary-bg-active:#273449;--x-button-secondary-fg:#e5e7eb;--x-button-secondary-border:#374151;--x-button-tertiary-bg:#1e293b;--x-button-tertiary-bg-hover:#273449;--x-button-tertiary-bg-active:#334155;--x-button-tertiary-fg:#e5e7eb;--x-button-ghost-bg:transparent;--x-button-ghost-bg-hover:#0f172a;--x-button-ghost-bg-active:#172033;--x-button-ghost-fg:#cbd5e1;--x-button-danger-bg:#ef4444;--x-button-danger-bg-hover:#dc2626;--x-button-danger-bg-active:#b91c1c;--x-button-danger-fg:#ffffff;--x-button-focus-ring:#93c5fd;}}@keyframes x-button-spin{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}button{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;inline-size:100%;min-inline-size:0;min-block-size:var(--x-button-height-md);padding-inline:var(--x-button-padding-inline);border-radius:var(--x-button-radius);border:1px solid var(--x-button-border);background:var(--x-button-bg);color:var(--x-button-fg);font-size:var(--x-button-font-size-md);font-weight:var(--x-button-font-weight);line-height:1;cursor:pointer;user-select:none;box-shadow:var(--x-button-shadow);transition:background var(--x-button-transition-duration) var(--x-button-transition-easing),border-color var(--x-button-transition-duration) var(--x-button-transition-easing),color var(--x-button-transition-duration) var(--x-button-transition-easing),transform var(--x-button-transition-duration) var(--x-button-transition-easing),box-shadow var(--x-button-transition-duration) var(--x-button-transition-easing),opacity var(--x-button-transition-duration) var(--x-button-transition-easing);}button[disabled]{cursor:default;box-shadow:none;}button:focus-visible{outline:none;box-shadow:0 0 0 3px var(--x-button-focus-ring),var(--x-button-shadow);}button[data-size\x3d'sm']{min-block-size:var(--x-button-height-sm);font-size:var(--x-button-font-size-sm);}button[data-size\x3d'md']{min-block-size:var(--x-button-height-md);font-size:var(--x-button-font-size-md);}button[data-size\x3d'lg']{min-block-size:var(--x-button-height-lg);font-size:var(--x-button-font-size-lg);}button[data-variant\x3d'primary']{background:var(--x-button-bg);color:var(--x-button-fg);border-color:var(--x-button-border);}button[data-variant\x3d'primary'][data-hover\x3d'true']:not([disabled]){background:var(--x-button-bg-hover);box-shadow:var(--x-button-shadow-hover);}button[data-variant\x3d'primary'][data-active\x3d'true']:not([disabled]){background:var(--x-button-bg-active);transform:translateY(1px);box-shadow:var(--x-button-shadow-active);}button[data-variant\x3d'secondary']{background:var(--x-button-secondary-bg);color:var(--x-button-secondary-fg);border-color:var(--x-button-secondary-border);}button[data-variant\x3d'secondary'][data-hover\x3d'true']:not([disabled]){background:var(--x-button-secondary-bg-hover);border-color:var(--x-button-secondary-border);box-shadow:var(--x-button-shadow-hover);}button[data-variant\x3d'secondary'][data-active\x3d'true']:not([disabled]){background:var(--x-button-secondary-bg-active);transform:translateY(1px);box-shadow:var(--x-button-shadow-active);}button[data-variant\x3d'tertiary']{background:var(--x-button-tertiary-bg);color:var(--x-button-tertiary-fg);border-color:transparent;box-shadow:none;}button[data-variant\x3d'tertiary'][data-hover\x3d'true']:not([disabled]){background:var(--x-button-tertiary-bg-hover);}button[data-variant\x3d'tertiary'][data-active\x3d'true']:not([disabled]){background:var(--x-button-tertiary-bg-active);transform:translateY(1px);}button[data-variant\x3d'ghost']{background:var(--x-button-ghost-bg);color:var(--x-button-ghost-fg);border-color:transparent;box-shadow:none;}button[data-variant\x3d'ghost'][data-hover\x3d'true']:not([disabled]){background:var(--x-button-ghost-bg-hover);}button[data-variant\x3d'ghost'][data-active\x3d'true']:not([disabled]){background:var(--x-button-ghost-bg-active);transform:translateY(1px);}button[data-variant\x3d'danger']{background:var(--x-button-danger-bg);color:var(--x-button-danger-fg);border-color:transparent;}button[data-variant\x3d'danger'][data-hover\x3d'true']:not([disabled]){background:var(--x-button-danger-bg-hover);box-shadow:var(--x-button-shadow-hover);}button[data-variant\x3d'danger'][data-active\x3d'true']:not([disabled]){background:var(--x-button-danger-bg-active);transform:translateY(1px);box-shadow:var(--x-button-shadow-active);}button[data-loading\x3d'true']{cursor:progress;}button[data-disabled\x3d'true']{background:var(--x-button-bg-disabled);color:var(--x-button-fg-disabled);border-color:transparent;opacity:0.72;}[part\x3d'inner']{display:inline-flex;align-items:center;justify-content:center;gap:var(--x-button-gap);min-inline-size:0;}[part\x3d'label']{display:inline-flex;align-items:center;justify-content:center;min-inline-size:0;white-space:nowrap;}[part\x3d'icon-start'],[part\x3d'icon-end'],[part\x3d'spinner']{display:inline-flex;align-items:center;justify-content:center;flex:none;}button[data-size\x3d'sm'] [part\x3d'icon-start'],button[data-size\x3d'sm'] [part\x3d'icon-end']{inline-size:var(--x-button-icon-size-sm);block-size:var(--x-button-icon-size-sm);}button[data-size\x3d'md'] [part\x3d'icon-start'],button[data-size\x3d'md'] [part\x3d'icon-end']{inline-size:var(--x-button-icon-size-md);block-size:var(--x-button-icon-size-md);}button[data-size\x3d'lg'] [part\x3d'icon-start'],button[data-size\x3d'lg'] [part\x3d'icon-end']{inline-size:var(--x-button-icon-size-lg);block-size:var(--x-button-icon-size-lg);}[part\x3d'spinner']{inline-size:var(--x-button-spinner-size);block-size:var(--x-button-spinner-size);position:relative;}[part\x3d'spinner-slot']{display:inline-flex;align-items:center;justify-content:center;}[part\x3d'spinner-fallback']{display:none;inline-size:100%;block-size:100%;box-sizing:border-box;border-radius:999px;border:var(--x-button-spinner-stroke) solid currentColor;border-inline-end-color:transparent;animation:x-button-spin 0.7s linear infinite;opacity:0.9;}button[data-has-icon-start\x3d'false'] [part\x3d'icon-start']{display:none;}button[data-has-icon-end\x3d'false'] [part\x3d'icon-end']{display:none;}button[data-loading\x3d'false'] [part\x3d'spinner']{display:none;}button[data-loading\x3d'true'][data-has-spinner\x3d'false'] [part\x3d'spinner-fallback']{display:inline-block;}button[data-loading\x3d'true'][data-has-spinner\x3d'true'] [part\x3d'spinner-fallback']{display:none;}@media (prefers-reduced-motion: reduce){button{transition:none;}[part\x3d'spinner-fallback']{animation:none;}}";
|
|
14
|
+
e.setAttribute("part","button");f.setAttribute("part","inner");h.setAttribute("part","icon-start");k.setAttribute("part","label");m.setAttribute("part","spinner");A.setAttribute("part","spinner-slot");q.setAttribute("part","spinner-fallback");r.setAttribute("part","icon-end");w.setAttribute("name","icon-start");z.setAttribute("name","icon-end");A.setAttribute("name","spinner");m.setAttribute("aria-hidden","true");q.setAttribute("aria-hidden","true");h.appendChild(w);k.appendChild(u);m.appendChild(A);
|
|
15
|
+
m.appendChild(q);r.appendChild(z);f.appendChild(h);f.appendChild(k);f.appendChild(m);f.appendChild(r);e.appendChild(f);c.appendChild(d);c.appendChild(e);c={root:c,style:d,button:e,inner:f,"label-slot":u,"icon-start-slot":w,"icon-end-slot":z,"spinner-slot":A};d=c.button;Iu(this,!1);Ju(this,!1);Lu(this,null);Mu(this,null);Zu(this,d);$u(this,d);av(this,d);bv(this,c);this.__xButtonState=c}Yu(this);return Wu(this,Gu(this))};a.disconnectedCallback=function(){Iu(this,!1);Ju(this,!1);Lu(this,null);return Mu(this,
|
|
16
|
+
null)};a.attributeChangedCallback=function(){var c=Gu(this);$APP.n(c)?(Yu(this),c=Wu(this,c)):c=null;return c};b.observedAttributes=ev;b.prototype=a;return customElements.define("x-button",b)},gv=function(){return fv()},Nu=new $APP.K(null,"pressed","pressed",1100937946),Vu=new $APP.K(null,"has-default-text?","has-default-text?",2021837624);var Ou=new $APP.R(null,new $APP.P(null,3,["reset",null,"submit",null,"button",null],null),null),Pu=new $APP.R(null,new $APP.P(null,5,["secondary",null,"tertiary",null,"primary",null,"danger",null,"ghost",null],null),null),Qu=new $APP.R(null,new $APP.P(null,3,["md",null,"lg",null,"sm",null],null),null),ev="disabled loading pressed type variant size label".split(" ");
|
|
17
|
+
$APP.wd(["press",new $APP.P(null,1,[$APP.Y,new $APP.P(null,1,[$APP.Ch,$APP.X],null)],null),"press-start",new $APP.P(null,1,[$APP.Y,new $APP.P(null,1,[$APP.Ch,$APP.X],null)],null),"press-end",new $APP.P(null,1,[$APP.Y,new $APP.P(null,1,[$APP.Ch,$APP.X],null)],null),"hover-start",new $APP.P(null,1,[$APP.Y,$APP.xd],null),"hover-end",new $APP.P(null,1,[$APP.Y,$APP.xd],null),"focus-visible",new $APP.P(null,1,[$APP.Y,$APP.xd],null)]);$APP.ka("app.exports.x_button.init",gv);export const init=gv;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var gr=function(a){var b=$APP.M(a);a=$APP.I(b,$APP.rh);var c=$APP.I(b,$APP.$h),d=$APP.I(b,Yq),e=$APP.I(b,Zq),f=$APP.I(b,$q),h=$APP.I(b,ar),k=$APP.I(b,br);b=$APP.I(b,$APP.Jg);return new $APP.P(null,8,[$APP.Pi,$APP.J(a),$APP.U,$APP.J(c),cr,function(){var m;if(m=typeof d==="string")m=(m=$APP.N(d,""))?d:m;return $APP.n(m)?m:"Discard changes?"}(),$APP.Lg,typeof e==="string"&&$APP.N(e,"")?e:null,dr,function(){var m;if(m=typeof f==="string")m=(m=$APP.N(f,""))?f:m;return $APP.n(m)?m:"Discard"}(),er,function(){var m;
|
|
3
|
+
if(m=typeof h==="string")m=(m=$APP.N(h,""))?h:m;return $APP.n(m)?m:"Keep editing"}(),fr,$APP.J(k),$APP.Th,typeof b==="string"&&$APP.N(b.trim(),"")?b.trim():null],null)},hr=function(a){return document.createElement(a)},jr=function(a){var b=$APP.l(a,"__xCancelDialogueRefs");if($APP.n(b))return b;b=$APP.l(ir,"n")+1;ir.n=b;b="x-cd-headline-"+$APP.S.g(b);var c=a.attachShadow({mode:"open"}),d=hr("style"),e=hr("div"),f=hr("div"),h=hr("div"),k=hr("div"),m=hr("h2"),q=hr("div"),r=hr("slot"),u=hr("p"),w=hr("div"),
|
|
4
|
+
z=hr("button"),A=hr("button");d.textContent=":host{display:contents;color-scheme:light dark;--x-cancel-dialogue-z-base:1000;--x-cancel-dialogue-backdrop-bg:rgba(0,0,0,0.45);--x-cancel-dialogue-bg:#ffffff;--x-cancel-dialogue-fg:#0f172a;--x-cancel-dialogue-radius:12px;--x-cancel-dialogue-shadow:0 20px 60px rgba(0,0,0,0.20),0 4px 12px rgba(0,0,0,0.10);--x-cancel-dialogue-padding:24px;--x-cancel-dialogue-min-width:320px;--x-cancel-dialogue-max-width:480px;--x-cancel-dialogue-headline-size:1.125rem;--x-cancel-dialogue-headline-weight:700;--x-cancel-dialogue-message-size:0.9375rem;--x-cancel-dialogue-cancel-bg:#f1f5f9;--x-cancel-dialogue-cancel-fg:#0f172a;--x-cancel-dialogue-cancel-bg-hover:#e2e8f0;--x-cancel-dialogue-confirm-bg:#2563eb;--x-cancel-dialogue-confirm-fg:#ffffff;--x-cancel-dialogue-confirm-bg-hover:#1d4ed8;--x-cancel-dialogue-danger-bg:#dc2626;--x-cancel-dialogue-danger-fg:#ffffff;--x-cancel-dialogue-danger-bg-hover:#b91c1c;--x-cancel-dialogue-btn-radius:8px;--x-cancel-dialogue-btn-height:2.5rem;--x-cancel-dialogue-btn-font-size:0.9375rem;--x-cancel-dialogue-btn-font-weight:600;--x-cancel-dialogue-focus-ring:#60a5fa;--x-cancel-dialogue-enter-duration:0ms;--x-cancel-dialogue-exit-duration:0ms;}@media (prefers-color-scheme:dark){:host{--x-cancel-dialogue-bg:#1e293b;--x-cancel-dialogue-fg:#f1f5f9;--x-cancel-dialogue-backdrop-bg:rgba(0,0,0,0.60);--x-cancel-dialogue-shadow:0 20px 60px rgba(0,0,0,0.55),0 4px 12px rgba(0,0,0,0.30);--x-cancel-dialogue-cancel-bg:#334155;--x-cancel-dialogue-cancel-fg:#f1f5f9;--x-cancel-dialogue-cancel-bg-hover:#475569;--x-cancel-dialogue-confirm-bg:#3b82f6;--x-cancel-dialogue-confirm-bg-hover:#2563eb;--x-cancel-dialogue-focus-ring:#93c5fd;}}[part\x3dbackdrop]{display:none;position:fixed;inset:0;background:var(--x-cancel-dialogue-backdrop-bg);z-index:var(--x-cancel-dialogue-z-base,1000);}[part\x3ddialog]{display:none;position:fixed;inset:0;align-items:center;justify-content:center;z-index:calc(var(--x-cancel-dialogue-z-base,1000) + 1);padding:16px;box-sizing:border-box;}:host([open]) [part\x3dbackdrop]{display:block;}:host([open]) [part\x3ddialog]{display:flex;}[part\x3dpanel]{background:var(--x-cancel-dialogue-bg);color:var(--x-cancel-dialogue-fg);border-radius:var(--x-cancel-dialogue-radius);box-shadow:var(--x-cancel-dialogue-shadow);padding:var(--x-cancel-dialogue-padding);min-width:var(--x-cancel-dialogue-min-width);max-width:var(--x-cancel-dialogue-max-width);width:100%;box-sizing:border-box;display:flex;flex-direction:column;gap:16px;}[part\x3dheader]{display:flex;align-items:flex-start;}[part\x3dheadline]{margin:0;font-size:var(--x-cancel-dialogue-headline-size);font-weight:var(--x-cancel-dialogue-headline-weight);line-height:1.3;}[part\x3dbody]{display:flex;flex-direction:column;gap:8px;}[part\x3dmessage]{font-size:var(--x-cancel-dialogue-message-size);line-height:1.5;margin:0;opacity:0.8;}[part\x3dactions]{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap;}[part\x3dcancel-btn],[part\x3dconfirm-btn]{all:unset;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;padding:0 20px;min-height:var(--x-cancel-dialogue-btn-height);border-radius:var(--x-cancel-dialogue-btn-radius);font-size:var(--x-cancel-dialogue-btn-font-size);font-weight:var(--x-cancel-dialogue-btn-font-weight);cursor:pointer;user-select:none;white-space:nowrap;}[part\x3dcancel-btn]{background:var(--x-cancel-dialogue-cancel-bg);color:var(--x-cancel-dialogue-cancel-fg);}[part\x3dcancel-btn]:hover:not(:disabled){background:var(--x-cancel-dialogue-cancel-bg-hover);}[part\x3dconfirm-btn]{background:var(--x-cancel-dialogue-confirm-bg);color:var(--x-cancel-dialogue-confirm-fg);}[part\x3dconfirm-btn]:hover:not(:disabled){background:var(--x-cancel-dialogue-confirm-bg-hover);}[part\x3dconfirm-btn][data-danger]{background:var(--x-cancel-dialogue-danger-bg);color:var(--x-cancel-dialogue-danger-fg);}[part\x3dconfirm-btn][data-danger]:hover:not(:disabled){background:var(--x-cancel-dialogue-danger-bg-hover);}[part\x3dcancel-btn]:focus-visible,[part\x3dconfirm-btn]:focus-visible{outline:2px solid var(--x-cancel-dialogue-focus-ring);outline-offset:2px;}:host([disabled]) [part\x3dcancel-btn],:host([disabled]) [part\x3dconfirm-btn]{opacity:0.55;pointer-events:none;cursor:default;}@media (prefers-reduced-motion:reduce){[part\x3dbackdrop],[part\x3ddialog],[part\x3dpanel]{transition:none;animation:none;}}";
|
|
5
|
+
e.setAttribute("part","backdrop");f.setAttribute("part","dialog");f.setAttribute("role","dialog");f.setAttribute("aria-modal","true");f.setAttribute("aria-labelledby",b);h.setAttribute("part","panel");k.setAttribute("part","header");m.setAttribute("part","headline");m.setAttribute("id",b);q.setAttribute("part","body");r.setAttribute("name","body");u.setAttribute("part","message");w.setAttribute("part","actions");z.setAttribute("part","cancel-btn");z.setAttribute("type","button");A.setAttribute("part",
|
|
6
|
+
"confirm-btn");A.setAttribute("type","button");k.appendChild(m);q.appendChild(r);q.appendChild(u);w.appendChild(z);w.appendChild(A);h.appendChild(k);h.appendChild(q);h.appendChild(w);f.appendChild(h);c.appendChild(d);c.appendChild(e);c.appendChild(f);a.__xCancelDialogueRefs={headline:m,confirmBtn:A,panel:h,bodySlot:r,root:c,dialog:f,backdrop:e,cancelBtn:z,message:u};return $APP.l(a,"__xCancelDialogueRefs")},kr=function(a,b,c,d){b=new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:d});a.dispatchEvent(b);
|
|
7
|
+
return b},lr=function(a){$APP.n(a.hasAttribute("open"))||a.setAttribute("open","");a=jr(a);var b=$APP.l(a,"confirmBtn");setTimeout(function(){return b.focus()},0);return null},mr=function(a){a.removeAttribute("open");return null},nr=function(a,b){$APP.n(a.hasAttribute("disabled"))||(b=kr(a,"x-cancel-dialogue-cancel-request",{reason:b},!0),$APP.n(b.defaultPrevented)||(mr(a),kr(a,"x-cancel-dialogue-cancel",{},!1)));return null},or=function(a){if(!$APP.n(a.hasAttribute("disabled"))){var b=kr(a,"x-cancel-dialogue-confirm-request",
|
|
8
|
+
{},!0);$APP.n(b.defaultPrevented)||(mr(a),kr(a,"x-cancel-dialogue-confirm",{},!1))}return null},pr=function(a){var b=jr(a),c=$APP.l(b,"headline"),d=$APP.l(b,"message"),e=$APP.l(b,"cancelBtn"),f=$APP.l(b,"confirmBtn");a=gr(new $APP.P(null,8,[$APP.rh,a.hasAttribute("open"),$APP.$h,a.hasAttribute("disabled"),Yq,a.getAttribute("headline"),Zq,a.getAttribute("message"),$q,a.getAttribute("confirm-text"),ar,a.getAttribute("cancel-text"),br,a.hasAttribute("danger"),$APP.Jg,a.getAttribute("portal")],null));
|
|
9
|
+
c.textContent=cr.g(a);e.textContent=er.g(a);f.textContent=dr.g(a);$APP.n($APP.Lg.g(a))?(d.textContent=$APP.Lg.g(a),d.style.display="block"):(d.textContent="",d.style.display="none");$APP.n(fr.g(a))?f.setAttribute("data-danger",""):f.removeAttribute("data-danger");e.disabled=$APP.J($APP.U.g(a));f.disabled=$APP.J($APP.U.g(a));$APP.l(b,"dialog").setAttribute("aria-modal","true")},qr=function(a){function b(q){var r=q.key;if($APP.D.h(r,"Escape"))q.preventDefault(),nr(a,"escape");else if($APP.D.h(r,"Tab")){var u=
|
|
10
|
+
jr(a);r=$APP.l(u,"cancelBtn");u=$APP.l(u,"confirmBtn");var w=q.shiftKey,z=a.shadowRoot.activeElement;$APP.n($APP.n(w)?$APP.D.h(z,r):w)?(q.preventDefault(),u.focus()):$APP.p(w)&&$APP.D.h(z,u)&&(q.preventDefault(),r.focus())}return null}function c(){return or(a)}function d(){return nr(a,"cancel-button")}function e(){return nr(a,"backdrop")}var f=jr(a),h=$APP.l(f,"cancelBtn"),k=$APP.l(f,"confirmBtn"),m=$APP.l(f,"dialog");$APP.l(f,"backdrop").addEventListener("click",e);h.addEventListener("click",d);
|
|
11
|
+
k.addEventListener("click",c);m.addEventListener("keydown",b);$APP.ma(a,"__xCancelDialogueHandlers",{backdrop:e,cancel:d,confirm:c,keydown:b})},rr=function(a){var b=$APP.l(a,"__xCancelDialogueHandlers"),c=$APP.l(a,"__xCancelDialogueRefs");if($APP.n($APP.n(b)?c:b)){var d=$APP.l(c,"backdrop"),e=$APP.l(c,"cancelBtn"),f=$APP.l(c,"confirmBtn");c=$APP.l(c,"dialog");var h=$APP.l(b,"backdrop"),k=$APP.l(b,"cancel"),m=$APP.l(b,"confirm");b=$APP.l(b,"keydown");$APP.n(h)&&d.removeEventListener("click",h);$APP.n(k)&&
|
|
12
|
+
e.removeEventListener("click",k);$APP.n(m)&&f.removeEventListener("click",m);$APP.n(b)&&c.removeEventListener("keydown",b)}a.__xCancelDialogueHandlers=null},sr=function(a,b,c,d){if($APP.N(c,d)&&(pr(a),$APP.D.h(b,"open")&&d!=null&&c==null)){a=$APP.l(a,"__xCancelDialogueRefs");var e=$APP.n(a)?$APP.l(a,"confirmBtn"):null;$APP.n(e)&&setTimeout(function(){return e.focus()},0)}return null},tr=function(a){Object.defineProperty(a,"open",{get:function(){return this.hasAttribute("open")},set:function(r){return $APP.n(r)?
|
|
13
|
+
lr(this):mr(this)},enumerable:!0,configurable:!0});for(var b=$APP.v(new $APP.O(null,2,5,$APP.Xd,[new $APP.O(null,2,5,$APP.Xd,["disabled","disabled"],null),new $APP.O(null,2,5,$APP.Xd,["danger","danger"],null)],null)),c=null,d=0,e=0;;)if(e<d){var f=c.F(null,e),h=$APP.H(f,0,null),k=$APP.H(f,1,null);Object.defineProperty(a,h,{get:function(r,u,w,z,A,C,F){return function(){return this.hasAttribute(F)}}(b,c,d,e,f,h,k),set:function(r,u,w,z,A,C,F){return function(E){return $APP.n(E)?this.setAttribute(F,""):
|
|
14
|
+
this.removeAttribute(F)}}(b,c,d,e,f,h,k),enumerable:!0,configurable:!0});e+=1}else if(h=$APP.v(b)){f=h;if($APP.yc(f))b=$APP.ob(f),e=$APP.pb(f),c=b,d=$APP.B(b),b=e;else{k=$APP.x(f);var m=$APP.H(k,0,null),q=$APP.H(k,1,null);Object.defineProperty(a,m,{get:function(r,u,w,z,A,C,F){return function(){return this.hasAttribute(F)}}(b,c,d,e,k,m,q,f,h),set:function(r,u,w,z,A,C,F){return function(E){return $APP.n(E)?this.setAttribute(F,""):this.removeAttribute(F)}}(b,c,d,e,k,m,q,f,h),enumerable:!0,configurable:!0});
|
|
15
|
+
b=$APP.y(f);c=null;d=0}e=0}else break;b=$APP.v(new $APP.O(null,4,5,$APP.Xd,[new $APP.O(null,2,5,$APP.Xd,["headline","headline"],null),new $APP.O(null,2,5,$APP.Xd,["message","message"],null),new $APP.O(null,2,5,$APP.Xd,["confirmText","confirm-text"],null),new $APP.O(null,2,5,$APP.Xd,["cancelText","cancel-text"],null)],null));c=null;for(e=d=0;;)if(e<d)f=c.F(null,e),h=$APP.H(f,0,null),k=$APP.H(f,1,null),Object.defineProperty(a,h,{get:function(r,u,w,z,A,C,F){return function(){return this.getAttribute(F)}}(b,
|
|
16
|
+
c,d,e,f,h,k),set:function(r,u,w,z,A,C,F){return function(E){return E==null?this.removeAttribute(F):this.setAttribute(F,""+$APP.S.g(E))}}(b,c,d,e,f,h,k),enumerable:!0,configurable:!0}),e+=1;else if(h=$APP.v(b))f=h,$APP.yc(f)?(b=$APP.ob(f),e=$APP.pb(f),c=b,d=$APP.B(b),b=e):(k=$APP.x(f),m=$APP.H(k,0,null),q=$APP.H(k,1,null),Object.defineProperty(a,m,{get:function(r,u,w,z,A,C,F){return function(){return this.getAttribute(F)}}(b,c,d,e,k,m,q,f,h),set:function(r,u,w,z,A,C,F){return function(E){return E==
|
|
17
|
+
null?this.removeAttribute(F):this.setAttribute(F,""+$APP.S.g(E))}}(b,c,d,e,k,m,q,f,h),enumerable:!0,configurable:!0}),b=$APP.y(f),c=null,d=0),e=0;else break;Object.defineProperty(a,"close",{value:function(){return mr(this)},enumerable:!0,configurable:!0,writable:!0});Object.defineProperty(a,"confirm",{value:function(){return or(this)},enumerable:!0,configurable:!0,writable:!0});Object.defineProperty(a,"cancel",{value:function(r){return nr(this,$APP.n(r)?r:"cancel-button")},enumerable:!0,configurable:!0,
|
|
18
|
+
writable:!0})},ur=function(){function a(){return Reflect.construct(HTMLElement,[],$APP.Ra(b))}var b=new $APP.Dd;$APP.Ed(b,a);return a},wr=function(){if(!$APP.n(customElements.get("x-cancel-dialogue"))){var a=Object.create(HTMLElement.prototype),b=ur();Object.setPrototypeOf(b,HTMLElement);a.constructor=b;tr(a);a.connectedCallback=function(){jr(this);rr(this);qr(this);pr(this);return null};a.disconnectedCallback=function(){rr(this);return null};a.attributeChangedCallback=function(c,d,e){return sr(this,
|
|
19
|
+
c,d,e)};b.observedAttributes=vr;b.prototype=a;customElements.define("x-cancel-dialogue",b)}return null},xr=function(){return wr()},cr=new $APP.K(null,"headline","headline",-157157727),Yq=new $APP.K(null,"headline-raw","headline-raw",1141142757),fr=new $APP.K(null,"danger?","danger?",181682216),er=new $APP.K(null,"cancel-text","cancel-text",1885137831),ar=new $APP.K(null,"cancel-text-raw","cancel-text-raw",615622099),$q=new $APP.K(null,"confirm-text-raw","confirm-text-raw",-1317418708),br=new $APP.K(null,
|
|
20
|
+
"danger-present?","danger-present?",-439648505),dr=new $APP.K(null,"confirm-text","confirm-text",-1839494031),Zq=new $APP.K(null,"message-raw","message-raw",952235685);var vr="open disabled headline message confirm-text cancel-text danger portal".split(" ");$APP.wd(["x-cancel-dialogue-cancel-request",new $APP.P(null,2,[$APP.wi,!0,$APP.Y,new $APP.P(null,1,[$APP.xh,$APP.X],null)],null),"x-cancel-dialogue-cancel",new $APP.P(null,2,[$APP.wi,!1,$APP.Y,$APP.xd],null),"x-cancel-dialogue-confirm-request",new $APP.P(null,2,[$APP.wi,!0,$APP.Y,$APP.xd],null),"x-cancel-dialogue-confirm",new $APP.P(null,2,[$APP.wi,!1,$APP.Y,$APP.xd],null)]);var ir={n:0};$APP.ka("app.exports.x_cancel_dialogue.init",xr);export const init=xr;
|
package/dist/x-card.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var et=function(a,b,c){return $APP.Cc(b,a)?a:c},kt=function(a){var b=$APP.M(a),c=$APP.I(b,$APP.Wg),d=$APP.I(b,$APP.Ni),e=$APP.I(b,ft),f=$APP.I(b,$APP.Sh);a=$APP.I(b,$APP.yi);b=$APP.I(b,$APP.W);c=et(c,gt,"elevated");d=et(d,ht,"md");e=et(e,it,"lg");f=$APP.J(f);a=$APP.J(a);b=typeof b==="string"&&$APP.N("",b)?b:null;return $APP.bf([$APP.Yg,$APP.Ug,$APP.yi,$APP.Wg,$APP.Sh,ft,$APP.Ni,jt,$APP.bi],[f?"button":null,f&&a?"-1":f?"0":null,a,c,f,e,d,a?"true":null,b])},lt=function(a){return new $APP.P(null,6,[$APP.Wg,
|
|
3
|
+
a.getAttribute("variant"),$APP.Ni,a.getAttribute("padding"),ft,a.getAttribute("radius"),$APP.Sh,a.hasAttribute("interactive"),$APP.yi,a.hasAttribute("disabled"),$APP.W,a.getAttribute("label")],null)},mt=function(a){var b=$APP.Sh.g(a);return $APP.n(b)?$APP.p($APP.yi.g(a)):b},nt=function(a){return a.dispatchEvent(new CustomEvent("press",{detail:{},bubbles:!0,composed:!0}))},ot=function(a,b,c){return c!=null?a.setAttribute(b,c):a.removeAttribute(b)},pt=function(a){var b=kt(lt(a));var c=$APP.l(a,"__x_card_base");
|
|
4
|
+
ot(a,"role",$APP.Yg.g(b));ot(a,"tabindex",$APP.Ug.g(b));ot(a,"aria-label",$APP.bi.g(b));ot(a,"aria-disabled",jt.g(b));c.setAttribute("data-variant",$APP.Wg.g(b));c.setAttribute("data-padding",$APP.Ni.g(b));c.setAttribute("data-radius",ft.g(b));ot(c,"data-interactive",$APP.n($APP.Sh.g(b))?"true":null);return ot(c,"data-disabled",$APP.n($APP.yi.g(b))?"true":null)},qt=function(a,b){var c=kt(lt(a)),d=b.key;if($APP.n(mt(c))){if($APP.D.h(d,"Enter"))return nt(a);if($APP.D.h(d," ")||$APP.D.h(d,"Spacebar"))return b.preventDefault(),
|
|
5
|
+
nt(a)}return null},rt=function(a){a.addEventListener("click",function(){var b=kt(lt(a));return $APP.n(mt(b))?nt(a):null});a.addEventListener("keydown",function(b){return qt(a,b)})},st=function(a){Object.defineProperty(a.prototype,"interactive",{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute("interactive")},set:function(b){return $APP.n(b)?this.setAttribute("interactive",""):this.removeAttribute("interactive")}});Object.defineProperty(a.prototype,"disabled",{configurable:!0,
|
|
6
|
+
enumerable:!0,get:function(){return this.hasAttribute("disabled")},set:function(b){return $APP.n(b)?this.setAttribute("disabled",""):this.removeAttribute("disabled")}})},ut=function(){var a=class extends HTMLElement{};a.observedAttributes=tt;a.prototype.connectedCallback=function(){if($APP.l(this,"__x_card_initialized")!==!0){var b=this.attachShadow({mode:"open"}),c=document.createElement("style");c.textContent="\n :host {\n display: block;\n color-scheme: light dark;\n\n --x-card-background: rgba(255, 255, 255, 0.92);\n --x-card-color: #111827;\n --x-card-border-color: rgba(17, 24, 39, 0.12);\n --x-card-filled-background: rgba(241, 245, 249, 0.96);\n --x-card-ghost-background: transparent;\n --x-card-hover-background: rgba(15, 23, 42, 0.04);\n --x-card-press-background: rgba(15, 23, 42, 0.08);\n --x-card-shadow: 0 10px 24px rgba(15, 23, 42, 0.10);\n --x-card-focus-ring: rgba(59, 130, 246, 0.55);\n --x-card-disabled-opacity: 0.6;\n\n --x-card-padding-none: 0;\n --x-card-padding-sm: 0.5rem;\n --x-card-padding-md: 1rem;\n --x-card-padding-lg: 1.5rem;\n\n --x-card-radius-none: 0;\n --x-card-radius-sm: 0.375rem;\n --x-card-radius-md: 0.75rem;\n --x-card-radius-lg: 1rem;\n --x-card-radius-xl: 1.5rem;\n\n --x-card-transition-duration: 140ms;\n --x-card-transition-timing: ease;\n\n outline: none;\n }\n\n @media (prefers-color-scheme: dark) {\n :host {\n --x-card-background: rgba(15, 23, 42, 0.88);\n --x-card-color: #e5e7eb;\n --x-card-border-color: rgba(148, 163, 184, 0.24);\n --x-card-filled-background: rgba(30, 41, 59, 0.96);\n --x-card-hover-background: rgba(148, 163, 184, 0.10);\n --x-card-press-background: rgba(148, 163, 184, 0.16);\n --x-card-shadow: 0 16px 32px rgba(0, 0, 0, 0.32);\n --x-card-focus-ring: rgba(96, 165, 250, 0.6);\n }\n }\n\n .base {\n box-sizing: border-box;\n display: block;\n min-width: 0;\n background: var(--x-card-background);\n color: var(--x-card-color);\n border: 1px solid transparent;\n border-radius: var(--x-card-radius-lg);\n transition:\n background var(--x-card-transition-duration) var(--x-card-transition-timing),\n box-shadow var(--x-card-transition-duration) var(--x-card-transition-timing),\n border-color var(--x-card-transition-duration) var(--x-card-transition-timing),\n transform var(--x-card-transition-duration) var(--x-card-transition-timing);\n }\n\n .base[data-variant\x3d'elevated'] {\n background: var(--x-card-background);\n box-shadow: var(--x-card-shadow);\n }\n\n .base[data-variant\x3d'outlined'] {\n background: var(--x-card-background);\n border-color: var(--x-card-border-color);\n box-shadow: none;\n }\n\n .base[data-variant\x3d'filled'] {\n background: var(--x-card-filled-background);\n box-shadow: none;\n }\n\n .base[data-variant\x3d'ghost'] {\n background: var(--x-card-ghost-background);\n box-shadow: none;\n }\n\n .base[data-padding\x3d'none'] { padding: var(--x-card-padding-none); }\n .base[data-padding\x3d'sm'] { padding: var(--x-card-padding-sm); }\n .base[data-padding\x3d'md'] { padding: var(--x-card-padding-md); }\n .base[data-padding\x3d'lg'] { padding: var(--x-card-padding-lg); }\n\n .base[data-radius\x3d'none'] { border-radius: var(--x-card-radius-none); }\n .base[data-radius\x3d'sm'] { border-radius: var(--x-card-radius-sm); }\n .base[data-radius\x3d'md'] { border-radius: var(--x-card-radius-md); }\n .base[data-radius\x3d'lg'] { border-radius: var(--x-card-radius-lg); }\n .base[data-radius\x3d'xl'] { border-radius: var(--x-card-radius-xl); }\n\n .base[data-interactive\x3d'true']:not([data-disabled\x3d'true']) {\n cursor: pointer;\n }\n\n .base[data-interactive\x3d'true']:not([data-disabled\x3d'true']):hover {\n background: var(--x-card-hover-background);\n }\n\n .base[data-interactive\x3d'true']:not([data-disabled\x3d'true']):active {\n background: var(--x-card-press-background);\n transform: translateY(1px);\n }\n\n .base[data-disabled\x3d'true'] {\n opacity: var(--x-card-disabled-opacity);\n cursor: default;\n transform: none;\n }\n\n :host(:focus-visible) .base[data-interactive\x3d'true']:not([data-disabled\x3d'true']) {\n box-shadow:\n 0 0 0 3px var(--x-card-focus-ring),\n var(--x-card-shadow);\n }\n\n @media (prefers-reduced-motion: reduce) {\n .base {\n transition: none;\n }\n\n .base[data-interactive\x3d'true']:not([data-disabled\x3d'true']):active {\n transform: none;\n }\n }\n ";
|
|
7
|
+
var d=document.createElement("div");d.setAttribute("part","base");d.className="base";var e=document.createElement("slot");d.appendChild(e);b.appendChild(c);b.appendChild(d);this.__x_card_root=b;this.__x_card_style=c;this.__x_card_base=d;this.__x_card_slot=e;rt(this);this.__x_card_initialized=!0}pt(this);return this};a.prototype.disconnectedCallback=function(){return null};a.prototype.attributeChangedCallback=function(){return $APP.l(this,"__x_card_initialized")===!0?pt(this):null};st(a);return a},
|
|
8
|
+
vt=function(){return $APP.n(customElements.get("x-card"))?null:customElements.define("x-card",ut())},jt=new $APP.K(null,"aria-disabled","aria-disabled",-667357160),ft=new $APP.K(null,"radius","radius",-2073122258);var tt="variant padding radius interactive disabled label".split(" "),gt=new $APP.R(null,new $APP.P(null,4,["outlined",null,"elevated",null,"filled",null,"ghost",null],null),null),ht=new $APP.R(null,new $APP.P(null,4,["none",null,"md",null,"lg",null,"sm",null],null),null),it=new $APP.R(null,new $APP.P(null,5,["none",null,"md",null,"lg",null,"xl",null,"sm",null],null),null);$APP.ka("app.exports.x_card.init",vt);export const init=vt;
|
package/dist/x-chart.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var uz=function(a,b){return function f(d,e){return new $APP.$c(null,function(){var h=$APP.v(e);if(h){if($APP.yc(h)){for(var k=$APP.ob(h),m=$APP.B(k),q=$APP.cd(m),r=0;;)if(r<m){var u=function(){var w=d+r,z=$APP.jc(k,r);return a.h?a.h(w,z):a.call(null,w,z)}();u!=null&&q.add(u);r+=1}else break;return $APP.fd(q.ia(),f(d+m,$APP.pb(h)))}m=function(){var w=$APP.x(h);return a.h?a.h(d,w):a.call(null,d,w)}();return m==null?f(d+1,$APP.Mb(h)):$APP.Xc(m,f(d+1,$APP.Mb(h)))}return null},null)}(0,b)},vz=function(a){return $APP.jd($APP.Fc(function(b,
|
|
3
|
+
c){var d=$APP.Ih.g?$APP.Ih.g(c):$APP.Ih.call(null,c);c=$APP.ef.h($APP.lc(b,d,$APP.Ld),c);return $APP.kb(b,d,c)},$APP.hb($APP.xd),a))},wz=function(a){return a!=null&&$APP.N(a,"false")},xz=function(a,b){return typeof a==="string"?(a=parseInt(a,10),$APP.p(isNaN(a))&&a>0?a:b):b},yz=function(a,b){var c=function(){var h=a.id;h=$APP.n(h)?""+$APP.S.g(a.id):h;return $APP.n(h)?h:"s"+$APP.S.g(b)}(),d=function(){var h=a.label;h=$APP.n(h)?""+$APP.S.g(a.label):h;return $APP.n(h)?h:c}(),e=function(){var h=a.color;
|
|
4
|
+
return $APP.n(h)?""+$APP.S.g(a.color):h}(),f=a.data;return $APP.n($APP.pa(f))?new $APP.P(null,4,[$APP.Ih,c,$APP.W,d,$APP.xi,e,$APP.Pg,uz(function(h,k){return $APP.n($APP.n(k)?k.x!=null&&k.y!=null:k)?new $APP.P(null,2,[$APP.Vh,k.x,$APP.Uh,k.y],null):null},$APP.gc(f))],null):null},zz=function(a){if(typeof a!=="string")return $APP.Ld;try{var b=JSON.parse(a);if($APP.n($APP.pa(b)))return $APP.be(uz(function(d,e){return yz(e,d)},$APP.gc(b)));if($APP.n(function(){var d=b!=null?b.constructor===Object:!1;
|
|
5
|
+
return d?$APP.pa(b.data):d}())){var c=yz(b,0);return $APP.n(c)?new $APP.O(null,1,5,$APP.Xd,[c],null):$APP.Ld}return $APP.Ld}catch(d){return $APP.Ld}},Az=function(a){a=a==null?null:$APP.x(a);a=a==null?null:$APP.Pg.g(a);a=a==null?null:$APP.x(a);return $APP.n($APP.n(a)?typeof $APP.Vh.g(a)==="string":a)?"category":"numeric"},Bz=function(a){a=$APP.Jd(function(b){return $APP.Id.h($APP.Uh,$APP.Pg.g(b))},$APP.gc([a]));return $APP.rc(a)?new $APP.O(null,2,5,$APP.Xd,[0,1],null):new $APP.O(null,2,5,$APP.Xd,[$APP.rd($APP.lg,
|
|
6
|
+
a),$APP.rd($APP.kg,a)],null)},Cz=function(a){var b=Az(a);if($APP.D.h(b,"category"))return a=$APP.sd($APP.kg,0,$APP.Id.h(function(c){return $APP.B($APP.Pg.g(c))},a)),new $APP.O(null,2,5,$APP.Xd,[0,$APP.kg.h(1,a)-1],null);a=$APP.Jd(function(c){return $APP.Id.h($APP.Vh,$APP.Pg.g(c))},$APP.gc([a]));return $APP.rc(a)?new $APP.O(null,2,5,$APP.Xd,[0,1],null):new $APP.O(null,2,5,$APP.Xd,[$APP.rd($APP.lg,a),$APP.rd($APP.kg,a)],null)},Dz=function(a,b){return b==null?(b=Math.abs(a),b>=1E6?""+$APP.S.g(Math.round(a/
|
|
7
|
+
1E6))+"M":b>=1E3?""+$APP.S.g(Math.round(a/1E3))+"K":$APP.n(Number.isInteger(a))?""+$APP.S.g(a):a.toFixed(1)):$APP.D.h(b,"int")?""+$APP.S.g(Math.round(a)):$APP.D.h(b,"pct")?""+$APP.S.g(a)+"%":$APP.D.h(b,"abbr")?(b=Math.abs(a),b>=1E9?""+$APP.S.g((a/1E9).toFixed(1))+"B":b>=1E6?""+$APP.S.g((a/1E6).toFixed(1))+"M":b>=1E3?""+$APP.S.g((a/1E3).toFixed(1))+"K":""+$APP.S.g(a)):$APP.D.h(b,"raw")?""+$APP.S.g(a):$APP.n(b.startsWith("fixed:"))?(b=parseInt(b.slice(6),10),$APP.n(isNaN(b))?""+$APP.S.g(a):a.toFixed(b)):
|
|
8
|
+
""+$APP.S.g(a)},Gz=function(a,b){a=vz(a);return $APP.be($APP.Cd(function(c){$APP.H(c,0,null);c=$APP.H(c,1,null);return $APP.Fc(function(d,e){var f=Math.abs(Ez.g(e)-b);return d==null||f<Fz.g(d)?$APP.jg.m(e,Fz,f):d},null,c)},a))},Hz=function(a){return document.createElementNS("http://www.w3.org/2000/svg",a)},fA=function(a){a=$APP.bf([Iz,Jz,Kz,Lz,$APP.$h,Mz,Nz,Oz,Pz,Qz,$APP.jh,Rz,Sz],[a.getAttribute("selected"),a.getAttribute("padding"),$APP.n(a.hasAttribute("tooltip"))?a.getAttribute("tooltip"):null,
|
|
9
|
+
a.getAttribute("y-format"),$APP.n(a.hasAttribute("disabled"))?a.getAttribute("disabled"):null,$APP.n(a.hasAttribute("grid"))?a.getAttribute("grid"):null,$APP.n(a.hasAttribute("axes"))?a.getAttribute("axes"):null,a.getAttribute("height"),a.getAttribute("cursor"),$APP.n(a.hasAttribute("loading"))?a.getAttribute("loading"):null,a.getAttribute("type"),a.getAttribute("data"),a.getAttribute("x-format")]);var b=$APP.M(a);a=$APP.I(b,Sz);var c=$APP.I(b,Iz),d=$APP.I(b,Jz),e=$APP.I(b,Kz),f=$APP.I(b,Lz),h=$APP.I(b,
|
|
10
|
+
$APP.$h),k=$APP.I(b,Mz),m=$APP.I(b,Nz),q=$APP.I(b,Oz),r=$APP.I(b,Pz),u=$APP.I(b,Qz),w=$APP.I(b,$APP.jh);b=$APP.I(b,Rz);b=zz(b);var z=Bz(b),A=$APP.H(z,0,null),C=$APP.H(z,1,null);z=[Tz,$APP.bj,Uz,Vz,$APP.oh,Wz,Xz,$APP.Z,$APP.Ni,Yz,$APP.U,Zz,$z,$APP.Ki,aA,bA];var F=new $APP.O(null,2,5,$APP.Xd,[A,C],null);a:{if(typeof c==="string"&&(c=c.split(":"),$APP.D.h(2,c.length))){var E=parseInt(c[1],10);c=$APP.n(isNaN(E))?null:new $APP.P(null,2,[cA,c[0],$APP.Vg,E],null);break a}c=null}m=m==null?!0:wz(m);u=wz(u);
|
|
11
|
+
r=typeof r==="string"&&$APP.Cc(dA,r)?r:"nearest";w=typeof w==="string"&&$APP.Cc(eA,w)?w:"line";d=xz(d,12);h=wz(h);e=wz(e);a:if($APP.D.h(A,C))A=new $APP.O(null,1,5,$APP.Xd,[A],null);else{E=C-A;if(E===0)E=1;else{var Q=E/5;E=Math.pow(10,Math.floor(Math.log10(Q)));Q/=E;E*=Q<=1?1:Q<=2?2:Q<=2.5?2.5:Q<=5?5:10}C=Math.floor(C/E)*E;A=Math.ceil(A/E)*E;for(var V=$APP.Ld;;){if(A>C+E*1E-4){A=V;break a}Q=A+E;V=$APP.ef.h(V,A);A=Q}A=void 0}return $APP.bf(z,[F,c,m,b,u,f,r,w,d,a,h,e,A,xz(q,180),Az(b),k==null?!0:wz(k)])},
|
|
12
|
+
gA=function(a,b,c){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:!1}))},hA=function(a,b,c,d){var e=$APP.H(b,0,null);b=$APP.H(b,1,null);e=b-e;return e===0?(c+d)/2:c+(b-a)/e*(d-c)},iA=function(a,b,c,d){var e=$APP.H(b,0,null);b=$APP.H(b,1,null)-e;return b===0?(c+d)/2:c+(a-e)/b*(d-c)},jA=function(a,b,c){a.setAttribute(b,c)},kA=function(a,b,c,d){var e=Hz("line");a=""+$APP.S.g(a);e.setAttribute("x1",a);b=""+$APP.S.g(b);e.setAttribute("y1",b);c=""+$APP.S.g(c);e.setAttribute("x2",
|
|
13
|
+
c);d=""+$APP.S.g(d);e.setAttribute("y2",d);e.setAttribute("stroke","var(--x-chart-grid)");d=""+$APP.S.g(1);e.setAttribute("stroke-opacity",d);e.setAttribute("stroke-width","1");return e},lA=function(a,b,c,d){var e=Hz("text");a=""+$APP.S.g(a);e.setAttribute("x",a);b=""+$APP.S.g(b);e.setAttribute("y",b);e.setAttribute("text-anchor",d);d=""+$APP.S.g(10);e.setAttribute("font-size",d);e.setAttribute("fill","var(--x-chart-axis-label)");e.textContent=c;return e},mA=function(a){return"var(--x-chart-series-"+
|
|
14
|
+
$APP.S.g($APP.Qc(a,4)+1)+")"},oA=function(a){if($APP.v(a)){var b=$APP.v(a);a=$APP.x(b);b=$APP.y(b);return"M "+$APP.S.g(Ez.g(a))+","+$APP.S.g(nA.g(a))+$APP.S.g($APP.rd($APP.S,$APP.Id.h(function(c){return" L "+$APP.S.g(Ez.g(c))+","+$APP.S.g(nA.g(c))},b)))}return null},pA=function(a){for(;;){var b=a.lastChild;if($APP.n(b))a.removeChild(b);else break}},uA=function(a,b,c){b=$APP.M(b);var d=$APP.I(b,$z);b=$APP.I(b,Tz);var e=$APP.M(c);c=$APP.I(e,qA);var f=$APP.I(e,rA),h=$APP.I(e,sA);e=$APP.I(e,tA);d=$APP.v(d);
|
|
15
|
+
for(var k=null,m=0,q=0;;)if(q<m){var r=k.F(null,q);r=hA(r,b,f,e);r=kA(c,r,h,r);a.appendChild(r);q+=1}else if(d=$APP.v(d))$APP.yc(d)?(m=$APP.ob(d),d=$APP.pb(d),k=m,m=$APP.B(m)):(r=$APP.x(d),k=hA(r,b,f,e),k=kA(c,k,h,k),a.appendChild(k),d=$APP.y(d),k=null,m=0),q=0;else break},vA=function(a,b,c,d){var e=$APP.M(b),f=$APP.I(e,$z),h=$APP.I(e,Tz);b=$APP.I(e,Vz);var k=$APP.I(e,aA),m=$APP.I(e,Wz),q=$APP.I(e,Yz);e=$APP.M(c);var r=$APP.I(e,qA);c=$APP.I(e,rA);var u=$APP.I(e,sA),w=$APP.I(e,tA);f=$APP.v(f);e=null;
|
|
16
|
+
for(var z=0,A=0;;)if(A<z){var C=e.F(null,A),F=hA(C,h,c,w);C=Dz(C,m);F=lA(r-4,F+4,C,"end");a.appendChild(F);A+=1}else if(f=$APP.v(f))$APP.yc(f)?(z=$APP.ob(f),f=$APP.pb(f),e=z,z=$APP.B(z)):(z=$APP.x(f),e=hA(z,h,c,w),z=Dz(z,m),e=lA(r-4,e+4,z,"end"),a.appendChild(e),f=$APP.y(f),e=null,z=0),A=0;else break;h=$APP.x(b);if($APP.n(h)){h=$APP.Pg.g(h);m=$APP.B(h);var E=Cz(b),Q=$APP.kg.h(1,Math.ceil(m/5)|0);$APP.Cf($APP.Bd(function(V,ea){if($APP.Qc(V,Q)===0){if($APP.D.h(k,"category")){var wa=$APP.x($APP.y(E))-
|
|
17
|
+
$APP.x(E);V=wa<=1?(r+u)/2:r+V/(wa-1)*(u-r)}else V=iA($APP.Vh.g(ea),E,r,u);ea=$APP.D.h(k,"category")?""+$APP.S.g($APP.Vh.g(ea)):Dz($APP.Vh.g(ea),q);ea=lA(V,w+d+4,ea,"middle");return a.appendChild(ea)}return null},h))}},yA=function(a,b,c,d,e,f){e=$APP.M(e);var h=$APP.I(e,qA),k=$APP.I(e,rA),m=$APP.I(e,sA),q=$APP.I(e,tA);return $APP.Bd(function(r,u){if($APP.D.h(c,"category")){var w=$APP.kg.h(1,$APP.B($APP.Pg.g(a)))-1;w=w<=1?(h+m)/2:h+r/(w-1)*(m-h)}else w=iA($APP.Vh.g(u),d,h,m);var z=hA($APP.Uh.g(u),f,
|
|
18
|
+
k,q);return $APP.jg.G(u,Ez,w,$APP.gc([nA,z,wA,b,xA,r]))},$APP.Pg.g(a))},zA=function(a,b,c){b=oA(b);if($APP.n(b)){var d=Hz("path");d.setAttribute("d",b);d.setAttribute("fill","none");d.setAttribute("stroke",c);d.setAttribute("stroke-width","2");d.setAttribute("stroke-linejoin","round");d.setAttribute("stroke-linecap","round");return a.appendChild(d)}return null},AA=function(a,b,c,d){if($APP.v(b)){var e=oA(b),f=$APP.ic(b);b=$APP.x(b);d=""+$APP.S.g(e)+" L "+$APP.S.g(Ez.g(f))+","+$APP.S.g(d)+" L "+$APP.S.g(Ez.g(b))+
|
|
19
|
+
","+$APP.S.g(d)+" Z"}else d=null;$APP.n(d)&&(e=Hz("path"),e.setAttribute("d",d),e.setAttribute("fill",c),e.setAttribute("fill-opacity","0.18"),e.setAttribute("stroke",c),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linejoin","round"),e.setAttribute("stroke-linecap","round"),a.appendChild(e))},CA=function(a,b,c,d,e,f){var h=$APP.M(e);e=$APP.I(h,qA);h=$APP.I(h,sA);var k=$APP.B(c);e=k===0?0:(h-e)/k;h=e*.08;f=(e-h*2)/f;b*=f;c=$APP.v(c);k=null;for(var m=0,q=0;;)if(q<m){var r=k.F(null,q),u=
|
|
20
|
+
Ez.g(r)+-(e/2)+h+b,w=$APP.lg.h(nA.g(r),BA.g(r)),z=Math.abs(nA.g(r)-BA.g(r)),A=r=Hz("rect");u=""+$APP.S.g(u);A.setAttribute("x",u);u=r;w=""+$APP.S.g(w);u.setAttribute("y",w);w=r;u=""+$APP.S.g($APP.kg.h(1,f));w.setAttribute("width",u);w=r;z=""+$APP.S.g($APP.kg.h(0,z));w.setAttribute("height",z);r.setAttribute("fill",d);r.setAttribute("rx","2");a.appendChild(r);q+=1}else if(c=$APP.v(c))$APP.yc(c)?(m=$APP.ob(c),c=$APP.pb(c),k=m,m=$APP.B(m)):(r=$APP.x(c),z=Ez.g(r)+-(e/2)+h+b,q=$APP.lg.h(nA.g(r),BA.g(r)),
|
|
21
|
+
m=Math.abs(nA.g(r)-BA.g(r)),r=k=Hz("rect"),z=""+$APP.S.g(z),r.setAttribute("x",z),r=k,q=""+$APP.S.g(q),r.setAttribute("y",q),q=k,r=""+$APP.S.g($APP.kg.h(1,f)),q.setAttribute("width",r),q=k,m=""+$APP.S.g($APP.kg.h(0,m)),q.setAttribute("height",m),k.setAttribute("fill",d),k.setAttribute("rx","2"),a.appendChild(k),c=$APP.y(c),k=null,m=0),q=0;else return null},FA=function(a,b,c,d){if($APP.v(a)){var e=$APP.x(a);b=typeof $APP.Vh.g(e)==="string"?""+$APP.S.g($APP.Vh.g(e)):Dz($APP.Vh.g(e),b);var f=$APP.Ae.h($APP.xd,
|
|
22
|
+
$APP.Bd(function(h,k){var m=$APP.Xd,q=$APP.Ih.g(k);k=$APP.xi.g(k);h=$APP.n(k)?k:mA(h);return new $APP.O(null,2,5,m,[q,h],null)},d));d=$APP.Md(function(h){return new $APP.P(null,5,[$APP.xi,$APP.lc(f,$APP.Ih.g(h),mA(wA.h(h,0))),$APP.W,""+$APP.S.g($APP.W.g(h)),$APP.T,Dz($APP.Uh.g(h),c),Ez,Ez.g(h),nA,nA.g(h)],null)},a);return new $APP.P(null,5,[DA,b,$APP.Xh,d,Ez,Ez.g(e),nA,nA.g(e),EA,$APP.Md(function(h){return new $APP.P(null,3,[Ez,Ez.g(h),nA,nA.g(h),$APP.xi,$APP.lc(f,$APP.Ih.g(h),mA(wA.h(h,0)))],null)},
|
|
23
|
+
a)],null)}return null},GA=function(a){var b=$APP.l(a,"tooltip"),c=$APP.l(a,"crosshair");a=$APP.l(a,"dots");$APP.n(b)&&b.setAttribute("data-visible","false");$APP.n(c)&&c.setAttribute("visibility","hidden");if($APP.n(a))for(b=0;;)if(b<8)c=a[b],$APP.n(c)&&c.setAttribute("visibility","hidden"),b+=1;else return null;else return null},HA=function(a,b,c){return $APP.Fc(function(d,e){var f=Ez.g(e)-b,h=nA.g(e)-c;f=f*f+h*h;return d==null||f<Fz.g(d)?$APP.jg.m(e,Fz,f):d},null,a)},KA=function(a,b,c,d,e,f,h,k,
|
|
24
|
+
m,q,r){$APP.D.h(h,"none")||(b.addEventListener("mousemove",function(u){var w=b.getBoundingClientRect(),z=u.clientX-w.x;u=u.clientY-w.y;$APP.D.h(h,"x")?z=Gz(c,z):(z=HA(c,z,u),z=$APP.n(z)?new $APP.O(null,1,5,$APP.Xd,[z],null):null);u=z;z=$APP.x(u);if($APP.n(z)){if($APP.n(k)&&(w=FA(u,m,q,r),u=$APP.l(d,"tooltip"),$APP.n($APP.n(u)?w:u))){var A=$APP.M(w),C=$APP.I(A,DA),F=$APP.I(A,$APP.Xh);w=$APP.I(A,Ez);var E=$APP.I(A,nA),Q=$APP.I(A,EA),V=$APP.l(d,"tooltip-header"),ea=$APP.l(d,"tooltip-body"),wa=$APP.l(d,
|
|
25
|
+
"tooltip-rows"),Lc=$APP.l(d,"dots");A=$APP.l(d,"crosshair");$APP.n(V)&&(V.textContent=C);if($APP.n($APP.n(ea)?wa:ea))for(C=0;;)if(C<8){ea=wa[C];if($APP.n(ea))if(V=$APP.H(F,C,null),$APP.n(V)){ea.setAttribute("data-hidden","false");ea=ea.firstChild;var Gd=$APP.n(ea)?ea.nextSibling:null,nj=$APP.n(Gd)?Gd.nextSibling:null;$APP.n(ea)&&(ea.style.backgroundColor=$APP.xi.g(V));$APP.n(Gd)&&(Gd.textContent=$APP.W.g(V));$APP.n(nj)&&(nj.textContent=$APP.T.g(V))}else ea.setAttribute("data-hidden","true");C+=1}else break;
|
|
26
|
+
if($APP.n(Lc))for(F=0;;)if(F<8)wa=Lc[F],$APP.n(wa)&&(C=$APP.H(Q,F,null),$APP.n(C)?(V=wa,ea=""+$APP.S.g(Ez.g(C)),V.setAttribute("cx",ea),V=wa,ea=""+$APP.S.g(nA.g(C)),V.setAttribute("cy",ea),V=wa,C=$APP.xi.g(C),V.setAttribute("fill",C),wa.setAttribute("visibility","visible")):wa.setAttribute("visibility","hidden")),F+=1;else break;$APP.n(A)&&A.setAttribute("visibility","visible");$APP.n(A)&&(Q=""+$APP.S.g(w),A.setAttribute("x1",Q));$APP.n(A)&&(Q=""+$APP.S.g(w),A.setAttribute("x2",Q));u.setAttribute("data-visible",
|
|
27
|
+
"true");A=u.offsetWidth;Q=u.offsetHeight;E=E+Q+8>f?E-Q-8:E-4;w=new $APP.P(null,2,[IA,$APP.kg.h(8,$APP.lg.h(w+A+12+8>e?w-A-12:w+12,e-A-8)),JA,$APP.kg.h(8,$APP.lg.h(E,f-Q-8))],null);E=$APP.M(w);w=$APP.I(E,IA);E=$APP.I(E,JA);u.style.left=""+$APP.S.g(w)+"px";u.style.top=""+$APP.S.g(E)+"px"}return gA(a,"x-chart-hover",{seriesId:$APP.Ih.g(z),index:xA.g(z),x:$APP.Vh.g(z),y:$APP.Uh.g(z),value:$APP.Uh.g(z)})}return null}),b.addEventListener("mouseleave",function(){return $APP.n(k)?GA(d):null}),b.addEventListener("click",
|
|
28
|
+
function(u){var w=b.getBoundingClientRect();u=HA(c,u.clientX-w.x,u.clientY-w.y);return $APP.n(u)?gA(a,"x-chart-select",{seriesId:$APP.Ih.g(u),index:xA.g(u),x:$APP.Vh.g(u),y:$APP.Uh.g(u),value:$APP.Uh.g(u)}):null}))},LA=function(a){a=$APP.l(a,"container");a=$APP.n(a)?a.clientWidth:0;return a>0?a:400},MA=function(a){var b=$APP.l(a,"__xChartRefs");if($APP.n(b)){var c=$APP.l(b,"svg"),d=$APP.l(b,"sr"),e=fA(a),f=$APP.M(e),h=$APP.I(f,$APP.U);$APP.I(f,$z);var k=$APP.I(f,$APP.Ki),m=$APP.I(f,Zz),q=$APP.I(f,
|
|
29
|
+
bA),r=$APP.I(f,aA),u=$APP.I(f,Tz),w=$APP.I(f,Uz),z=$APP.I(f,Vz),A=$APP.I(f,$APP.oh),C=$APP.I(f,Wz),F=$APP.I(f,Xz),E=$APP.I(f,$APP.Z),Q=$APP.I(f,$APP.Ni);f=$APP.I(f,Yz);var V=LA(b),ea=new $APP.P(null,4,[qA,Q+36,rA,Q,sA,V-Q,tA,k-Q-18],null),wa=$APP.M(ea),Lc=$APP.I(wa,qA),Gd=$APP.I(wa,rA),nj=$APP.I(wa,sA);wa=$APP.I(wa,tA);var tF=Cz(z),iw=hA(0,u,Gd,wa);jA(c,"viewBox","0 0 "+$APP.S.g(V)+" "+$APP.S.g(k));jA(c,"width",""+$APP.S.g(V));jA(c,"height",""+$APP.S.g(k));pA(c);b.crosshair=null;b.dots=null;if(!$APP.n(A)){$APP.n(q)&&
|
|
30
|
+
uA(c,e,ea);var jw=$APP.be($APP.Jd(function(Uf,Vf){Vf=yA(Uf,Vf,r,tF,ea,u);return $APP.Id.h(function(Wf){return $APP.jg.G(Wf,$APP.Ih,$APP.Ih.g(Uf),$APP.gc([$APP.W,$APP.W.g(Uf),BA,iw]))},Vf)},$APP.gc([z,$APP.Bf(0,Number.MAX_VALUE)])));$APP.Cf($APP.Bd(function(Uf,Vf){var Wf=function(){var oj=$APP.xi.g(Vf);return $APP.n(oj)?oj:mA(Uf)}(),pj=$APP.Kd(function(oj){return $APP.D.h($APP.Ih.g(oj),$APP.Ih.g(Vf))},jw);switch(E){case "bar":return CA(c,Uf,pj,Wf,ea,$APP.B(z));case "area":return AA(c,pj,Wf,iw),zA(c,
|
|
31
|
+
pj,Wf);default:return zA(c,pj,Wf)}},z));$APP.n(w)&&vA(c,e,ea,Q);e=Hz("line");jA(e,"x1",""+$APP.S.g(Lc));jA(e,"y1",""+$APP.S.g(Gd));jA(e,"x2",""+$APP.S.g(Lc));jA(e,"y2",""+$APP.S.g(wa));e.setAttribute("stroke","var(--x-chart-crosshair-color)");e.setAttribute("stroke-width","var(--x-chart-crosshair-width)");e.setAttribute("visibility","hidden");c.appendChild(e);b.crosshair=e;e=Array(8);for(q=0;;)if(q<8)w=Hz("circle"),jA(w,"r",""+$APP.S.g(4)),w.setAttribute("stroke","var(--x-chart-tooltip-bg)"),w.setAttribute("stroke-width",
|
|
32
|
+
"2"),w.setAttribute("visibility","hidden"),c.appendChild(w),e[q]=w,q+=1;else break;b.dots=e;e=Hz("rect");jA(e,"x",""+$APP.S.g(Lc));jA(e,"y",""+$APP.S.g(Gd));jA(e,"width",""+$APP.S.g($APP.kg.h(0,nj-Lc)));jA(e,"height",""+$APP.S.g($APP.kg.h(0,wa-Gd)));e.setAttribute("fill","transparent");e.setAttribute("style","cursor:crosshair;");$APP.n(h)||KA(a,e,jw,b,V,k,F,m,f,C,z);c.appendChild(e);d.textContent=""+$APP.S.g($APP.B(z))+" series chart"}return $APP.n(A)?GA(b):null}return null},NA=function(){var a=document.createElement("div"),
|
|
33
|
+
b=document.createElement("span"),c=document.createElement("span"),d=document.createElement("span");a.setAttribute("part","tooltip-row");a.setAttribute("data-hidden","true");b.setAttribute("part","tooltip-swatch");c.setAttribute("part","tooltip-label");d.setAttribute("part","tooltip-value");a.appendChild(b);a.appendChild(c);a.appendChild(d);return a},OA=function(a){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div"),e=Hz("svg"),f=document.createElement("div"),
|
|
34
|
+
h=document.createElement("div"),k=document.createElement("div"),m=document.createElement("div"),q=Array(8);fA(a);c.textContent=":host{display:block;color-scheme:light dark;contain:content;--x-chart-series-1:rgba(0,102,204,0.95);--x-chart-series-2:rgba(16,140,72,0.95);--x-chart-series-3:rgba(190,20,40,0.95);--x-chart-series-4:rgba(204,120,0,0.95);--x-chart-border:rgba(0,0,0,0.1);--x-chart-grid:rgba(0,0,0,0.08);--x-chart-axis-label:rgba(0,0,0,0.5);--x-chart-skeleton:linear-gradient(90deg,rgba(0,0,0,0.06) 25%,rgba(0,0,0,0.03) 50%,rgba(0,0,0,0.06) 75%);--x-chart-tooltip-bg:rgba(255,255,255,0.96);--x-chart-tooltip-border:rgba(0,0,0,0.12);--x-chart-tooltip-shadow:0 4px 16px rgba(0,0,0,0.14);--x-chart-focus-ring:rgba(0,102,204,0.55);--x-chart-radius:0.75rem;--x-chart-tooltip-radius:0.5rem;--x-chart-tooltip-padding:0.45rem 0.7rem;--x-chart-tooltip-font-size:0.8125rem;--x-chart-tooltip-header-color:rgba(0,0,0,0.5);--x-chart-tooltip-label-color:rgba(0,0,0,0.65);--x-chart-tooltip-value-color:rgba(0,0,0,0.9);--x-chart-tooltip-swatch-size:8px;--x-chart-tooltip-gap:0.35rem;--x-chart-crosshair-color:rgba(0,0,0,0.18);--x-chart-crosshair-width:1;}@media(prefers-color-scheme:dark){:host{--x-chart-series-1:rgba(120,190,255,0.95);--x-chart-series-2:rgba(80,230,150,0.92);--x-chart-series-3:rgba(255,100,110,0.93);--x-chart-series-4:rgba(255,190,60,0.93);--x-chart-border:rgba(255,255,255,0.1);--x-chart-grid:rgba(255,255,255,0.08);--x-chart-axis-label:rgba(255,255,255,0.45);--x-chart-skeleton:linear-gradient(90deg,rgba(255,255,255,0.06) 25%,rgba(255,255,255,0.03) 50%,rgba(255,255,255,0.06) 75%);--x-chart-tooltip-bg:rgba(30,30,35,0.97);--x-chart-tooltip-border:rgba(255,255,255,0.12);--x-chart-tooltip-shadow:0 4px 20px rgba(0,0,0,0.45);--x-chart-focus-ring:rgba(120,190,255,0.55);--x-chart-tooltip-header-color:rgba(255,255,255,0.45);--x-chart-tooltip-label-color:rgba(255,255,255,0.6);--x-chart-tooltip-value-color:rgba(255,255,255,0.9);--x-chart-crosshair-color:rgba(255,255,255,0.2);}}[part\x3dcontainer]{position:relative;border:1px solid var(--x-chart-border);border-radius:var(--x-chart-radius);overflow:hidden;outline:none;}[part\x3dcontainer]:focus-visible{box-shadow:0 0 0 3px var(--x-chart-focus-ring);}[part\x3dsvg]{display:block;width:100%;height:auto;overflow:visible;}:host([loading]) [part\x3dcontainer]{background:var(--x-chart-skeleton);background-size:200% 100%;animation:x-chart-shimmer 1.4s ease infinite;}@keyframes x-chart-shimmer{0%{background-position:200% 0;}100%{background-position:-200% 0;}}@media(prefers-reduced-motion:reduce){:host([loading]) [part\x3dcontainer]{animation:none;}}[part\x3dsr-only]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}[part\x3dtooltip]{visibility:hidden;opacity:0;position:absolute;pointer-events:none;background:var(--x-chart-tooltip-bg);border:1px solid var(--x-chart-tooltip-border);box-shadow:var(--x-chart-tooltip-shadow);border-radius:var(--x-chart-tooltip-radius);padding:var(--x-chart-tooltip-padding);font-size:var(--x-chart-tooltip-font-size);line-height:1.5;white-space:nowrap;z-index:10;}[part\x3dtooltip][data-visible\x3dtrue]{visibility:visible;opacity:1;}@media(prefers-reduced-motion:no-preference){[part\x3dtooltip]{transition:opacity 0.1s ease,left 0.08s ease,top 0.08s ease;}}[part\x3dtooltip-header]{font-size:0.75rem;color:var(--x-chart-tooltip-header-color);margin-bottom:0.25rem;}[part\x3dtooltip-body]{display:flex;flex-direction:column;gap:var(--x-chart-tooltip-gap);}[part\x3dtooltip-row]{display:flex;align-items:center;gap:0.4rem;}[part\x3dtooltip-row][data-hidden\x3dtrue]{display:none;}[part\x3dtooltip-swatch]{display:inline-block;width:var(--x-chart-tooltip-swatch-size);height:var(--x-chart-tooltip-swatch-size);border-radius:50%;flex-shrink:0;}[part\x3dtooltip-label]{color:var(--x-chart-tooltip-label-color);}[part\x3dtooltip-value]{color:var(--x-chart-tooltip-value-color);font-weight:600;margin-left:auto;padding-left:0.5rem;}";
|
|
35
|
+
d.setAttribute("part","container");d.setAttribute("tabindex","0");e.setAttribute("part","svg");e.setAttribute("aria-hidden","true");e.setAttribute("role","img");f.setAttribute("part","sr-only");f.setAttribute("aria-live","polite");h.setAttribute("part","tooltip");h.setAttribute("role","tooltip");h.setAttribute("aria-hidden","true");h.setAttribute("data-visible","false");k.setAttribute("part","tooltip-header");m.setAttribute("part","tooltip-body");for(var r=0;;)if(r<8){var u=NA();m.appendChild(u);
|
|
36
|
+
q[r]=u;r+=1}else break;h.appendChild(k);h.appendChild(m);d.appendChild(e);d.appendChild(f);d.appendChild(h);b.appendChild(c);b.appendChild(d);c={};c.root=b;c.container=d;c.svg=e;c.sr=f;c.tooltip=h;c["tooltip-header"]=k;c["tooltip-body"]=m;c["tooltip-rows"]=q;c.crosshair=null;c.dots=null;a.__xChartRefs=c;b=new ResizeObserver(function(){return MA(a)});b.observe(d);$APP.l(a,"__xChartRefs").ro=b},PA=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.getAttribute(c)},
|
|
37
|
+
set:function(d){return d!=null?this.setAttribute(c,""+$APP.S.g(d)):this.removeAttribute(c)}})},QA=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return $APP.n(d)?this.setAttribute(c,""):this.removeAttribute(c)}})},RA=function(a){Object.defineProperty(a,"data",{configurable:!0,enumerable:!0,get:function(){var b=$APP.l(this,"__xChartData");if($APP.n(b))return b;b=this.getAttribute("data");return zz(b)},set:function(b){this.__xChartData=
|
|
38
|
+
b;return $APP.n($APP.pa(b))?this.setAttribute("data",JSON.stringify(b)):this.removeAttribute("data")}})},SA=function(){function a(){return Reflect.construct(HTMLElement,[],$APP.Ra(b))}var b=new $APP.Dd;$APP.Ed(b,a);return a},UA=function(){if($APP.n(customElements.get("x-chart")))return null;var a=Object.create(HTMLElement.prototype),b=SA();Object.setPrototypeOf(b,HTMLElement);a.constructor=b;PA(a,"type","type");PA(a,"cursor","cursor");PA(a,"selected","selected");QA(a,"grid","grid");QA(a,"axes","axes");
|
|
39
|
+
QA(a,"tooltip","tooltip");QA(a,"disabled","disabled");QA(a,"loading","loading");RA(a);a.connectedCallback=function(){$APP.n($APP.l(this,"__xChartRefs"))||OA(this);return MA(this)};a.disconnectedCallback=function(){var c=$APP.l(this,"__xChartRefs");$APP.n(c)?(c=$APP.l(c,"ro"),c=$APP.n(c)?c.disconnect():null):c=null;return c};a.attributeChangedCallback=function(){return $APP.n($APP.l(this,"__xChartRefs"))?MA(this):null};b.observedAttributes=TA;b.prototype=a;return customElements.define("x-chart",b)},
|
|
40
|
+
VA=function(){return UA()},IA=new $APP.K(null,"left","left",-399115937),Zz=new $APP.K(null,"tooltip?","tooltip?",-642753154),DA=new $APP.K(null,"x-label","x-label",802517907),EA=new $APP.K(null,"dot-pts","dot-pts",1732240900),cA=new $APP.K(null,"series-id","series-id",226875035),Qz=new $APP.K(null,"loading-present?","loading-present?",-1827648748),Yz=new $APP.K(null,"x-fmt","x-fmt",2073358008),Lz=new $APP.K(null,"y-format-raw","y-format-raw",-1098541692),JA=new $APP.K(null,"top","top",-1856271961),
|
|
41
|
+
Nz=new $APP.K(null,"axes-raw","axes-raw",-839946224),Jz=new $APP.K(null,"padding-raw","padding-raw",-847772255),nA=new $APP.K(null,"py","py",1397985916),Ez=new $APP.K(null,"px","px",281329899),Sz=new $APP.K(null,"x-format-raw","x-format-raw",-1683657190),Uz=new $APP.K(null,"axes?","axes?",1786285669),bA=new $APP.K(null,"grid?","grid?",-288406689),BA=new $APP.K(null,"y0-baseline","y0-baseline",613579610),Pz=new $APP.K(null,"cursor-raw","cursor-raw",-1169819084),Tz=new $APP.K(null,"y-domain","y-domain",
|
|
42
|
+
-969203007),aA=new $APP.K(null,"x-kind","x-kind",693167455),Xz=new $APP.K(null,"cursor","cursor",1011937484),Kz=new $APP.K(null,"tooltip-present?","tooltip-present?",-2098824029),Wz=new $APP.K(null,"y-fmt","y-fmt",2092412811),rA=new $APP.K(null,"y0","y0",111454807),tA=new $APP.K(null,"y1","y1",589123466),Oz=new $APP.K(null,"height-raw","height-raw",-867301006),xA=new $APP.K(null,"i","i",-1386841315),Fz=new $APP.K(null,"d","d",1972142424),sA=new $APP.K(null,"x1","x1",-1863922247),qA=new $APP.K(null,
|
|
43
|
+
"x0","x0",410843387),Iz=new $APP.K(null,"selected-raw","selected-raw",-1471626848),wA=new $APP.K(null,"si","si",793409822),$z=new $APP.K(null,"y-ticks","y-ticks",-843622722),Vz=new $APP.K(null,"series","series",600710694),Rz=new $APP.K(null,"data-raw","data-raw",822066711),Mz=new $APP.K(null,"grid-present?","grid-present?",-468948562);var TA="type data height padding x-format y-format grid axes tooltip cursor disabled loading selected".split(" "),eA=new $APP.R(null,new $APP.P(null,3,["bar",null,"area",null,"line",null],null),null),dA=new $APP.R(null,new $APP.P(null,3,["none",null,"x",null,"nearest",null],null),null);
|
|
44
|
+
$APP.bf([$APP.bj,$APP.yi,new $APP.K(null,"axes","axes",1970866440),new $APP.K(null,"grid","grid",402978600),Xz,$APP.Z,$APP.Hh,$APP.Ni,new $APP.K(null,"tooltip","tooltip",-1809677058),$APP.Ki,$APP.Pg],[new $APP.P(null,2,[$APP.Z,$APP.X,$APP.Qg,"selected"],null),new $APP.P(null,2,[$APP.Z,$APP.Li,$APP.Qg,"disabled"],null),new $APP.P(null,2,[$APP.Z,$APP.Li,$APP.Qg,"axes"],null),new $APP.P(null,2,[$APP.Z,$APP.Li,$APP.Qg,"grid"],null),new $APP.P(null,2,[$APP.Z,$APP.X,$APP.Qg,"cursor"],null),new $APP.P(null,
|
|
45
|
+
2,[$APP.Z,$APP.X,$APP.Qg,"type"],null),new $APP.P(null,2,[$APP.Z,$APP.Li,$APP.Qg,"loading"],null),new $APP.P(null,2,[$APP.Z,$APP.Gh,$APP.Qg,"padding"],null),new $APP.P(null,2,[$APP.Z,$APP.Li,$APP.Qg,"tooltip"],null),new $APP.P(null,2,[$APP.Z,$APP.Gh,$APP.Qg,"height"],null),new $APP.P(null,1,[$APP.Z,$APP.zh],null)]);$APP.ka("app.exports.x_chart.init",VA);export const init=VA;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var yr=function(a,b,c){return a.setAttribute(b,c)},zr=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},Cr=function(a){a=$APP.bf([$APP.Kh,$APP.$h,$APP.Cg,$APP.Rg,$APP.ai,Ar,$APP.vi,$APP.Gi,$APP.Ei,$APP.ki],[a.getAttribute("name"),a.hasAttribute("disabled"),a.hasAttribute("required"),a.getAttribute("aria-labelledby"),a.hasAttribute("checked"),a.hasAttribute("indeterminate"),a.hasAttribute("readonly"),a.getAttribute("value"),a.getAttribute("aria-label"),a.getAttribute("aria-describedby")]);
|
|
3
|
+
var b=$APP.M(a);a=$APP.I(b,$APP.Ei);var c=$APP.I(b,$APP.ki),d=$APP.I(b,$APP.Kh),e=$APP.I(b,$APP.$h),f=$APP.I(b,$APP.Cg),h=$APP.I(b,$APP.Rg),k=$APP.I(b,$APP.ai),m=$APP.I(b,Ar),q=$APP.I(b,$APP.vi);b=$APP.I(b,$APP.Gi);k=$APP.J(k);m=$APP.J(m);f=$APP.J(f);return $APP.bf([Br,$APP.bh,$APP.Xg,$APP.cj,$APP.pi,$APP.Ig,$APP.ii,$APP.T,$APP.Oi,$APP.Xi,$APP.bi,$APP.U],[m,f,m?"mixed":k?"true":"false",$APP.J(q),k,$APP.n(f)?k:!0,d,b!=null?b:"on",h,c,a,$APP.J(e)])},Dr=function(a){var b=$APP.l(a,"__xCheckboxRefs");
|
|
4
|
+
if($APP.n(b)){var c=$APP.l(b,"control");b=Cr(a);var d=$APP.U.g(b),e=$APP.pi.g(b),f=Br.g(b);yr(c,"aria-checked",$APP.Xg.g(b));c.setAttribute("aria-disabled",$APP.n(d)?"true":"false");yr(c,"aria-required",$APP.n($APP.bh.g(b))?"true":"false");yr(c,"aria-readonly",$APP.n($APP.cj.g(b))?"true":"false");var h=$APP.bi.g(b);$APP.n(h)?c.setAttribute("aria-label",h):c.removeAttribute("aria-label");h=$APP.Oi.g(b);$APP.n(h)?c.setAttribute("aria-labelledby",h):c.removeAttribute("aria-labelledby");h=$APP.Xi.g(b);
|
|
5
|
+
$APP.n(h)?c.setAttribute("aria-describedby",h):c.removeAttribute("aria-describedby");c.tabIndex=$APP.n(d)?-1:0;$APP.n(d)?c.setAttribute("disabled",""):c.removeAttribute("disabled");zr(a,"data-checked",e);zr(a,"data-indeterminate",f);zr(a,"data-disabled",d);a=$APP.l(a,"__xCheckboxInternals");if($APP.n(a))return b=$APP.n(e)?$APP.T.g(b):null,a.setFormValue($APP.n(b)?b:null)}return null},Er=function(a){var b=Cr(a),c=$APP.U.g(b),d=$APP.cj.g(b);if($APP.n($APP.n(c)?c:d))return null;c=$APP.pi.g(b);d=Br.g(b);
|
|
6
|
+
d=$APP.n(d)?new $APP.P(null,2,[$APP.pi,!0,Br,!1],null):new $APP.P(null,2,[$APP.pi,$APP.p(c),Br,!1],null);var e=$APP.pi.g(d);b=$APP.T.g(b);c=new CustomEvent("x-checkbox-change-request",{detail:{value:b,previousChecked:c,nextChecked:e},bubbles:!0,composed:!0,cancelable:!0});a.dispatchEvent(c);return $APP.p(c.defaultPrevented)?(zr(a,"checked",e),zr(a,"indeterminate",Br.g(d)),Dr(a),a.dispatchEvent(new CustomEvent("x-checkbox-change",{detail:{value:b,checked:e},bubbles:!0,composed:!0,cancelable:!1}))):
|
|
7
|
+
null},Fr=function(a){return function(){return Er(a)}},Gr=function(a){return function(b){var c=b.key;return $APP.D.h(c," ")||$APP.D.h(c,"Enter")?(b.preventDefault(),Er(a)):null}},Hr=function(a){var b=$APP.l(a,"__xCheckboxRefs");if($APP.n(b)){var c=$APP.l(a,"__xCheckboxHandlers");if($APP.n(c)){b=$APP.l(b,"control");b.removeEventListener("click",$APP.l(c,"click"));b.removeEventListener("keydown",$APP.l(c,"keydown"));a.__xCheckboxHandlers=null;return}}return null},Ir=function(a,b,c){Object.defineProperty(a,
|
|
8
|
+
b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return zr(this,c,$APP.J(d))}})},Jr=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){var d=this.getAttribute(c);return $APP.n(d)?d:null},set:function(d){return d!=null&&$APP.N(d)?yr(this,c,""+$APP.S.g(d)):this.removeAttribute(c)}})},Lr=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=!0;Object.defineProperty(a,"observedAttributes",{get:function(){return Kr}});
|
|
9
|
+
Ir(b,"checked","checked");Ir(b,"indeterminate","indeterminate");Ir(b,"disabled","disabled");Ir(b,"readOnly","readonly");Ir(b,"required","required");Jr(b,"name","name");Jr(b,"value","value");b.connectedCallback=function(){if(!$APP.n($APP.l(this,"__xCheckboxRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("button"),f=document.createElement("span"),h=document.createElement("span");d.textContent=":host{display:inline-block;vertical-align:middle;color-scheme:light dark;--x-checkbox-size:16px;--x-checkbox-border-width:2px;--x-checkbox-border-color:#6b7280;--x-checkbox-border-radius:4px;--x-checkbox-bg:#ffffff;--x-checkbox-bg-checked:#2563eb;--x-checkbox-bg-indeterminate:#2563eb;--x-checkbox-border-checked:#2563eb;--x-checkbox-border-indeterminate:#2563eb;--x-checkbox-check-color:#ffffff;--x-checkbox-focus-ring:#60a5fa;--x-checkbox-disabled-opacity:0.45;--x-checkbox-transition:background 120ms ease,border-color 120ms ease;}@media (prefers-color-scheme:dark){:host{--x-checkbox-border-color:#9ca3af;--x-checkbox-bg:#1f2937;--x-checkbox-bg-checked:#3b82f6;--x-checkbox-bg-indeterminate:#3b82f6;--x-checkbox-border-checked:#3b82f6;--x-checkbox-border-indeterminate:#3b82f6;--x-checkbox-focus-ring:#93c5fd;}}[part\x3dcontrol]{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;padding:0;cursor:pointer;}[part\x3dcontrol][disabled]{cursor:default;opacity:var(--x-checkbox-disabled-opacity);}[part\x3dcontrol]:focus-visible{outline:none;box-shadow:0 0 0 3px var(--x-checkbox-focus-ring);border-radius:calc(var(--x-checkbox-border-radius) + 2px);}[part\x3dbox]{display:inline-flex;align-items:center;justify-content:center;width:var(--x-checkbox-size);height:var(--x-checkbox-size);border:var(--x-checkbox-border-width) solid var(--x-checkbox-border-color);border-radius:var(--x-checkbox-border-radius);background:var(--x-checkbox-bg);transition:var(--x-checkbox-transition);position:relative;flex-shrink:0;}:host([data-checked]) [part\x3dbox]{background:var(--x-checkbox-bg-checked);border-color:var(--x-checkbox-border-checked);}:host([data-indeterminate]) [part\x3dbox]{background:var(--x-checkbox-bg-indeterminate);border-color:var(--x-checkbox-border-indeterminate);}[part\x3dcheck]{display:inline-flex;align-items:center;justify-content:center;position:relative;width:100%;height:100%;}[part\x3dcheck]::before{content:'\\2713';color:var(--x-checkbox-check-color);font-size:10px;font-weight:700;line-height:1;opacity:0;transition:opacity 100ms ease;position:absolute;}:host([data-checked]) [part\x3dcheck]::before{opacity:1;}[part\x3dcheck]::after{content:'';display:block;width:8px;height:2px;background:var(--x-checkbox-check-color);border-radius:1px;opacity:0;transition:opacity 100ms ease;position:absolute;}:host([data-indeterminate]) [part\x3dcheck]::after{opacity:1;}@media (prefers-reduced-motion:reduce){[part\x3dbox]{transition:none;}[part\x3dcheck]::before{transition:none;}[part\x3dcheck]::after{transition:none;}}";
|
|
10
|
+
e.setAttribute("part","control");e.setAttribute("type","button");f.setAttribute("part","box");h.setAttribute("part","check");f.appendChild(h);e.appendChild(f);c.appendChild(d);c.appendChild(e);this.__xCheckboxRefs={root:c,control:e,box:f,check:h};$APP.n(this.attachInternals)&&(this.__xCheckboxInternals=this.attachInternals())}Hr(this);c=$APP.l(this,"__xCheckboxRefs");$APP.n(c)&&(c=$APP.l(c,"control"),d=Fr(this),e=Gr(this),f={click:d,keydown:e},c.addEventListener("click",d),c.addEventListener("keydown",
|
|
11
|
+
e),this.__xCheckboxHandlers=f);d=this.getAttribute("id");$APP.n(d)&&(c=document.querySelector("label[for\x3d'"+$APP.S.g(d)+"']"),$APP.n(c)&&(e=c.getAttribute("id"),$APP.n(e)?c=e:(d="x-cb-lbl-"+$APP.S.g(d),c.setAttribute("id",d),c=d),d=$APP.l(this,"__xCheckboxRefs"),$APP.n(d)&&$APP.l(d,"control").setAttribute("aria-labelledby",c)));return Dr(this)};b.disconnectedCallback=function(){return Hr(this)};b.attributeChangedCallback=function(){return Dr(this)};b.formDisabledCallback=function(c){zr(this,"disabled",
|
|
12
|
+
$APP.J(c));return Dr(this)};b.formResetCallback=function(){this.removeAttribute("checked");this.removeAttribute("indeterminate");return Dr(this)};return a},Mr=function(){return $APP.n(customElements.get("x-checkbox"))?null:customElements.define("x-checkbox",Lr())},Br=new $APP.K(null,"indeterminate?","indeterminate?",-1382048766),Ar=new $APP.K(null,"indeterminate-present?","indeterminate-present?",-1714683438);var Kr="checked indeterminate disabled readonly required name value aria-label aria-describedby aria-labelledby".split(" ");$APP.wd(["x-checkbox-change-request",new $APP.P(null,2,[$APP.wi,!0,$APP.Y,new $APP.P(null,3,[$APP.T,$APP.X,$APP.Bg,$APP.Li,$APP.gi,$APP.Li],null)],null),"x-checkbox-change",new $APP.P(null,2,[$APP.wi,!1,$APP.Y,new $APP.P(null,2,[$APP.T,$APP.X,$APP.Si,$APP.Li],null)],null)]);$APP.ka("app.exports.x_checkbox.init",Mr);export const init=Mr;
|
package/dist/x-chip.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var en=function(a){var b=$APP.M(a),c=$APP.I(b,$APP.dh);a=$APP.I(b,$APP.Gi);var d=$APP.I(b,cn);b=$APP.I(b,$APP.$h);c=$APP.n(c)?c:"";d=d==null?!0:!($APP.D.h(d,"false")||$APP.D.h(d,"0"));return new $APP.P(null,4,[$APP.W,c,$APP.T,typeof a==="string"&&a.length>0?a:c,dn,d,$APP.U,$APP.J(b)],null)},fn=function(a){var b=$APP.M(a);a=$APP.I(b,dn);b=$APP.I(b,$APP.U);return $APP.n(a)?$APP.p(b):a},gn=function(a){var b=setTimeout(function(){return a.remove()},400);a.addEventListener("animationend",function d(){clearTimeout(b);
|
|
3
|
+
a.removeEventListener("animationend",d);return a.remove()});return a.setAttribute("data-exiting","")},hn=function(a){var b=en(new $APP.P(null,4,[$APP.dh,a.getAttribute("label"),$APP.Gi,a.getAttribute("value"),cn,a.getAttribute("removable"),$APP.$h,a.hasAttribute("disabled")],null));if($APP.n(fn(b))){var c=$APP.M(b);b=$APP.I(c,$APP.T);c=$APP.I(c,$APP.W);b=new CustomEvent("x-chip-remove",{detail:{value:b,label:c},bubbles:!0,composed:!0,cancelable:!0});a.dispatchEvent(b);a=$APP.p(b.defaultPrevented)?
|
|
4
|
+
gn(a):null}else a=null;return a},kn=function(a){var b=en(new $APP.P(null,4,[$APP.dh,a.getAttribute("label"),$APP.Gi,a.getAttribute("value"),cn,a.getAttribute("removable"),$APP.$h,a.hasAttribute("disabled")],null)),c=$APP.M(b),d=$APP.I(c,$APP.W),e=$APP.I(c,dn);c=$APP.I(c,$APP.U);var f=$APP.l(a,"__xChipRefs"),h=$APP.Ri.g(f);f=jn.g(f);b=fn(b);$APP.n(h)&&(h.textContent=d);$APP.n(e)?a.setAttribute("data-removable",""):a.removeAttribute("data-removable");a.tabIndex=$APP.n(b)?0:-1;$APP.n(b)?a.setAttribute("aria-keyshortcuts",
|
|
5
|
+
"Backspace Delete"):a.removeAttribute("aria-keyshortcuts");$APP.n(f)&&($APP.n(c)?f.setAttribute("disabled",""):f.removeAttribute("disabled"));return null},ln=function(a){function b(e){var f=e.key;return $APP.D.h(f,"Backspace")||$APP.D.h(f,"Delete")?(e.preventDefault(),hn(a)):null}function c(){return hn(a)}var d=jn.g($APP.l(a,"__xChipRefs"));$APP.n(d)&&d.addEventListener("click",c);a.addEventListener("keydown",b);$APP.ma(a,"__xChipHandlers",{click:c,keydown:b})},mn=function(a){var b=$APP.l(a,"__xChipHandlers");
|
|
6
|
+
if($APP.n(b)){var c=$APP.l(a,"__xChipRefs"),d=$APP.l(b,"click");b=$APP.l(b,"keydown");$APP.n($APP.n(c)?d:c)&&(c=jn.g(c),$APP.n(c)&&c.removeEventListener("click",d));$APP.n(b)&&a.removeEventListener("keydown",b)}return a.__xChipHandlers=null},nn=function(a,b){Object.defineProperty(a,b,{get:function(){return this.getAttribute(b)},set:function(c){return c!=null?this.setAttribute(b,""+$APP.S.g(c)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},on=function(a,b){Object.defineProperty(a,b,{get:function(){return this.hasAttribute(b)},
|
|
7
|
+
set:function(c){return $APP.n(c)?this.setAttribute(b,""):this.removeAttribute(b)},enumerable:!0,configurable:!0})},pn=function(a){nn(a,"label");nn(a,"value");on(a,"removable");on(a,"disabled")},rn=function(){var a=class extends HTMLElement{},b=a.prototype;Object.defineProperty(a,"observedAttributes",{get:function(){return qn}});b.connectedCallback=function(){if(!$APP.n($APP.l(this,"__xChipRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("span"),
|
|
8
|
+
f=document.createElement("span"),h=document.createElement("button"),k=document.createElement("span");d.textContent=":host{display:inline-flex;align-items:center;vertical-align:middle;color-scheme:light dark;font-family:inherit;font-size:0.875rem;line-height:1;border-radius:999px;background:rgba(0,0,0,0.08);border:1px solid rgba(0,0,0,0.12);color:rgba(0,0,0,0.80);padding:0.25rem 0.625rem;gap:0.25rem;box-sizing:border-box;cursor:default;user-select:none;outline:none;}@media (prefers-color-scheme:dark){:host{background:rgba(255,255,255,0.10);border-color:rgba(255,255,255,0.16);color:rgba(255,255,255,0.88);}}:host(:focus-visible){outline:2px solid currentColor;outline-offset:2px;}:host([disabled]){opacity:0.55;pointer-events:none;}[part\x3dcontainer]{display:inline-flex;align-items:center;gap:0.25rem;}[part\x3dlabel]{display:inline;font-size:inherit;color:inherit;}[part\x3dremove]{display:none;align-items:center;justify-content:center;width:1rem;height:1rem;border:none;background:none;color:inherit;cursor:pointer;padding:0;border-radius:50%;font-size:1rem;line-height:1;opacity:0.7;flex-shrink:0;}[part\x3dremove]:hover{opacity:1;}[part\x3dremove]:focus-visible{outline:2px solid currentColor;outline-offset:1px;}:host([data-removable]) [part\x3dremove]{display:inline-flex;}@keyframes x-chip-exit{to{opacity:0;transform:scale(0.85);}}:host([data-exiting]){animation:x-chip-exit 300ms forwards;}@media (prefers-reduced-motion:reduce){:host([data-exiting]){animation-duration:0ms;}}";
|
|
9
|
+
e.setAttribute("part","container");f.setAttribute("part","label");h.setAttribute("part","remove");h.setAttribute("type","button");h.setAttribute("aria-label","Remove");k.setAttribute("aria-hidden","true");k.textContent="×";h.appendChild(k);e.appendChild(f);e.appendChild(h);c.appendChild(d);c.appendChild(e);this.__xChipRefs=new $APP.P(null,4,[$APP.sh,c,$APP.ri,e,$APP.Ri,f,jn,h],null)}mn(this);ln(this);return kn(this)};b.disconnectedCallback=function(){return mn(this)};b.attributeChangedCallback=function(c,
|
|
10
|
+
d,e){return $APP.N(d,e)?$APP.n($APP.l(this,"__xChipRefs"))?kn(this):null:null};pn(b);return a},sn=function(){$APP.n(customElements.get("x-chip"))||customElements.define("x-chip",rn());return null},cn=new $APP.K(null,"removable-raw","removable-raw",1718453796),jn=new $APP.K(null,"remove-btn","remove-btn",843430290),dn=new $APP.K(null,"removable?","removable?",1886800649);var qn=["label","value","removable","disabled"];$APP.ka("app.exports.x_chip.init",sn);export const init=sn;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var RH=function(){var a=window.matchMedia;return $APP.n(a)?window.matchMedia("(prefers-reduced-motion: reduce)").matches:a},SH=function(a){a=a.getAttribute("duration-ms");return $APP.n(a)?(a=parseInt(a,10),$APP.n(isNaN(a))?300:$APP.kg.h(0,$APP.lg.h(2E3,a))):300},TH=function(a,b){function c(){clearTimeout(e);b.style.height="";b.style.transition="";return b.removeEventListener("transitionend",$APP.l(f,"fn"))}if($APP.n(RH()))return b.style.height="",b.style.transition="";a=SH(a);b.style.height="0px";
|
|
3
|
+
b.offsetHeight;var d=""+$APP.S.g(b.scrollHeight)+"px";b.style.transition="height "+$APP.S.g(a)+"ms ease";b.style.height=d;var e=setTimeout(function(){b.style.height="";return b.style.transition=""},a+80),f={fn:null};f.fn=c;return b.addEventListener("transitionend",c)},UH=function(a,b){function c(){clearTimeout(e);b.style.height="";b.style.transition="";return b.removeEventListener("transitionend",$APP.l(f,"fn"))}if($APP.n(RH()))return b.style.height="0px",b.style.transition="";var d=""+$APP.S.g(b.offsetHeight)+
|
|
4
|
+
"px";a=SH(a);b.style.height=d;b.offsetHeight;b.style.transition="height "+$APP.S.g(a)+"ms ease";b.style.height="0px";var e=setTimeout(function(){b.style.height="";return b.style.transition=""},a+80),f={fn:null};f.fn=c;return b.addEventListener("transitionend",c)},VH=function(a){var b=$APP.l(a,"__xCollapseRefs");if($APP.n(b)){var c=$APP.l(b,"trigger");b=$APP.l(b,"header-text");var d=a.hasAttribute("open"),e=a.hasAttribute("disabled");a=a.getAttribute("header");b.textContent=$APP.n(a)?a:"";c.setAttribute("aria-expanded",
|
|
5
|
+
$APP.n(d)?"true":"false");return $APP.n(e)?c.setAttribute("disabled",""):c.removeAttribute("disabled")}return null},WH=function(a,b){if($APP.n(a.hasAttribute("disabled")))return null;var c=$APP.p(a.hasAttribute("open"));b=new CustomEvent("x-collapse-toggle",{detail:{open:c,source:b},bubbles:!0,composed:!0,cancelable:!0});a.dispatchEvent(b);return $APP.p(b.defaultPrevented)?(b=$APP.l(a,"__xCollapseRefs"),b=$APP.n(b)?$APP.l(b,"content"):null,c?a.setAttribute("open",""):a.removeAttribute("open"),VH(a),
|
|
6
|
+
$APP.n(b)&&(c?TH(a,b):UH(a,b)),a.dispatchEvent(new CustomEvent("x-collapse-change",{detail:{open:c},bubbles:!0,composed:!0,cancelable:!1}))):null},XH=function(a){return function(){return WH(a,"pointer")}},YH=function(a){return function(b){var c=b.key;return $APP.D.h(c," ")||$APP.D.h(c,"Enter")?(b.preventDefault(),WH(a,"keyboard")):null}},ZH=function(a){var b=$APP.l(a,"__xCollapseRefs");if($APP.n(b)){var c=$APP.l(a,"__xCollapseHandlers");if($APP.n(c)){b=$APP.l(b,"trigger");b.removeEventListener("click",
|
|
7
|
+
$APP.l(c,"click"));b.removeEventListener("keydown",$APP.l(c,"keydown"));a.__xCollapseHandlers=null;return}}return null},$H=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return $APP.n($APP.J(d))?this.setAttribute(c,""):this.removeAttribute(c)}})},aI=function(a){Object.defineProperty(a,"header",{configurable:!0,enumerable:!0,get:function(){var b=this.getAttribute("header");return $APP.n(b)?b:""},set:function(b){b!=
|
|
8
|
+
null&&$APP.N(b)?(b=""+$APP.S.g(b),b=this.setAttribute("header",b)):b=this.removeAttribute("header");return b}})},bI=function(a){Object.defineProperty(a,"durationMs",{configurable:!0,enumerable:!0,get:function(){var b=this.getAttribute("duration-ms");return $APP.n(b)?(b=parseInt(b,10),$APP.n(isNaN(b))?300:b):300},set:function(b){typeof b==="number"&&$APP.p(isNaN(b))?(b=""+$APP.S.g(Math.round(b)),b=this.setAttribute("duration-ms",b)):b=this.removeAttribute("duration-ms");return b}})},dI=function(){var a=
|
|
9
|
+
class extends HTMLElement{},b=a.prototype;Object.defineProperty(a,"observedAttributes",{get:function(){return cI}});$H(b,"open","open");$H(b,"disabled","disabled");aI(b);bI(b);b.toggle=function(){return WH(this,"programmatic")};b.connectedCallback=function(){if(!$APP.n($APP.l(this,"__xCollapseRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("div"),f=document.createElement("button"),h=document.createElement("span"),k=document.createElement("span"),
|
|
10
|
+
m=document.createElement("div"),q=document.createElement("div"),r=document.createElement("slot");d.textContent=":host{display:block;color-scheme:light dark;--x-collapse-border-radius:8px;--x-collapse-border:1px solid #e2e8f0;--x-collapse-bg:#ffffff;--x-collapse-trigger-bg:#f8fafc;--x-collapse-trigger-bg-hover:#f1f5f9;--x-collapse-trigger-color:#0f172a;--x-collapse-trigger-padding:0.75rem 1rem;--x-collapse-content-padding:1rem;--x-collapse-font-size:0.9375rem;--x-collapse-font-weight:600;--x-collapse-chevron-color:#64748b;--x-collapse-focus-ring:#60a5fa;--x-collapse-transition-easing:ease;}@media (prefers-color-scheme:dark){:host{--x-collapse-border:1px solid #334155;--x-collapse-bg:#1e293b;--x-collapse-trigger-bg:#0f172a;--x-collapse-trigger-bg-hover:#1e293b;--x-collapse-trigger-color:#e2e8f0;--x-collapse-chevron-color:#94a3b8;--x-collapse-focus-ring:#93c5fd;}}[part\x3dcontainer]{box-sizing:border-box;border:var(--x-collapse-border);border-radius:var(--x-collapse-border-radius);background:var(--x-collapse-bg);overflow:hidden;}[part\x3dtrigger]{all:unset;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;width:100%;padding:var(--x-collapse-trigger-padding);background:var(--x-collapse-trigger-bg);color:var(--x-collapse-trigger-color);font-size:var(--x-collapse-font-size);font-weight:var(--x-collapse-font-weight);cursor:pointer;user-select:none;}[part\x3dtrigger][disabled]{cursor:default;opacity:0.55;}[part\x3dtrigger]:hover:not([disabled]){background:var(--x-collapse-trigger-bg-hover);}[part\x3dtrigger]:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--x-collapse-focus-ring);}[part\x3dheader-text]{flex:1;text-align:start;}[part\x3dchevron]{display:inline-block;margin-inline-start:0.5rem;color:var(--x-collapse-chevron-color);transition:transform 200ms ease;flex-shrink:0;}:host([open]) [part\x3dchevron]{transform:rotate(180deg);}[part\x3dcontent]{overflow:hidden;height:0;}:host([open]) [part\x3dcontent]{height:auto;}[part\x3dcontent-inner]{padding:var(--x-collapse-content-padding);}@media (prefers-reduced-motion:reduce){[part\x3dcontent]{transition:none !important;}[part\x3dchevron]{transition:none !important;}}";
|
|
11
|
+
e.setAttribute("part","container");f.setAttribute("part","trigger");f.setAttribute("type","button");h.setAttribute("part","header-text");k.setAttribute("part","chevron");k.setAttribute("aria-hidden","true");m.setAttribute("part","content");q.setAttribute("part","content-inner");r.setAttribute("name","content");k.textContent="▼";f.appendChild(h);f.appendChild(k);q.appendChild(r);m.appendChild(q);e.appendChild(f);e.appendChild(m);c.appendChild(d);c.appendChild(e);this.__xCollapseRefs={root:c,trigger:f,
|
|
12
|
+
"header-text":h,content:m}}ZH(this);c=$APP.l(this,"__xCollapseRefs");$APP.n(c)&&(c=$APP.l(c,"trigger"),d=XH(this),e=YH(this),f={click:d,keydown:e},c.addEventListener("click",d),c.addEventListener("keydown",e),this.__xCollapseHandlers=f);return VH(this)};b.disconnectedCallback=function(){return ZH(this)};b.attributeChangedCallback=function(c){a:{if($APP.n($APP.l(this,"__xCollapseRefs"))&&(VH(this),$APP.D.h(c,"open"))){c=$APP.l(this,"__xCollapseRefs");c=$APP.n(c)?$APP.l(c,"content"):null;var d=this.hasAttribute("open");
|
|
13
|
+
c=$APP.n(c)?$APP.n(d)?TH(this,c):UH(this,c):null;break a}c=null}return c};return a},eI=function(){return $APP.n(customElements.get("x-collapse"))?null:customElements.define("x-collapse",dI())};var cI=["open","disabled","header","duration-ms"];$APP.wd(["x-collapse-toggle",new $APP.P(null,2,[$APP.wi,!0,$APP.Y,new $APP.P(null,2,[$APP.si,$APP.Li,$APP.Ch,$APP.X],null)],null),"x-collapse-change",new $APP.P(null,2,[$APP.wi,!1,$APP.Y,new $APP.P(null,1,[$APP.si,$APP.Li],null)],null)]);$APP.ka("app.exports.x_collapse.init",eI);export const init=eI;
|