@vanelsas/baredom 0.2.3-alpha → 0.2.6-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 +8 -1
- package/README.md +4 -4
- package/dist/base.js +118 -118
- package/dist/x-alert.js +19 -19
- package/dist/x-avatar-group.js +10 -10
- package/dist/x-avatar.js +15 -15
- package/dist/x-badge.js +11 -11
- package/dist/x-breadcrumbs.js +11 -11
- package/dist/x-button.js +15 -15
- package/dist/x-cancel-dialogue.js +16 -16
- package/dist/x-card.js +7 -7
- package/dist/x-chart.js +47 -47
- package/dist/x-checkbox.js +11 -11
- package/dist/x-chip.js +7 -7
- package/dist/x-collapse.js +11 -11
- package/dist/x-command-palette.js +31 -31
- package/dist/x-container.js +6 -6
- package/dist/x-context-menu.js +17 -17
- package/dist/x-copy.js +22 -23
- package/dist/x-currency-field.js +22 -20
- package/dist/x-date-picker.js +42 -36
- package/dist/x-divider.js +9 -9
- package/dist/x-drawer.js +11 -11
- package/dist/x-dropdown.js +4 -4
- package/dist/x-fieldset.js +6 -6
- package/dist/x-file-download.js +7 -7
- package/dist/x-form-field.js +15 -15
- package/dist/x-form.js +10 -10
- package/dist/x-grid.js +7 -7
- package/dist/x-menu-item.js +6 -6
- package/dist/x-menu.js +10 -10
- package/dist/x-modal.js +11 -11
- package/dist/x-navbar.js +10 -10
- package/dist/x-notification-center.js +8 -8
- package/dist/x-pagination.js +16 -16
- package/dist/x-popover.js +6 -6
- package/dist/x-progress-circle.js +8 -8
- package/dist/x-progress.js +7 -7
- package/dist/x-radio.js +9 -9
- package/dist/x-search-field.js +10 -10
- package/dist/x-select.js +9 -9
- package/dist/x-sidebar.js +18 -18
- package/dist/x-skeleton.js +6 -6
- package/dist/x-slider.js +16 -16
- package/dist/x-spacer.js +5 -5
- package/dist/x-spinner.js +5 -5
- package/dist/x-stat.js +9 -9
- package/dist/x-stepper.js +14 -14
- package/dist/x-switch.js +10 -10
- package/dist/x-tab.js +6 -6
- package/dist/x-table-cell.js +23 -23
- package/dist/x-table-row.js +10 -10
- package/dist/x-table.js +14 -14
- package/dist/x-tabs.js +11 -11
- package/dist/x-text-area.js +12 -12
- package/dist/x-timeline-item.js +23 -23
- package/dist/x-timeline.js +7 -7
- package/dist/x-toast.js +17 -17
- package/dist/x-toaster.js +7 -7
- package/package.json +1 -1
package/dist/x-collapse.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
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(g,"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.
|
|
4
|
-
"px";a=SH(a);b.style.height=d;b.offsetHeight;b.style.transition="height "+$APP.
|
|
5
|
-
$APP.n(d)?"true":"false");
|
|
6
|
-
|
|
7
|
-
$APP.l(c,"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
e.setAttribute("part","container");g.setAttribute("part","trigger");g.setAttribute("type","button");h.setAttribute("part","header-text");k.setAttribute("part","chevron");k.setAttribute("aria-hidden","true");m.setAttribute("part","content");
|
|
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),g={click:d,keydown:e},c.addEventListener("click",d),c.addEventListener("keydown",e),this.__xCollapseHandlers=g);return VH(this)};b.disconnectedCallback=function(){return ZH(this)};b.attributeChangedCallback=
|
|
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.
|
|
3
|
+
b.offsetHeight;var d=""+$APP.T.g(b.scrollHeight)+"px";b.style.transition="height "+$APP.T.g(a)+"ms ease";b.style.height=d;var e=setTimeout(function(){b.style.height="";return b.style.transition=""},a+80),g={fn:null};g.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(g,"fn"))}if($APP.n(RH()))return b.style.height="0px",b.style.transition="";var d=""+$APP.T.g(b.offsetHeight)+
|
|
4
|
+
"px";a=SH(a);b.style.height=d;b.offsetHeight;b.style.transition="height "+$APP.T.g(a)+"ms ease";b.style.height="0px";var e=setTimeout(function(){b.style.height="";return b.style.transition=""},a+80),g={fn:null};g.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");if($APP.n(e))return c.setAttribute("disabled",""),c.setAttribute("aria-disabled","true");c.removeAttribute("disabled");return c.removeAttribute("aria-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)?(c?a.setAttribute("open",""):a.removeAttribute("open"),
|
|
6
|
+
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.C.h(c," ")||$APP.C.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",$APP.l(c,"click"));b.removeEventListener("keydown",
|
|
7
|
+
$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.K(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!=null&&$APP.O(b)?(b=""+$APP.T.g(b),b=this.setAttribute("header",
|
|
8
|
+
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.T.g(Math.round(b)),b=this.setAttribute("duration-ms",b)):b=this.removeAttribute("duration-ms");return b}})},dI=function(){var a=class extends HTMLElement{},b=a.prototype;Object.defineProperty(a,
|
|
9
|
+
"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"),g=document.createElement("button"),h=document.createElement("span"),k=document.createElement("span"),m=document.createElement("div"),q=document.createElement("div"),
|
|
10
|
+
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;}@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");g.setAttribute("part","trigger");g.setAttribute("type","button");g.setAttribute("id","trigger");g.setAttribute("aria-controls","panel");h.setAttribute("part","header-text");k.setAttribute("part","chevron");k.setAttribute("aria-hidden","true");m.setAttribute("part","content");m.setAttribute("id","panel");m.setAttribute("role","region");m.setAttribute("aria-labelledby","trigger");q.setAttribute("part","content-inner");r.setAttribute("name","content");k.textContent=
|
|
12
|
+
"▼";g.appendChild(h);g.appendChild(k);q.appendChild(r);m.appendChild(q);e.appendChild(g);e.appendChild(m);c.appendChild(d);c.appendChild(e);this.__xCollapseRefs={root:c,trigger:g,"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),g={click:d,keydown:e},c.addEventListener("click",d),c.addEventListener("keydown",e),this.__xCollapseHandlers=g);return VH(this)};b.disconnectedCallback=function(){return ZH(this)};b.attributeChangedCallback=
|
|
13
|
+
function(c){a:{if($APP.n($APP.l(this,"__xCollapseRefs"))&&(VH(this),$APP.C.h(c,"open"))){c=$APP.l(this,"__xCollapseRefs");c=$APP.n(c)?$APP.l(c,"content"):null;var d=this.hasAttribute("open");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.Q(null,2,[$APP.ui,!0,$APP.Y,new $APP.Q(null,2,[$APP.qi,$APP.Ji,$APP.Bh,$APP.X],null)],null),"x-collapse-change",new $APP.Q(null,2,[$APP.ui,!1,$APP.Y,new $APP.Q(null,1,[$APP.qi,$APP.Ji],null)],null)]);$APP.ka("baredom.exports.x_collapse.init",eI);export const init=eI;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var Fo=function(a){if(a!=null&&a.sa!=null)a=a.sa(a);else{var b=Fo[$APP.da(a==null?null:a)];if(b!=null)a=b.g?b.g(a):b.call(null,a);else if(b=Fo._,b!=null)a=b.g?b.g(a):b.call(null,a);else throw $APP.sa("IStack.-pop",a);}return a},Go=function(a,b){return $APP.jd($APP.Fc(function(c,d){return $APP.n(a.g?a.g(d):a.call(null,d))?$APP.ib(c,d):c},$APP.hb($APP.Ld),b))},Ho=function(a){var b=/\s+/;a="/(?:)/"===""+$APP.
|
|
3
|
-
if(1<$APP.B(a))a:{for(;;)if(""===(a==null?null:$APP.Pa(a)))a=a==null?null:Fo(a);else break a;a=void 0}return a},Io=function(a){return a==null?!0:$APP.
|
|
4
|
-
A:""}()),k=Jo(e.group),m=e.value,q=e.icon,r=$APP.
|
|
5
|
-
2,[$APP.Uh,a,No,$APP.Be.h($APP.sf,$APP.Cd(Ko,a))],null);a=Go(function(d){return $APP.zd(function(e){return $APP.
|
|
6
|
-
$APP.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"");
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
function(){return $APP.n(this.hasAttribute("open"))?
|
|
22
|
-
|
|
2
|
+
var Fo=function(a){if(a!=null&&a.sa!=null)a=a.sa(a);else{var b=Fo[$APP.da(a==null?null:a)];if(b!=null)a=b.g?b.g(a):b.call(null,a);else if(b=Fo._,b!=null)a=b.g?b.g(a):b.call(null,a);else throw $APP.sa("IStack.-pop",a);}return a},Go=function(a,b){return $APP.jd($APP.Fc(function(c,d){return $APP.n(a.g?a.g(d):a.call(null,d))?$APP.ib(c,d):c},$APP.hb($APP.Ld),b))},Ho=function(a){var b=/\s+/;a="/(?:)/"===""+$APP.T.g(b)?$APP.ff.h($APP.be($APP.Xc("",$APP.Id.h($APP.T,$APP.u(a)))),""):$APP.be((""+$APP.T.g(a)).split(b));
|
|
3
|
+
if(1<$APP.B(a))a:{for(;;)if(""===(a==null?null:$APP.Pa(a)))a=a==null?null:Fo(a);else break a;a=void 0}return a},Io=function(a){return a==null?!0:$APP.O(a,"false")},Jo=function(a){return typeof a==="string"?(a=a.trim(),$APP.O(a,"")?a:null):null},Mo=function(a){if(a==null||$APP.p($APP.pa(a)))return $APP.Ld;for(var b=a.length,c=0,d=$APP.hb($APP.Ld);;){if($APP.C.h(c,b))return $APP.jb(d);var e=a[c],g=""+$APP.T.g(function(){var A=e.id;return $APP.n(A)?A:c}()),h=""+$APP.T.g(function(){var A=e.label;return $APP.n(A)?
|
|
4
|
+
A:""}()),k=Jo(e.group),m=e.value,q=e.icon,r=$APP.C.h(!0,e.disabled),v=e.keywords;v=$APP.n($APP.pa(v))?v.join(" "):typeof v==="string"?v:"";var w=function(){var A=k;return $APP.n(A)?A:""}(),z=typeof m==="string"?m:"";w=(""+$APP.T.g(h)+" "+$APP.T.g(v)+" "+$APP.T.g(w)+" "+$APP.T.g(z)).toLowerCase();v=c+1;d=$APP.kd(d,new $APP.Q(null,7,[$APP.Hh,g,$APP.W,h,Ko,k,$APP.U,m,$APP.Zg,q,$APP.V,r,Lo,w],null));c=v}},Oo=function(a,b){b=typeof b==="string"?b.trim():"";var c=$APP.O(b,"")?$APP.Cd(Jo,Ho(b)):null;if($APP.rc(c))return new $APP.Q(null,
|
|
5
|
+
2,[$APP.Uh,a,No,$APP.Be.h($APP.sf,$APP.Cd(Ko,a))],null);a=Go(function(d){return $APP.zd(function(e){return $APP.O(-1,Lo.g(d).indexOf(e.toLowerCase()))},c)},a);return new $APP.Q(null,2,[$APP.Uh,a,No,$APP.Be.h($APP.sf,$APP.Cd(Ko,a))],null)},Po=function(a,b,c){var d=$APP.B(a);if(d>0)for(var e=1;;)if(e<=d){var g=$APP.Qc(b+e*c,d),h=$APP.H(a,g,null),k=h;h=$APP.n(k)?$APP.p($APP.V.g(h)):k;if($APP.n(h))return g;e+=1}else return null;else return null},bp=function(a){var b=$APP.N(a);a=$APP.J(b,$APP.qh);var c=
|
|
6
|
+
$APP.J(b,$APP.vh),d=$APP.J(b,$APP.ch),e=$APP.J(b,Qo),g=$APP.J(b,Ro),h=$APP.J(b,So),k=$APP.J(b,To),m=$APP.J(b,Uo),q=$APP.J(b,Vo);b=$APP.J(b,Wo);b=Io(b);q=Io(q);m=m!=null&&$APP.O(m,"false");m=b&&!m;g=g!=null?g!=null&&$APP.O(g,"false"):m;k=Io(k);return $APP.cf([$APP.Bi,$APP.uh,Xo,Yo,Zo,$o,$APP.W,$APP.Ni,ap,$APP.V],[function(){var r=Jo(c);return $APP.n(r)?r:"Search…"}(),q,function(){var r=Jo(e);return $APP.n(r)?r:"No results"}(),g,k,m,Jo(d),$APP.K(a),b,h!=null&&$APP.O(h,"false")])},cp=function(a){return document.createElement(a)},
|
|
7
|
+
dp=function(a){return bp($APP.cf([$APP.ch,Qo,Ro,So,To,Uo,Vo,Wo,$APP.qh,$APP.vh],[a.getAttribute("label"),a.getAttribute("empty-text"),a.getAttribute("close-on-scrim"),a.getAttribute("disabled"),a.getAttribute("close-on-escape"),a.getAttribute("no-scrim"),a.getAttribute("dismissible"),a.getAttribute("modal"),a.hasAttribute("open"),a.getAttribute("placeholder")]))},ep=function(a,b,c,d){b=new CustomEvent(b,{detail:d,bubbles:!0,composed:!0,cancelable:$APP.K(c)});a.dispatchEvent(b);return b},fp=function(a){var b=
|
|
8
|
+
$APP.l(a,"__xCommandPaletteRefs");if($APP.n(b)){var c=$APP.l(b,"list"),d=$APP.l(b,"empty");b=$APP.l(b,"input");var e=function(){var r=$APP.l(a,"__xCommandPaletteQuery");return $APP.n(r)?r:""}(),g=Mo($APP.l(a,"__xCommandPaletteItems"));e=Oo(g,e);e=$APP.N(e);g=$APP.J(e,$APP.Uh);e=function(){var r=$APP.l(a,"__xCommandPaletteActiveIdx");return $APP.n(r)?r:0}();c.textContent="";if($APP.rc(g))return d.removeAttribute("hidden"),$APP.n(b)?b.removeAttribute("aria-activedescendant"):null;d.setAttribute("hidden",
|
|
9
|
+
"");d=$APP.Bd($APP.og,g);for(var h=null;;)if(g=$APP.x(d),$APP.n(g)){var k=g;g=$APP.H(k,0,null);k=$APP.H(k,1,null);var m=Ko.g(k);if($APP.n(function(){var r=m;return $APP.n(r)?$APP.O(m,h):r}())){var q=cp("div");q.setAttribute("part","group-header");q.setAttribute("aria-hidden","true");q.textContent=m;c.appendChild(q)}q=cp("div");q.setAttribute("part","item");q.setAttribute("role","option");q.setAttribute("id","x-cp-item-"+$APP.T.g(g));q.setAttribute("data-id",""+$APP.T.g($APP.Hh.g(k)));q.setAttribute("data-idx",
|
|
10
|
+
""+$APP.T.g(g));q.setAttribute("tabindex","-1");$APP.n($APP.V.g(k))&&q.setAttribute("aria-disabled","true");q.textContent=$APP.W.g(k);$APP.C.h(g,e)&&q.setAttribute("aria-selected","true");c.appendChild(q);d=$APP.Mb(d);h=g=function(){var r=m;return $APP.n(r)?r:h}()}else break;return $APP.n(b)?b.setAttribute("aria-activedescendant","x-cp-item-"+$APP.T.g(e)):null}return null},gp=function(a){var b=$APP.l(a,"__xCommandPaletteRefs");if($APP.n(b)){var c=dp(a),d=$APP.l(b,"panel"),e=$APP.l(b,"input"),g=$APP.l(b,
|
|
11
|
+
"overlay");b=$APP.l(b,"empty");var h=$APP.W.g(c),k=$APP.Bi.g(c),m=Xo.g(c);$APP.n(h)?d.setAttribute("aria-label",h):d.setAttribute("aria-label","Command palette");$APP.n($o.g(c))?g.removeAttribute("hidden"):g.setAttribute("hidden","");e.setAttribute("placeholder",k);e.setAttribute("aria-expanded",$APP.n($APP.Ni.g(c))?"true":"false");$APP.n($APP.V.g(c))&&(e.setAttribute("disabled",""),e.setAttribute("aria-disabled","true"));$APP.n($APP.V.g(c))||(e.removeAttribute("disabled"),e.removeAttribute("aria-disabled"));
|
|
12
|
+
b.textContent=m;return fp(a)}return null},hp=function(a){if($APP.n(a.hasAttribute("open")))return null;var b=ep(a,"x-command-palette-open-request",!0,{});$APP.n(b.defaultPrevented)?a=null:(a.setAttribute("open",""),b=$APP.l(a,"__xCommandPaletteRefs"),b=$APP.n(b)?$APP.l(b,"input"):null,$APP.n(b)&&b.focus(),gp(a),a=ep(a,"x-command-palette-open",!1,{}));return a},ip=function(a){if($APP.n(a.hasAttribute("open"))){var b=ep(a,"x-command-palette-close-request",!0,{});$APP.n(b.defaultPrevented)?a=null:(a.removeAttribute("open"),
|
|
13
|
+
b=$APP.l(a,"__xCommandPaletteRefs"),b=$APP.n(b)?$APP.l(b,"input"):null,$APP.n(b)&&b.removeAttribute("aria-activedescendant"),gp(a),a=ep(a,"x-command-palette-close",!1,{}));return a}return null},jp=function(a){var b=$APP.l(a,"__xCommandPaletteQuery");b=$APP.n(b)?b:"";a=Mo($APP.l(a,"__xCommandPaletteItems"));a=Oo(a,b);a=$APP.N(a);return $APP.J(a,$APP.Uh)},lp=function(a,b){var c=jp(a);var d=$APP.l(a,"__xCommandPaletteActiveIdx");d=$APP.n(d)?d:0;$APP.C.h(b,kp)?(c=Po(c,$APP.n(d)?d:-1,1),c=$APP.n(c)?c:
|
|
14
|
+
0):(b=$APP.B(c),c=Po(c,$APP.n(d)?d:b,-1),c=$APP.n(c)?c:0);a.__xCommandPaletteActiveIdx=c;fp(a);a=$APP.l(a,"__xCommandPaletteRefs");a=$APP.n(a)?$APP.l(a,"list"):null;a=$APP.n(a)?a.querySelector("[data-idx\x3d'"+$APP.T.g(c)+"']"):null;return $APP.n(a)?a.scrollIntoView({block:"nearest"}):null},np=function(a,b){var c=b.key;return $APP.C.h(c,"ArrowDown")?(b.preventDefault(),lp(a,kp)):$APP.C.h(c,"ArrowUp")?(b.preventDefault(),lp(a,mp)):$APP.C.h(c,"Enter")?(b.preventDefault(),b=jp(a),c=$APP.l(a,"__xCommandPaletteActiveIdx"),
|
|
15
|
+
b=$APP.H(b,$APP.n(c)?c:0,null),$APP.n($APP.n(b)?$APP.p($APP.V.g(b)):b)?(c=ep(a,"x-command-palette-select-request",!0,{item:$APP.xg(b)}),$APP.n(c.defaultPrevented)?a=null:(ep(a,"x-command-palette-select",!1,{item:$APP.xg(b)}),a=ip(a))):a=null,a):$APP.C.h(c,"Escape")?(b=dp(a),$APP.n(Zo.g(b))?ip(a):null):null},op=function(a){function b(){var r=$APP.l(a,"__xCommandPaletteRefs"),v=$APP.n(r)?$APP.l(r,"input"):null;r=$APP.n(r)?$APP.l(r,"clear-btn"):null;$APP.n(v)&&(v.value="");$APP.n(r)&&r.setAttribute("hidden",
|
|
16
|
+
"");a.__xCommandPaletteQuery="";a.__xCommandPaletteActiveIdx=0;ep(a,"x-command-palette-query-change",!1,{query:""});fp(a);return $APP.n(v)?v.focus():null}function c(r){a:{r=r.target.closest("[part\x3ditem]");if($APP.n(r)){r=parseInt(r.getAttribute("data-idx"),10);var v=jp(a);r=$APP.H(v,r,null);if($APP.n($APP.n(r)?$APP.p($APP.V.g(r)):r)){v=ep(a,"x-command-palette-select-request",!0,{item:$APP.xg(r)});if($APP.n(v.defaultPrevented)){r=null;break a}ep(a,"x-command-palette-select",!1,{item:$APP.xg(r)});
|
|
17
|
+
r=ip(a);break a}}r=null}return r}function d(){var r=dp(a);return $APP.n(Yo.g(r))?ip(a):null}function e(r){return np(a,r)}function g(){var r=$APP.l(a,"__xCommandPaletteRefs"),v=$APP.n(r)?$APP.l(r,"input"):null;r=$APP.n(r)?$APP.l(r,"clear-btn"):null;v=$APP.n(v)?v.value:null;a.__xCommandPaletteQuery=$APP.n(v)?v:"";a.__xCommandPaletteActiveIdx=0;$APP.n(r)&&($APP.n($APP.n(v)?$APP.O(v,""):v)?r.removeAttribute("hidden"):r.setAttribute("hidden",""));ep(a,"x-command-palette-query-change",!1,{query:$APP.n(v)?
|
|
18
|
+
v:""});return fp(a)}var h=$APP.l(a,"__xCommandPaletteRefs"),k=$APP.l(h,"input"),m=$APP.l(h,"overlay"),q=$APP.l(h,"list");h=$APP.l(h,"clear-btn");k.addEventListener("input",g);k.addEventListener("keydown",e);m.addEventListener("click",d);q.addEventListener("click",c);h.addEventListener("click",b);$APP.ma(a,"__xCommandPaletteHandlers",{input:g,keydown:e,scrim:d,list:c,clear:b})},pp=function(a){var b=$APP.l(a,"__xCommandPaletteRefs");a=$APP.l(a,"__xCommandPaletteHandlers");if($APP.n($APP.n(b)?a:b)){var c=
|
|
19
|
+
$APP.l(b,"input"),d=$APP.l(b,"overlay"),e=$APP.l(b,"list");b=$APP.l(b,"clear-btn");c.removeEventListener("input",$APP.l(a,"input"));c.removeEventListener("keydown",$APP.l(a,"keydown"));d.removeEventListener("click",$APP.l(a,"scrim"));e.removeEventListener("click",$APP.l(a,"list"));return b.removeEventListener("click",$APP.l(a,"clear"))}return null},qp=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)?
|
|
20
|
+
this.setAttribute(c,""):this.removeAttribute(c)}})},rp=function(a){Object.defineProperty(a,"items",{configurable:!0,enumerable:!0,get:function(){var b=$APP.l(this,"__xCommandPaletteItems");return $APP.n(b)?b:[]},set:function(b){this.__xCommandPaletteItems=b;this.__xCommandPaletteActiveIdx=0;return fp(this)}})},sp=function(a){Object.defineProperty(a,"open",{configurable:!0,writable:!0,value:function(){return hp(this)}});Object.defineProperty(a,"close",{configurable:!0,writable:!0,value:function(){return ip(this)}});
|
|
21
|
+
Object.defineProperty(a,"toggle",{configurable:!0,writable:!0,value:function(){return $APP.n(this.hasAttribute("open"))?ip(this):hp(this)}})},up=function(){var a=class extends HTMLElement{};a.observedAttributes=tp;var b=a.prototype;qp(b,"open","open");qp(b,"disabled","disabled");rp(b);sp(b);b.connectedCallback=function(){if(!$APP.n($APP.l(this,"__xCommandPaletteRefs"))){var c=this.attachShadow({mode:"open"}),d=cp("style"),e=cp("div"),g=cp("div"),h=cp("div"),k=cp("span"),m=cp("input"),q=cp("button"),
|
|
22
|
+
r=cp("div"),v=cp("div"),w=cp("div");d.textContent=":host{display:contents;}[part\x3doverlay]{display:none;position:fixed;inset:0;background:rgba(0,0,0,0.45);z-index:var(--x-command-palette-z,800);}[part\x3dpanel]{display:none;position:fixed;top:20vh;left:50%;transform:translateX(-50%);width:var(--x-command-palette-width,560px);max-height:60vh;z-index:calc(var(--x-command-palette-z,800) + 1);flex-direction:column;border-radius:var(--x-command-palette-radius,12px);background:var(--x-command-palette-bg,#fff);box-shadow:0 20px 60px rgba(0,0,0,0.25),0 4px 16px rgba(0,0,0,0.12);overflow:hidden;}:host([open]) [part\x3doverlay]{display:block;}:host([open]) [part\x3dpanel]{display:flex;}[part\x3dsearch-wrap]{display:flex;align-items:center;gap:8px;padding:12px 16px;border-bottom:1px solid var(--x-command-palette-divider,rgba(0,0,0,0.08));}[part\x3dsearch-icon]{flex:none;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;color:var(--x-command-palette-icon-color,#64748b);}[part\x3dinput]{flex:1;border:none;outline:none;background:transparent;font-size:1rem;line-height:1.5;color:var(--x-command-palette-text,inherit);}[part\x3dinput]::placeholder{color:var(--x-command-palette-placeholder,#94a3b8);}[part\x3dclear-btn]{all:unset;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;color:var(--x-command-palette-icon-color,#64748b);}[part\x3dclear-btn]:focus-visible{outline:2px solid var(--x-command-palette-focus-ring,#60a5fa);}[part\x3dclear-btn][hidden]{display:none;}[part\x3dlist-wrap]{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:8px 0;}[part\x3dlist]{display:flex;flex-direction:column;}[part\x3ditem]{padding:10px 16px;cursor:default;font-size:0.9375rem;line-height:1.4;color:var(--x-command-palette-item-text,inherit);border-radius:0;outline:none;}[part\x3ditem]:hover,[part\x3ditem]:focus{background:var(--x-command-palette-item-hover,#f1f5f9);}[part\x3ditem][aria-selected\x3dtrue]{background:var(--x-command-palette-item-active,#e0e7ff);color:var(--x-command-palette-item-active-text,#3730a3);}[part\x3ditem][aria-disabled\x3dtrue]{opacity:0.45;cursor:default;pointer-events:none;}[part\x3dgroup-header]{padding:8px 16px 4px;font-size:0.75rem;font-weight:600;letter-spacing:0.05em;text-transform:uppercase;color:var(--x-command-palette-group-text,#94a3b8);}[part\x3dempty]{padding:32px 16px;text-align:center;color:var(--x-command-palette-empty-text,#94a3b8);font-size:0.9375rem;}[part\x3dempty][hidden]{display:none;}@media (prefers-color-scheme:dark){[part\x3dpanel]{background:var(--x-command-palette-bg,#1e293b);box-shadow:0 20px 60px rgba(0,0,0,0.6),0 4px 16px rgba(0,0,0,0.4);}[part\x3dsearch-wrap]{border-bottom-color:var(--x-command-palette-divider,rgba(255,255,255,0.08));}[part\x3ditem]:hover,[part\x3ditem]:focus{background:var(--x-command-palette-item-hover,#334155);}[part\x3ditem][aria-selected\x3dtrue]{background:var(--x-command-palette-item-active,#312e81);color:var(--x-command-palette-item-active-text,#c7d2fe);}}@media (prefers-reduced-motion:reduce){[part\x3dpanel],[part\x3doverlay]{transition:none;}}";
|
|
23
23
|
e.setAttribute("part","overlay");g.setAttribute("part","panel");g.setAttribute("role","dialog");g.setAttribute("aria-modal","true");h.setAttribute("part","search-wrap");k.setAttribute("part","search-icon");k.setAttribute("aria-hidden","true");k.textContent="\ud83d\udd0d";m.setAttribute("part","input");m.setAttribute("type","search");m.setAttribute("role","combobox");m.setAttribute("autocomplete","off");m.setAttribute("autocorrect","off");m.setAttribute("spellcheck","false");m.setAttribute("aria-autocomplete",
|
|
24
|
-
"list");m.setAttribute("aria-expanded","false");q.setAttribute("part","clear-btn");q.setAttribute("type","button");q.setAttribute("aria-label","Clear");q.setAttribute("hidden","");r.setAttribute("part","list-wrap");v.setAttribute("part","list");v.setAttribute("role","listbox");v.setAttribute("aria-label","Results");w.setAttribute("part","empty");w.setAttribute("hidden","");h.appendChild(k);h.appendChild(m);h.appendChild(q);
|
|
25
|
-
c.appendChild(e);c.appendChild(g);this.__xCommandPaletteRefs={overlay:e,panel:g,input:m,"clear-btn":q,list:v,empty:w}}
|
|
26
|
-
c=$APP.Pd(c);c.i[e]=a;return c}if(e===0)return null;c=$APP.Pd(c);c.i[e]=null;return c};$APP.Uc.prototype.sa=$APP.ca(30,function(){return this.ga(null)});$APP.Vc.prototype.sa=$APP.ca(29,function(){throw Error("Can't pop empty list");});
|
|
27
|
-
$APP.
|
|
28
|
-
$APP.ue.prototype.sa=$APP.ca(27,function(){return new $APP.
|
|
29
|
-
var
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
$APP.wd(["x-command-palette-open-request",new $APP.
|
|
33
|
-
$APP.Y,new $APP.
|
|
24
|
+
"list");m.setAttribute("aria-expanded","false");m.setAttribute("aria-controls","x-cp-list");q.setAttribute("part","clear-btn");q.setAttribute("type","button");q.setAttribute("aria-label","Clear");q.setAttribute("hidden","");r.setAttribute("part","list-wrap");v.setAttribute("part","list");v.setAttribute("id","x-cp-list");v.setAttribute("role","listbox");v.setAttribute("aria-label","Results");w.setAttribute("part","empty");w.setAttribute("hidden","");h.appendChild(k);h.appendChild(m);h.appendChild(q);
|
|
25
|
+
r.appendChild(v);r.appendChild(w);g.appendChild(h);g.appendChild(r);c.appendChild(d);c.appendChild(e);c.appendChild(g);this.__xCommandPaletteRefs={overlay:e,panel:g,input:m,"clear-btn":q,list:v,empty:w}}pp(this);op(this);return gp(this)};b.disconnectedCallback=function(){return pp(this)};b.attributeChangedCallback=function(){return gp(this)};return a},vp=function(){return $APP.n(customElements.get("x-command-palette"))?null:customElements.define("x-command-palette",up())},wp=function wp(a,b,c){var e=
|
|
26
|
+
a.j-2>>>b&31;if(b>5){b-=5;var g=c.i[e];a=wp.m?wp.m(a,b,g):wp.call(null,a,b,g);if(a==null&&e===0)return null;c=$APP.Pd(c);c.i[e]=a;return c}if(e===0)return null;c=$APP.Pd(c);c.i[e]=null;return c};$APP.Uc.prototype.sa=$APP.ca(30,function(){return this.ga(null)});$APP.Vc.prototype.sa=$APP.ca(29,function(){throw Error("Can't pop empty list");});
|
|
27
|
+
$APP.P.prototype.sa=$APP.ca(28,function(){if(this.j===0)throw Error("Can't pop empty vector");if(1===this.j)return $APP.Ua($APP.Ld,this.s);if(1<this.j-$APP.Qd(this))return new $APP.P(this.s,this.j-1,this.shift,this.root,this.la.slice(0,-1),null);var a=$APP.Sd(this,this.j-2),b=wp(this,this.shift,this.root);b=b==null?$APP.Xd:b;var c=this.j-1;return 5<this.shift&&b.i[1]==null?new $APP.P(this.s,c,this.shift-5,b.i[0],a,null):new $APP.P(this.s,c,this.shift,b,a,null)});
|
|
28
|
+
$APP.ue.prototype.sa=$APP.ca(27,function(){return new $APP.P(null,1,5,$APP.Xd,[this.key],null)});$APP.jf.prototype.sa=$APP.ca(26,function(){return new $APP.P(null,1,5,$APP.Xd,[this.key],null)});$APP.kf.prototype.sa=$APP.ca(25,function(){return new $APP.P(null,1,5,$APP.Xd,[this.key],null)});
|
|
29
|
+
var Xo=new $APP.M(null,"empty-text","empty-text",1554384594),Yo=new $APP.M(null,"close-on-scrim?","close-on-scrim?",-367113965),Ro=new $APP.M(null,"close-on-scrim-raw","close-on-scrim-raw",159828234),Qo=new $APP.M(null,"empty-text-raw","empty-text-raw",1477406757),xp=new $APP.Gb(null,"object","object",-1179821820,null),Ko=new $APP.M(null,"group","group",582596132),Vo=new $APP.M(null,"dismissible-raw","dismissible-raw",947680658),kp=new $APP.M(null,"down","down",1565245570),Lo=new $APP.M(null,"search-str",
|
|
30
|
+
"search-str",-821246171),Wo=new $APP.M(null,"modal-raw","modal-raw",-263722282),Zo=new $APP.M(null,"close-on-escape?","close-on-escape?",-1559868909),mp=new $APP.M(null,"up","up",-269712113),ap=new $APP.M(null,"modal?","modal?",2146094679),No=new $APP.M(null,"groups","groups",-136896102),To=new $APP.M(null,"close-on-escape-raw","close-on-escape-raw",-1942646255),$o=new $APP.M(null,"scrim?","scrim?",744210580),Uo=new $APP.M(null,"no-scrim-raw","no-scrim-raw",-1344365743),So=new $APP.M(null,"disabled-raw",
|
|
31
|
+
"disabled-raw",498098381),yp=new $APP.M(null,"item","item",249373802);var tp="open modal dismissible disabled no-scrim close-on-scrim close-on-escape label placeholder empty-text".split(" ");
|
|
32
|
+
$APP.wd(["x-command-palette-open-request",new $APP.Q(null,2,[$APP.ui,!0,$APP.Y,$APP.xd],null),"x-command-palette-open",new $APP.Q(null,2,[$APP.ui,!1,$APP.Y,$APP.xd],null),"x-command-palette-close-request",new $APP.Q(null,2,[$APP.ui,!0,$APP.Y,$APP.xd],null),"x-command-palette-close",new $APP.Q(null,2,[$APP.ui,!1,$APP.Y,$APP.xd],null),"x-command-palette-select-request",new $APP.Q(null,2,[$APP.ui,!0,$APP.Y,new $APP.Q(null,1,[yp,xp],null)],null),"x-command-palette-select",new $APP.Q(null,2,[$APP.ui,!1,
|
|
33
|
+
$APP.Y,new $APP.Q(null,1,[yp,xp],null)],null),"x-command-palette-query-change",new $APP.Q(null,2,[$APP.ui,!1,$APP.Y,new $APP.Q(null,1,[new $APP.M(null,"query","query",-1288509510),$APP.X],null)],null)]);$APP.ka("baredom.exports.x_command_palette.init",vp);export const init=vp;
|
package/dist/x-container.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
this.removeAttribute("center"):this.setAttribute("center","false")}})},
|
|
4
|
-
"lg"),$APP.Li,
|
|
5
|
-
a=$APP.W.g(a);return $APP.n(a)?b.setAttribute("aria-label",a):b.removeAttribute("aria-label")},
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
var Gv=function(a,b,c){return typeof a==="string"&&$APP.Cc(b,a)?a:c},Hv=function(a){return a.__xContainerState},Iv=function(a){Object.defineProperty(a,"fluid",{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute("fluid")},set:function(b){return $APP.n($APP.K(b))?this.setAttribute("fluid",""):this.removeAttribute("fluid")}})},Jv=function(a){Object.defineProperty(a,"center",{configurable:!0,enumerable:!0,get:function(){return $APP.O("false",this.getAttribute("center"))},set:function(b){return $APP.K(b)?
|
|
3
|
+
this.removeAttribute("center"):this.setAttribute("center","false")}})},Qv=function(a,b){var c=a.getAttribute("as"),d=a.getAttribute("size"),e=a.getAttribute("padding"),g=$APP.O("false",a.getAttribute("center"));a=new $APP.Q(null,6,[Kv,c,$APP.Ag,d,$APP.Li,e,Lv,g,Mv,a.hasAttribute("fluid"),$APP.W,a.getAttribute("label")],null);var h=$APP.N(a);a=$APP.J(h,Kv);c=$APP.J(h,$APP.Ag);d=$APP.J(h,$APP.Li);e=$APP.J(h,Lv);g=$APP.J(h,Mv);h=$APP.J(h,$APP.W);a=new $APP.Q(null,6,[Kv,Gv(a,Nv,"div"),$APP.Ag,Gv(c,Ov,
|
|
4
|
+
"lg"),$APP.Li,Gv(d,Pv,"md"),Lv,$APP.K(e),Mv,$APP.K(g),$APP.W,typeof h==="string"&&$APP.O(h,"")?h:null],null);g=Kv.g(a);c=b.base;$APP.O(c.tagName.toLowerCase(),g)&&(d=b.root,e=b.slot,g=document.createElement(g),g.setAttribute("part","base"),g.appendChild(e),d.replaceChild(g,c),b.base=g);b=b.base;b.setAttribute("data-size",$APP.Ag.g(a));b.setAttribute("data-padding",$APP.Li.g(a));b.setAttribute("data-center",$APP.n(Lv.g(a))?"true":"false");b.setAttribute("data-fluid",$APP.n(Mv.g(a))?"true":"false");
|
|
5
|
+
a=$APP.W.g(a);return $APP.n(a)?b.setAttribute("aria-label",a):b.removeAttribute("aria-label")},Sv=function(){var a=class extends HTMLElement{};a.observedAttributes=Rv;a.prototype.connectedCallback=function(){if(!$APP.n(Hv(this))){var b=this.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("slot");c.textContent="\n :host{\n display:block;\n color-scheme:light dark;\n\n --x-container-max-width-xs:480px;\n --x-container-max-width-sm:640px;\n --x-container-max-width-md:768px;\n --x-container-max-width-lg:1024px;\n --x-container-max-width-xl:1280px;\n\n --x-container-padding-sm:0.5rem;\n --x-container-padding-md:1rem;\n --x-container-padding-lg:1.5rem;\n\n --x-container-padding-block:0;\n --x-container-margin-inline:auto;\n\n --x-container-bg:transparent;\n --x-container-color:#0f172a;\n --x-container-border:transparent;\n --x-container-radius:0;\n --x-container-shadow:none;\n }\n\n @media (prefers-color-scheme: dark){\n :host{\n --x-container-bg:transparent;\n --x-container-color:#e5e7eb;\n --x-container-border:transparent;\n --x-container-radius:0;\n --x-container-shadow:none;\n }\n }\n\n [part\x3d'base']{\n display:block;\n box-sizing:border-box;\n width:100%;\n max-width:var(--x-container-max-width-lg);\n padding-inline:var(--x-container-padding-md);\n padding-block:var(--x-container-padding-block);\n margin-inline:0;\n background:var(--x-container-bg);\n color:var(--x-container-color);\n border:1px solid var(--x-container-border);\n border-radius:var(--x-container-radius);\n box-shadow:var(--x-container-shadow);\n }\n\n [part\x3d'base'][data-size\x3d'xs']{max-width:var(--x-container-max-width-xs);}\n [part\x3d'base'][data-size\x3d'sm']{max-width:var(--x-container-max-width-sm);}\n [part\x3d'base'][data-size\x3d'md']{max-width:var(--x-container-max-width-md);}\n [part\x3d'base'][data-size\x3d'lg']{max-width:var(--x-container-max-width-lg);}\n [part\x3d'base'][data-size\x3d'xl']{max-width:var(--x-container-max-width-xl);}\n [part\x3d'base'][data-size\x3d'full']{max-width:none;width:100%;}\n\n [part\x3d'base'][data-padding\x3d'none']{padding-inline:0;}\n [part\x3d'base'][data-padding\x3d'sm']{padding-inline:var(--x-container-padding-sm);}\n [part\x3d'base'][data-padding\x3d'md']{padding-inline:var(--x-container-padding-md);}\n [part\x3d'base'][data-padding\x3d'lg']{padding-inline:var(--x-container-padding-lg);}\n\n [part\x3d'base'][data-center\x3d'true']{\n margin-inline:var(--x-container-margin-inline);\n }\n\n [part\x3d'base'][data-center\x3d'false']{\n margin-inline:0;\n }\n\n [part\x3d'base'][data-fluid\x3d'true']{\n max-width:none;\n width:100%;\n }\n\n ";
|
|
6
|
+
d.setAttribute("part","base");d.appendChild(e);b.appendChild(c);b.appendChild(d);this.__xContainerState={root:b,base:d,slot:e}}return Qv(this,Hv(this))};a.prototype.disconnectedCallback=function(){return null};a.prototype.attributeChangedCallback=function(){var b=Hv(this);return $APP.n(b)?Qv(this,b):null};Jv(a.prototype);Iv(a.prototype);return a},Tv=function(){$APP.n(customElements.get("x-container"))||customElements.define("x-container",Sv());return null},Kv=new $APP.M(null,"as","as",1148689641),
|
|
7
|
+
Lv=new $APP.M(null,"center","center",-748944368),Mv=new $APP.M(null,"fluid","fluid",-1823657759);var Nv=new $APP.S(null,new $APP.Q(null,8,["article",null,"footer",null,"section",null,"main",null,"nav",null,"div",null,"aside",null,"header",null],null),null),Ov=new $APP.S(null,new $APP.Q(null,6,["xs",null,"md",null,"lg",null,"full",null,"xl",null,"sm",null],null),null),Pv=new $APP.S(null,new $APP.Q(null,4,["none",null,"md",null,"lg",null,"sm",null],null),null),Rv="as size padding center fluid label".split(" ");$APP.ka("baredom.exports.x_container.init",Tv);export const init=Tv;
|
package/dist/x-context-menu.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var eH=function(a,b){return typeof a==="string"?(a=parseInt(a,10),$APP.p(isNaN(a))&&a>0?a:b):b},fH=function(a){return $APP.
|
|
3
|
-
k=$APP.
|
|
4
|
-
2,[$APP.Th,c,$APP.Sh,g+e+b],null)}},kH=function(a,b,c,d,e){function g(w){var z=gH(w,b,c,d);z=$APP.
|
|
5
|
-
iH.g(r);return $APP.n(w)?w:$APP.p(iH.g(v))}())?r:v},qH=function(a){a=new $APP.
|
|
6
|
-
"string"&&$APP.Cc(nH,e)?e:"bottom-start";return new $APP.
|
|
7
|
-
(b=document.createElement("div"),b.setAttribute("id","__xOverlayRoot"),b.style.position="fixed",b.style.inset="0",b.style.pointerEvents="none",b.style.zIndex="0",document.body.appendChild(b));var c=document.createElement("div"),d=c.attachShadow({mode:"open"}),e=document.createElement("style"),g=document.createElement("div");c.style.position="fixed";c.style.inset="0";c.style.pointerEvents="none";c.style.zIndex=""+$APP.
|
|
8
|
-
g.setAttribute("part","panel");g.setAttribute("role","menu");g.setAttribute("tabindex","-1");d.appendChild(e);d.appendChild(g);b.appendChild(c);return c},vH=function(a){return $APP.n(a)?a.shadowRoot.querySelector("[part\x3dpanel]"):null},wH=function(a,b,c,d){var e=$APP.
|
|
2
|
+
var eH=function(a,b){return typeof a==="string"?(a=parseInt(a,10),$APP.p(isNaN(a))&&a>0?a:b):b},fH=function(a){return $APP.C.h(a,"bottom-start")?"top-start":$APP.C.h(a,"bottom-end")?"top-end":$APP.C.h(a,"top-start")?"bottom-start":$APP.C.h(a,"top-end")?"bottom-end":$APP.C.h(a,"right-start")?"left-start":$APP.C.h(a,"left-start")?"right-start":a},gH=function(a,b,c,d){var e=$APP.N(c);c=$APP.J(e,$APP.Th);var g=$APP.J(e,$APP.Sh),h=$APP.J(e,$APP.Ng);e=$APP.J(e,$APP.Ii);var k=$APP.N(d);d=$APP.J(k,$APP.Ng);
|
|
3
|
+
k=$APP.J(k,$APP.Ii);switch(a){case "bottom-start":return new $APP.Q(null,2,[$APP.Th,c,$APP.Sh,g+e+b],null);case "bottom-end":return new $APP.Q(null,2,[$APP.Th,c+h-d,$APP.Sh,g+e+b],null);case "top-start":return new $APP.Q(null,2,[$APP.Th,c,$APP.Sh,g-k-b],null);case "top-end":return new $APP.Q(null,2,[$APP.Th,c+h-d,$APP.Sh,g-k-b],null);case "right-start":return new $APP.Q(null,2,[$APP.Th,c+h+b,$APP.Sh,g],null);case "left-start":return new $APP.Q(null,2,[$APP.Th,c-d-b,$APP.Sh,g],null);default:return new $APP.Q(null,
|
|
4
|
+
2,[$APP.Th,c,$APP.Sh,g+e+b],null)}},kH=function(a,b,c,d,e){function g(w){var z=gH(w,b,c,d);z=$APP.N(z);var A=$APP.J(z,$APP.Th),D=$APP.J(z,$APP.Sh);z=A>=8&&A+m<=h-8;var F=D>=8&&D+q<=k-8;A=$APP.lg.h($APP.kg.h(A,8),h-m-8);D=$APP.lg.h($APP.kg.h(D,8),k-q-8);return new $APP.Q(null,5,[$APP.Th,A,$APP.Sh,D,hH,w,iH,z&&F,jH,$APP.kg.h(40,k-D-8)],null)}e=$APP.N(e);var h=$APP.J(e,$APP.Ng),k=$APP.J(e,$APP.Ii);e=$APP.N(d);var m=$APP.J(e,$APP.Ng),q=$APP.J(e,$APP.Ii),r=g(a),v=g(fH(a));return $APP.n(function(){var w=
|
|
5
|
+
iH.g(r);return $APP.n(w)?w:$APP.p(iH.g(v))}())?r:v},qH=function(a){a=new $APP.Q(null,5,[$APP.qh,$APP.n(a.hasAttribute("open"))?a.getAttribute("open"):null,$APP.Yh,$APP.n(a.hasAttribute("disabled"))?a.getAttribute("disabled"):null,$APP.dj,a.getAttribute("placement"),lH,a.getAttribute("offset"),mH,a.getAttribute("z-index")],null);var b=$APP.N(a),c=$APP.J(b,$APP.qh),d=$APP.J(b,$APP.Yh),e=$APP.J(b,$APP.dj);a=$APP.J(b,lH);b=$APP.J(b,mH);c=c!=null&&$APP.O(c,"false");d=d!=null&&$APP.O(d,"false");e=typeof e===
|
|
6
|
+
"string"&&$APP.Cc(nH,e)?e:"bottom-start";return new $APP.Q(null,5,[$APP.Ni,c,$APP.V,d,$APP.yi,e,oH,eH(a,8),pH,eH(b,1E3)],null)},rH=function(a,b,c,d){b=new CustomEvent(b,{detail:d,bubbles:!0,composed:!0,cancelable:c});a.dispatchEvent(b);return $APP.p(b.defaultPrevented)},sH=function(a){return $APP.gc(a.querySelectorAll("[role\x3dmenuitem]:not([disabled]):not([aria-disabled\x3dtrue])"))},tH=function(a){return $APP.n(a)?a.focus():null},uH=function(a){var b=document.getElementById("__xOverlayRoot");$APP.n(b)||
|
|
7
|
+
(b=document.createElement("div"),b.setAttribute("id","__xOverlayRoot"),b.style.position="fixed",b.style.inset="0",b.style.pointerEvents="none",b.style.zIndex="0",document.body.appendChild(b));var c=document.createElement("div"),d=c.attachShadow({mode:"open"}),e=document.createElement("style"),g=document.createElement("div");c.style.position="fixed";c.style.inset="0";c.style.pointerEvents="none";c.style.zIndex=""+$APP.T.g(a);e.textContent=":host{color-scheme:light dark;--x-context-menu-bg:rgba(255,255,255,0.97);--x-context-menu-border:rgba(0,0,0,0.1);--x-context-menu-shadow:0 8px 32px rgba(0,0,0,0.14),0 2px 8px rgba(0,0,0,0.08);--x-context-menu-radius:10px;--x-context-menu-item-hover:rgba(0,0,0,0.05);--x-context-menu-item-active:rgba(0,0,0,0.09);--x-context-menu-item-fg:rgba(0,0,0,0.87);--x-context-menu-separator:rgba(0,0,0,0.1);}@media(prefers-color-scheme:dark){:host{--x-context-menu-bg:#1e293b;--x-context-menu-border:rgba(255,255,255,0.12);--x-context-menu-shadow:0 8px 32px rgba(0,0,0,0.7),0 2px 8px rgba(0,0,0,0.4);--x-context-menu-item-hover:rgba(255,255,255,0.08);--x-context-menu-item-active:rgba(255,255,255,0.14);--x-context-menu-item-fg:rgba(255,255,255,0.9);--x-context-menu-separator:rgba(255,255,255,0.12);}}[part\x3dpanel]{position:absolute;min-width:160px;border-radius:var(--x-context-menu-radius);background:var(--x-context-menu-bg);border:1px solid var(--x-context-menu-border);box-shadow:var(--x-context-menu-shadow);padding:4px 0;overflow:auto;pointer-events:auto;outline:none;@media(prefers-reduced-motion:no-preference){transition:opacity 120ms ease,transform 120ms ease;}}[role\x3dmenuitem]{color:var(--x-context-menu-item-fg);}[role\x3dmenuitem]:hover{background:var(--x-context-menu-item-hover);}";
|
|
8
|
+
g.setAttribute("part","panel");g.setAttribute("role","menu");g.setAttribute("tabindex","-1");d.appendChild(e);d.appendChild(g);b.appendChild(c);return c},vH=function(a){return $APP.n(a)?a.shadowRoot.querySelector("[part\x3dpanel]"):null},wH=function(a,b,c,d){var e=$APP.N(d);d=$APP.J(e,pH);e=$APP.J(e,jH);a.style.zIndex=""+$APP.T.g(d);a=vH(a);$APP.n(a)&&(a.style.left=""+$APP.T.g(b)+"px",a.style.top=""+$APP.T.g(c)+"px",a.style.maxHeight=""+$APP.T.g(e)+"px")},xH=function(a,b){a=$APP.u($APP.gc(a.children));
|
|
9
9
|
for(var c=null,d=0,e=0;;)if(e<d){var g=c.F(null,e);b.appendChild(g.cloneNode(!0));e+=1}else if(a=$APP.u(a))c=a,$APP.yc(c)?(a=$APP.ob(c),d=$APP.pb(c),c=a,g=$APP.B(a),a=d,d=g):(g=$APP.x(c),b.appendChild(g.cloneNode(!0)),a=$APP.y(c),c=null,d=0),e=0;else break},zH=function(a,b){function c(h){h.stopPropagation();h=h.target.closest("[role\x3dmenuitem]");return $APP.n(h)?(rH(a,"x-context-menu-select",!1,{item:h}),yH.h?yH.h(a,"select"):yH.call(null,a,"select")):null}function d(h){var k=vH(b);return $APP.n($APP.n(k)?
|
|
10
|
-
$APP.p(k.contains(h.target)):k)?yH.h?yH.h(a,"backdrop"):yH.call(null,a,"backdrop"):null}function e(h){var k=h.key,m=b.shadowRoot.activeElement;return $APP.
|
|
11
|
-
"ArrowUp")?(h.preventDefault(),$APP.n(m)?(h=sH(g),k=$APP.B(h),m=$APP.hd(h).indexOf(m),m=$APP.H(h,$APP.Qc(m+(k-1),k),null),m=tH(m)):m=tH($APP.x(sH(g))),m):($APP.
|
|
10
|
+
$APP.p(k.contains(h.target)):k)?yH.h?yH.h(a,"backdrop"):yH.call(null,a,"backdrop"):null}function e(h){var k=h.key,m=b.shadowRoot.activeElement;return $APP.C.h(k,"Escape")?(h.preventDefault(),h.stopPropagation(),yH.h?yH.h(a,"keyboard"):yH.call(null,a,"keyboard")):$APP.C.h(k,"Tab")?yH.h?yH.h(a,"keyboard"):yH.call(null,a,"keyboard"):$APP.C.h(k,"ArrowDown")?(h.preventDefault(),$APP.n(m)?(h=sH(g),m=$APP.hd(h).indexOf(m),m=$APP.H(h,$APP.Qc(m+1,$APP.B(h)),null),m=tH(m)):m=tH($APP.x(sH(g))),m):$APP.C.h(k,
|
|
11
|
+
"ArrowUp")?(h.preventDefault(),$APP.n(m)?(h=sH(g),k=$APP.B(h),m=$APP.hd(h).indexOf(m),m=$APP.H(h,$APP.Qc(m+(k-1),k),null),m=tH(m)):m=tH($APP.x(sH(g))),m):($APP.C.h(k,"Enter")||$APP.C.h(k," "))&&$APP.n(m)?(h.preventDefault(),m.click()):null}var g=vH(b);b.addEventListener("keydown",e,!0);b.addEventListener("click",d);$APP.n(g)&&g.addEventListener("click",c);b.__onKey=e;b.__onClickBackdrop=d;b.__onItemClick=c},AH=function(a){if($APP.n(a)){var b=$APP.l(a,"__onKey"),c=$APP.l(a,"__onClickBackdrop"),d=$APP.l(a,
|
|
12
12
|
"__onItemClick"),e=vH(a);$APP.n(b)&&a.removeEventListener("keydown",b,!0);$APP.n(c)&&a.removeEventListener("click",c);$APP.n($APP.n(e)?d:e)&&e.removeEventListener("click",d);$APP.n(a.parentNode)&&a.parentNode.removeChild(a)}},yH=function(a,b){return $APP.n(a.hasAttribute("open"))&&rH(a,"x-context-menu-close-request",!0,{reason:b})?(a.removeAttribute("open"),AH($APP.l(a,"__xContextMenuLayer")),a.__xContextMenuLayer=null,rH(a,"x-context-menu-close",!1,{reason:b})):null},BH=function(a,b,c,d){if($APP.n(a.hasAttribute("disabled")))return null;
|
|
13
|
-
if(rH(a,"x-context-menu-open-request",!0,{reason:d})){var e=qH(a);e=$APP.
|
|
14
|
-
vH(v);if($APP.n(w)){var z=kH(g,h,r,new $APP.
|
|
15
|
-
m=new $APP.
|
|
16
|
-
$APP.Ii,r.offsetHeight],null),new $APP.
|
|
17
|
-
enumerable:!0,get:function(){return this.getAttribute(c)},set:function(d){return d!=null?this.setAttribute(c,""+$APP.
|
|
13
|
+
if(rH(a,"x-context-menu-open-request",!0,{reason:d})){var e=qH(a);e=$APP.N(e);var g=$APP.J(e,$APP.yi),h=$APP.J(e,oH),k=$APP.J(e,pH),m=window.innerWidth,q=window.innerHeight,r=new $APP.Q(null,4,[$APP.Th,b,$APP.Sh,c,$APP.Ng,1,$APP.Ii,1],null);b=kH(g,h,r,new $APP.Q(null,2,[$APP.Ng,200,$APP.Ii,300],null),new $APP.Q(null,2,[$APP.Ng,m,$APP.Ii,q],null));var v=uH(k);xH(a,vH(v));zH(a,v);wH(v,$APP.Th.g(b),$APP.Sh.g(b),$APP.jg.m(b,pH,k));a.setAttribute("open","");a.__xContextMenuLayer=v;requestAnimationFrame(function(){var w=
|
|
14
|
+
vH(v);if($APP.n(w)){var z=kH(g,h,r,new $APP.Q(null,2,[$APP.Ng,w.offsetWidth,$APP.Ii,w.offsetHeight],null),new $APP.Q(null,2,[$APP.Ng,m,$APP.Ii,q],null));wH(v,$APP.Th.g(z),$APP.Sh.g(z),$APP.jg.m(z,pH,k));return tH($APP.x(sH(w)))}return null});return rH(a,"x-context-menu-open",!1,{reason:d})}return null},CH=function(a,b){if($APP.n(a.hasAttribute("disabled")))return null;b=b.getBoundingClientRect();var c=qH(a);c=$APP.N(c);var d=$APP.J(c,$APP.yi),e=$APP.J(c,oH),g=$APP.J(c,pH),h=window.innerWidth,k=window.innerHeight,
|
|
15
|
+
m=new $APP.Q(null,4,[$APP.Th,b.left,$APP.Sh,b.top,$APP.Ng,b.width,$APP.Ii,b.height],null);if(rH(a,"x-context-menu-open-request",!0,{reason:"programmatic"})){b=kH(d,e,m,new $APP.Q(null,2,[$APP.Ng,200,$APP.Ii,300],null),new $APP.Q(null,2,[$APP.Ng,h,$APP.Ii,k],null));var q=uH(g);xH(a,vH(q));zH(a,q);wH(q,$APP.Th.g(b),$APP.Sh.g(b),$APP.jg.m(b,pH,g));a.setAttribute("open","");a.__xContextMenuLayer=q;requestAnimationFrame(function(){var r=vH(q);if($APP.n(r)){var v=kH(d,e,m,new $APP.Q(null,2,[$APP.Ng,r.offsetWidth,
|
|
16
|
+
$APP.Ii,r.offsetHeight],null),new $APP.Q(null,2,[$APP.Ng,h,$APP.Ii,k],null));wH(q,$APP.Th.g(v),$APP.Sh.g(v),$APP.jg.m(v,pH,g));return tH($APP.x(sH(r)))}return null});return rH(a,"x-context-menu-open",!1,{reason:"programmatic"})}return null},DH=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)}})},EH=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,
|
|
17
|
+
enumerable:!0,get:function(){return this.getAttribute(c)},set:function(d){return d!=null?this.setAttribute(c,""+$APP.T.g(d)):this.removeAttribute(c)}})},FH=function(a){a.openAt=function(b,c){return BH(this,b,c,"programmatic")};a.toggleAt=function(b,c){return $APP.n(this.hasAttribute("open"))?yH(this,"toggle"):BH(this,b,c,"toggle")};a.openForElement=function(b){return CH(this,b)};a.close=function(){return yH(this,"programmatic")}},HH=function(){var a=class extends HTMLElement{};a.observedAttributes=
|
|
18
18
|
GH;a.prototype.connectedCallback=function(){if(!$APP.n($APP.l(this,"__xContextMenuRefs"))){var b=this.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("slot");c.textContent=":host{display:contents;}slot{display:none;}";b.appendChild(c);b.appendChild(d);c={};c.root=b;c.slot=d;this.__xContextMenuRefs=c}return $APP.n(this.hasAttribute("open"))?this.removeAttribute("open"):null};a.prototype.disconnectedCallback=function(){var b=$APP.l(this,"__xContextMenuLayer");
|
|
19
|
-
$APP.n(b)?(AH(b),this.__xContextMenuLayer=null,b=void 0):b=null;return b};a.prototype.attributeChangedCallback=function(b){a:{if($APP.
|
|
20
|
-
FH(a.prototype);return a},IH=function(){return $APP.n(customElements.get("x-context-menu"))?null:customElements.define("x-context-menu",HH())},jH=new $APP.
|
|
21
|
-
"offset-raw",-1418404095);var GH=["open","disabled","placement","offset","z-index"],nH=new $APP.
|
|
19
|
+
$APP.n(b)?(AH(b),this.__xContextMenuLayer=null,b=void 0):b=null;return b};a.prototype.attributeChangedCallback=function(b){a:{if($APP.C.h(b,"open")){if($APP.n(this.hasAttribute("open"))){b=null;break a}b=$APP.l(this,"__xContextMenuLayer");if($APP.n(b)){AH(b);this.__xContextMenuLayer=null;b=void 0;break a}}b=null}return b};DH(a.prototype,"open","open");DH(a.prototype,"disabled","disabled");EH(a.prototype,"placement","placement");EH(a.prototype,"offset","offset");EH(a.prototype,"zIndex","z-index");
|
|
20
|
+
FH(a.prototype);return a},IH=function(){return $APP.n(customElements.get("x-context-menu"))?null:customElements.define("x-context-menu",HH())},jH=new $APP.M(null,"max-height","max-height",-612563804),oH=new $APP.M(null,"offset","offset",296498311),hH=new $APP.M(null,"final-placement","final-placement",-1586044424),iH=new $APP.M(null,"fits","fits",2008565808),pH=new $APP.M(null,"z-index","z-index",1892827090),mH=new $APP.M(null,"z-index-raw","z-index-raw",-1179679257),lH=new $APP.M(null,"offset-raw",
|
|
21
|
+
"offset-raw",-1418404095);var GH=["open","disabled","placement","offset","z-index"],nH=new $APP.S(null,new $APP.Q(null,6,["right-start",null,"bottom-start",null,"bottom-end",null,"top-end",null,"top-start",null,"left-start",null],null),null);$APP.ka("baredom.exports.x_context_menu.init",IH);export const init=IH;
|
package/dist/x-copy.js
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
[
|
|
4
|
-
$APP.
|
|
2
|
+
var Lr=function(a){return a==null?!0:$APP.C.h(a,"false")?!1:$APP.C.h(a,"0")?!1:!0},Mr=function(a){return typeof a==="string"&&$APP.O(a,"")?(a=parseInt(a,10),$APP.p(isNaN(a))&&a>0?a:1200):1200},Nr=function(a){return Math.min(1E4,Math.max(100,a))},bs=function(a){var b=$APP.N(a);a=$APP.J(b,Or);var c=$APP.J(b,Pr),d=$APP.J(b,Qr),e=$APP.J(b,$APP.zg),g=$APP.J(b,Rr),h=$APP.J(b,Sr),k=$APP.J(b,Tr),m=$APP.J(b,$APP.Yh),q=$APP.J(b,Ur);b=$APP.J(b,Vr);return $APP.cf([Wr,$APP.di,Xr,Yr,Zr,$APP.Lg,$r,$APP.V,as,$APP.Lh],
|
|
3
|
+
[Lr(b),$APP.C.h(g,"html")?"html":"text",typeof k==="string"&&$APP.O(k.trim(),"")?k.trim():null,typeof a==="string"&&$APP.O(a.trim(),"")?a.trim():null,Nr(Mr(c)),typeof d==="string"&&$APP.O(d.trim(),"")?d.trim():null,function(){var r;if(r=typeof h==="string")r=(r=$APP.O(h,""))?h:r;return $APP.n(r)?r:"Copy failed"}(),$APP.K(m),function(){var r;if(r=typeof q==="string")r=(r=$APP.O(q,""))?q:r;return $APP.n(r)?r:"Copied"}(),typeof e==="string"&&$APP.O(e.trim(),"")?e.trim():null])},cs=function(a){var b=
|
|
4
|
+
$APP.N(a);a=$APP.J(b,$APP.Lh);var c=$APP.J(b,$APP.Lg),d=$APP.J(b,Xr);b=$APP.J(b,$APP.di);return{text:$APP.n(a)?a:"",mode:$APP.n(b)?b:"text",from:$APP.n(c)?c:null,fromAttr:$APP.n(d)?d:null}},ds=function(a){var b=$APP.l(a,"__xCopyRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("span"),e=document.createElement("button"),g=document.createElement("slot"),h=document.createElement("span"),k=document.createElement("slot"),m=document.createElement("span");
|
|
5
5
|
c.textContent=":host{display:inline-block;position:relative;color-scheme:light dark;--x-copy-tooltip-bg:#1e293b;--x-copy-tooltip-fg:#f8fafc;--x-copy-tooltip-success-bg:#15803d;--x-copy-tooltip-success-fg:#f0fdf4;--x-copy-tooltip-error-bg:#b91c1c;--x-copy-tooltip-error-fg:#fef2f2;--x-copy-tooltip-radius:6px;--x-copy-tooltip-padding:4px 8px;--x-copy-tooltip-font-size:0.8125rem;--x-copy-tooltip-z:100;}@media (prefers-color-scheme:dark){:host{--x-copy-tooltip-bg:#0f172a;--x-copy-tooltip-fg:#e2e8f0;--x-copy-tooltip-success-bg:#166534;--x-copy-tooltip-success-fg:#dcfce7;--x-copy-tooltip-error-bg:#991b1b;--x-copy-tooltip-error-fg:#fee2e2;}}[part\x3dwrap]{display:inline-flex;align-items:center;justify-content:center;}[part\x3dtrigger]{all:unset;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;box-sizing:border-box;}[part\x3dtrigger]:focus-visible{outline:2px solid currentColor;outline-offset:2px;}:host([disabled]) [part\x3dtrigger]{opacity:0.55;pointer-events:none;cursor:default;}[part\x3dtooltip]{display:none;position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);white-space:nowrap;background:var(--x-copy-tooltip-bg);color:var(--x-copy-tooltip-fg);border-radius:var(--x-copy-tooltip-radius);padding:var(--x-copy-tooltip-padding);font-size:var(--x-copy-tooltip-font-size);z-index:var(--x-copy-tooltip-z);pointer-events:none;}:host([data-tooltip-open]) [part\x3dtooltip]{display:block;}:host([data-tooltip-kind\x3dsuccess]) [part\x3dtooltip]{background:var(--x-copy-tooltip-success-bg);color:var(--x-copy-tooltip-success-fg);}:host([data-tooltip-kind\x3derror]) [part\x3dtooltip]{background:var(--x-copy-tooltip-error-bg);color:var(--x-copy-tooltip-error-fg);}@media (prefers-reduced-motion:reduce){[part\x3dtrigger]{transition:none;}}";
|
|
6
|
-
d.setAttribute("part","wrap");e.setAttribute("part","trigger");e.setAttribute("type","button");e.appendChild(g);h.setAttribute("part","tooltip");h.setAttribute("role","status");h.setAttribute("aria-live","polite");k.setAttribute("name","tooltip");m.setAttribute("part","tooltip-text");h.appendChild(k);h.appendChild(m);d.appendChild(e);d.appendChild(h);b.appendChild(c);b.appendChild(d);a.__xCopyRefs={root:b,wrap:d,trigger:e,tooltip:h,tooltipSlot:k,tooltipText:m};return $APP.l(a,"__xCopyRefs")},
|
|
7
|
-
$APP.zg,
|
|
8
|
-
"string"&&$APP.
|
|
6
|
+
d.setAttribute("part","wrap");e.setAttribute("part","trigger");e.setAttribute("type","button");e.appendChild(g);h.setAttribute("part","tooltip");h.setAttribute("role","status");h.setAttribute("aria-live","polite");k.setAttribute("name","tooltip");m.setAttribute("part","tooltip-text");h.appendChild(k);h.appendChild(m);d.appendChild(e);d.appendChild(h);b.appendChild(c);b.appendChild(d);a.__xCopyRefs={root:b,wrap:d,trigger:e,tooltip:h,tooltipSlot:k,tooltipText:m};return $APP.l(a,"__xCopyRefs")},es=function(a){return bs($APP.cf([Qr,
|
|
7
|
+
$APP.zg,Rr,Sr,Tr,$APP.Yh,Ur,Vr,Or,Pr],[a.getAttribute("from"),a.getAttribute("text"),a.getAttribute("mode"),a.getAttribute("error-message"),a.getAttribute("from-attr"),a.hasAttribute("disabled"),a.getAttribute("success-message"),a.getAttribute("show-tooltip"),a.getAttribute("hotkey"),a.getAttribute("tooltip-ms")]))},fs=function(a){var b=$APP.l(a,"__xCopyTextValue");if(typeof b==="string")return b;b=a.getAttribute("text");if(typeof b==="string"&&$APP.O(b,""))return b;b=a.getAttribute("from");return typeof b===
|
|
8
|
+
"string"&&$APP.O(b,"")&&(b=document.querySelector(b),$APP.n(b))?(a=a.getAttribute("from-attr"),a=typeof a==="string"&&$APP.O(a,"")?b.getAttribute(a):b.textContent,$APP.n(a)?a:""):""},gs=function(a){var b=fs(a),c=function(){var d=a.getAttribute("mode");return $APP.n(d)?d:"text"}();return new Promise(function(d,e){if($APP.C.h(c,"html")){if($APP.n(function(){var h=navigator.clipboard;return $APP.n(h)?window.ClipboardItem:h}()))return navigator.clipboard.write($APP.xg(new $APP.P(null,1,5,$APP.Xd,[new ClipboardItem({"text/html":new Blob([b],
|
|
9
9
|
{type:"text/html"}),"text/plain":new Blob([b],{type:"text/plain"})})],null))).then(function(){return d.g?d.g(b):d.call(null,b)}).catch(function(h){return e.g?e.g(h):e.call(null,h)});try{var g=document.createElement("textarea");g.value=b;document.body.appendChild(g);g.select();document.execCommand("copy");g.remove();return d.g?d.g(b):d.call(null,b)}catch(h){if(h instanceof Error)return g=h,e.g?e.g(g):e.call(null,g);throw h;}}else{if($APP.n(navigator.clipboard))return navigator.clipboard.writeText(b).then(function(){return d.g?
|
|
10
|
-
d.g(b):d.call(null,b)}).catch(function(h){try{return document.execCommand("copy"),d.g?d.g(b):d.call(null,b)}catch(k){if(k instanceof Error)return e.g?e.g(h):e.call(null,h);throw k;}});try{return g=document.createElement("textarea"),g.value=b,g.style.position="fixed",g.style.opacity="0",document.body.appendChild(g),g.select(),document.execCommand("copy"),g.remove(),d.g?d.g(b):d.call(null,b)}catch(h){if(h instanceof Error)return g=h,e.g?e.g(g):e.call(null,g);throw h;}}})},
|
|
11
|
-
$APP.l(a,"__xCopyRefs");if($APP.n(e)){var g=$APP.l(a,"__xCopyTid");$APP.n(g)&&(clearTimeout(g),a.__xCopyTid=null);a.setAttribute("data-tooltip-open","");a.setAttribute("data-tooltip-kind",b);$APP.l(e,"tooltipText").textContent=c;$APP.ma(a,"__xCopyTid",setTimeout(function(){a.__xCopyTid=null;a.removeAttribute("data-tooltip-open");a.removeAttribute("data-tooltip-kind");var h=$APP.l(a,"__xCopyRefs");$APP.n(h)&&($APP.l(h,"tooltipText").textContent="");return null},d))}
|
|
12
|
-
|
|
13
|
-
function(a,b){if(typeof b==="string"&&$APP.
|
|
14
|
-
a.getAttribute("hotkey");return $APP.n(
|
|
15
|
-
c.removeEventListener("click",d);$APP.n(b)&&document.removeEventListener("keydown",b)}a.__xCopyHandlers=null},
|
|
16
|
-
null),new $APP.
|
|
17
|
-
null?this.removeAttribute(F):this.setAttribute(F,""+$APP.
|
|
18
|
-
c,d,e,k,m,q,g,h),enumerable:!0,configurable:!0});b=$APP.y(g);c=null;d=0}e=0}else break;Object.defineProperty(a,"disabled",{get:function(){return this.hasAttribute("disabled")},set:function(r){return $APP.n(r)?this.setAttribute("disabled",""):this.removeAttribute("disabled")},enumerable:!0,configurable:!0});Object.defineProperty(a,"showTooltip",{get:function(){return
|
|
19
|
-
"false")},enumerable:!0,configurable:!0});Object.defineProperty(a,"tooltipMs",{get:function(){return
|
|
20
|
-
"copy",{value:function(){return js(this)},enumerable:!0,configurable:!0,writable:!0})},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
$APP.X,$APP.Pg,"text"],null)]);$APP.wd(["x-copy-request",new $APP.P(null,2,[$APP.ui,!0,$APP.Y,new $APP.P(null,4,[$APP.Lh,$APP.X,$APP.di,$APP.X,$APP.Lg,$APP.X,ws,$APP.X],null)],null),"x-copy-success",new $APP.P(null,2,[$APP.ui,!1,$APP.Y,new $APP.P(null,1,[$APP.Lh,$APP.X],null)],null),"x-copy-error",new $APP.P(null,2,[$APP.ui,!1,$APP.Y,new $APP.P(null,1,[$APP.ph,$APP.X],null)],null)]);$APP.ka("baredom.exports.x_copy.init",vs);export const init=vs;
|
|
10
|
+
d.g(b):d.call(null,b)}).catch(function(h){try{return document.execCommand("copy"),d.g?d.g(b):d.call(null,b)}catch(k){if(k instanceof Error)return e.g?e.g(h):e.call(null,h);throw k;}});try{return g=document.createElement("textarea"),g.value=b,g.style.position="fixed",g.style.opacity="0",document.body.appendChild(g),g.select(),document.execCommand("copy"),g.remove(),d.g?d.g(b):d.call(null,b)}catch(h){if(h instanceof Error)return g=h,e.g?e.g(g):e.call(null,g);throw h;}}})},hs=function(a,b,c,d){var e=
|
|
11
|
+
$APP.l(a,"__xCopyRefs");if($APP.n(e)){var g=$APP.l(a,"__xCopyTid");$APP.n(g)&&(clearTimeout(g),a.__xCopyTid=null);a.setAttribute("data-tooltip-open","");a.setAttribute("data-tooltip-kind",b);$APP.l(e,"tooltipText").textContent=c;$APP.ma(a,"__xCopyTid",setTimeout(function(){a.__xCopyTid=null;a.removeAttribute("data-tooltip-open");a.removeAttribute("data-tooltip-kind");var h=$APP.l(a,"__xCopyRefs");$APP.n(h)&&($APP.l(h,"tooltipText").textContent="");return null},d))}},is=function(a,b,c,d){b=new CustomEvent(b,
|
|
12
|
+
{detail:c,bubbles:!0,composed:!0,cancelable:d});a.dispatchEvent(b);return b},js=function(a){if($APP.n(a.hasAttribute("disabled")))return Promise.resolve(null);var b=es(a),c=cs(b);c=is(a,"x-copy-request",c,!0);return $APP.n(c.defaultPrevented)?Promise.resolve(null):gs(a).then(function(d){is(a,"x-copy-success",{text:$APP.n(d)?d:""},!1);$APP.n(Wr.g(b))&&hs(a,"success",as.g(b),Zr.g(b));return d}).catch(function(d){is(a,"x-copy-error",{error:""+$APP.T.g(d)},!1);$APP.n(Wr.g(b))&&hs(a,"error",$r.g(b),Zr.g(b));
|
|
13
|
+
return Promise.reject(d)})},ks=function(a,b){if(typeof b==="string"&&$APP.O(b,"")){var c=b.toLowerCase().split("+");b=$APP.ic(c);var d=$APP.K($APP.Ad(function(h){return $APP.C.h(h,"ctrl")},c)),e=$APP.K($APP.Ad(function(h){return $APP.C.h(h,"shift")},c)),g=$APP.K($APP.Ad(function(h){return $APP.C.h(h,"alt")},c));c=$APP.K($APP.Ad(function(h){return $APP.C.h(h,"meta")},c));return $APP.C.h(a.key.toLowerCase(),b)&&$APP.C.h(d,a.ctrlKey)&&$APP.C.h(e,a.shiftKey)&&$APP.C.h(g,a.altKey)&&$APP.C.h(c,a.metaKey)}return null},
|
|
14
|
+
ls=function(a){function b(e){var g=a.getAttribute("hotkey");return $APP.n(ks(e,g))?(e.preventDefault(),js(a)):null}function c(){return js(a)}var d=ds(a);$APP.l(d,"trigger").addEventListener("click",c);document.addEventListener("keydown",b);$APP.ma(a,"__xCopyHandlers",{click:c,keydown:b})},ms=function(a){var b=$APP.l(a,"__xCopyTid");$APP.n(b)&&(clearTimeout(b),a.__xCopyTid=null);b=$APP.l(a,"__xCopyHandlers");var c=$APP.l(a,"__xCopyRefs");if($APP.n($APP.n(b)?c:b)){c=$APP.l(c,"trigger");var d=$APP.l(b,
|
|
15
|
+
"click");b=$APP.l(b,"keydown");$APP.n(d)&&c.removeEventListener("click",d);$APP.n(b)&&document.removeEventListener("keydown",b)}a.__xCopyHandlers=null},ns=function(a){var b=ds(a),c=a.hasAttribute("disabled");$APP.l(b,"trigger").disabled=$APP.K(c);$APP.n(c)?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled")},os=function(a){for(var b=$APP.u(new $APP.P(null,7,5,$APP.Xd,[new $APP.P(null,2,5,$APP.Xd,["text","text"],null),new $APP.P(null,2,5,$APP.Xd,["from","from"],null),new $APP.P(null,
|
|
16
|
+
2,5,$APP.Xd,["fromAttr","from-attr"],null),new $APP.P(null,2,5,$APP.Xd,["mode","mode"],null),new $APP.P(null,2,5,$APP.Xd,["successMessage","success-message"],null),new $APP.P(null,2,5,$APP.Xd,["errorMessage","error-message"],null),new $APP.P(null,2,5,$APP.Xd,["hotkey","hotkey"],null)],null)),c=null,d=0,e=0;;)if(e<d){var g=c.F(null,e),h=$APP.H(g,0,null),k=$APP.H(g,1,null);Object.defineProperty(a,h,{get:function(r,v,w,z,A,D,F){return function(){return this.getAttribute(F)}}(b,c,d,e,g,h,k),set:function(r,
|
|
17
|
+
v,w,z,A,D,F){return function(I){return I==null?this.removeAttribute(F):this.setAttribute(F,""+$APP.T.g(I))}}(b,c,d,e,g,h,k),enumerable:!0,configurable:!0});e+=1}else if(h=$APP.u(b)){g=h;if($APP.yc(g))b=$APP.ob(g),e=$APP.pb(g),c=b,d=$APP.B(b),b=e;else{k=$APP.x(g);var m=$APP.H(k,0,null),q=$APP.H(k,1,null);Object.defineProperty(a,m,{get:function(r,v,w,z,A,D,F){return function(){return this.getAttribute(F)}}(b,c,d,e,k,m,q,g,h),set:function(r,v,w,z,A,D,F){return function(I){return I==null?this.removeAttribute(F):
|
|
18
|
+
this.setAttribute(F,""+$APP.T.g(I))}}(b,c,d,e,k,m,q,g,h),enumerable:!0,configurable:!0});b=$APP.y(g);c=null;d=0}e=0}else break;Object.defineProperty(a,"disabled",{get:function(){return this.hasAttribute("disabled")},set:function(r){return $APP.n(r)?this.setAttribute("disabled",""):this.removeAttribute("disabled")},enumerable:!0,configurable:!0});Object.defineProperty(a,"showTooltip",{get:function(){return Lr(this.getAttribute("show-tooltip"))},set:function(r){return $APP.n(r)?this.setAttribute("show-tooltip",
|
|
19
|
+
"true"):this.setAttribute("show-tooltip","false")},enumerable:!0,configurable:!0});Object.defineProperty(a,"tooltipMs",{get:function(){return Mr(this.getAttribute("tooltip-ms"))},set:function(r){return r==null?this.removeAttribute("tooltip-ms"):this.setAttribute("tooltip-ms",""+$APP.T.g(r|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"textValue",{get:function(){return $APP.l(this,"__xCopyTextValue")},set:function(r){this.__xCopyTextValue=typeof r==="string"?r:void 0},enumerable:!0,
|
|
20
|
+
configurable:!0});Object.defineProperty(a,"copy",{value:function(){return js(this)},enumerable:!0,configurable:!0,writable:!0})},qs=function(){var a=class extends HTMLElement{};a.observedAttributes=ps;a.prototype.connectedCallback=function(){ds(this);ms(this);ls(this);ns(this);return null};a.prototype.disconnectedCallback=function(){ms(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.O(c,d)&&ns(this);return null};os(a.prototype);return a},rs=function(){$APP.n(customElements.get("x-copy"))||
|
|
21
|
+
customElements.define("x-copy",qs());return null},Wr=new $APP.M(null,"show-tooltip?","show-tooltip?",-1214081087),Pr=new $APP.M(null,"tooltip-ms-raw","tooltip-ms-raw",-1973326401),ss=new $APP.M(null,"fromAttr","fromAttr",-1768252533),as=new $APP.M(null,"success-message","success-message",-96541601),Tr=new $APP.M(null,"from-attr-raw","from-attr-raw",761657416),Rr=new $APP.M(null,"mode-raw","mode-raw",-112711707),Zr=new $APP.M(null,"tooltip-ms","tooltip-ms",1062450417),Sr=new $APP.M(null,"error-message-raw",
|
|
22
|
+
"error-message-raw",1910536231),Yr=new $APP.M(null,"hotkey","hotkey",-329017295),Ur=new $APP.M(null,"success-message-raw","success-message-raw",388691116),Qr=new $APP.M(null,"from-raw","from-raw",-44462428),Xr=new $APP.M(null,"from-attr","from-attr",1217901743),Or=new $APP.M(null,"hotkey-raw","hotkey-raw",1972404222),$r=new $APP.M(null,"error-message","error-message",1756021561),Vr=new $APP.M(null,"show-tooltip-raw","show-tooltip-raw",453600717);var ps="text from from-attr mode disabled show-tooltip tooltip-ms success-message error-message hotkey".split(" ");
|
|
23
|
+
$APP.cf([new $APP.M(null,"errorMessage","errorMessage",982744869),$APP.wi,new $APP.M(null,"textValue","textValue",-598870870),$APP.di,ss,new $APP.M(null,"tooltipMs","tooltipMs",1056463375),Yr,$APP.Lg,new $APP.M(null,"showTooltip","showTooltip",482349691),new $APP.M(null,"successMessage","successMessage",-789572803),$APP.Lh],[new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.Pg,"error-message"],null),new $APP.Q(null,2,[$APP.Z,$APP.Ji,$APP.Pg,"disabled"],null),new $APP.Q(null,3,[$APP.Z,$APP.X,$APP.Pg,null,new $APP.M(null,
|
|
24
|
+
"note","note",1426297904),"property-only override"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.Pg,"mode"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.Pg,"from-attr"],null),new $APP.Q(null,2,[$APP.Z,$APP.Fh,$APP.Pg,"tooltip-ms"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.Pg,"hotkey"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.Pg,"from"],null),new $APP.Q(null,2,[$APP.Z,$APP.Ji,$APP.Pg,"show-tooltip"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.Pg,"success-message"],null),new $APP.Q(null,2,[$APP.Z,
|
|
25
|
+
$APP.X,$APP.Pg,"text"],null)]);$APP.wd(["x-copy-request",new $APP.Q(null,2,[$APP.ui,!0,$APP.Y,new $APP.Q(null,4,[$APP.Lh,$APP.X,$APP.di,$APP.X,$APP.Lg,$APP.X,ss,$APP.X],null)],null),"x-copy-success",new $APP.Q(null,2,[$APP.ui,!1,$APP.Y,new $APP.Q(null,1,[$APP.Lh,$APP.X],null)],null),"x-copy-error",new $APP.Q(null,2,[$APP.ui,!1,$APP.Y,new $APP.Q(null,1,[$APP.ph,$APP.X],null)],null)]);$APP.ka("baredom.exports.x_copy.init",rs);export const init=rs;
|