@vanelsas/baredom 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +7 -5
- package/dist/base.js +347 -347
- package/dist/x-alert.js +15 -15
- package/dist/x-avatar-group.js +11 -11
- package/dist/x-avatar.js +15 -15
- package/dist/x-badge.js +11 -11
- package/dist/x-breadcrumbs.js +12 -12
- package/dist/x-button.js +15 -15
- package/dist/x-cancel-dialogue.js +13 -13
- package/dist/x-card.js +7 -7
- package/dist/x-chart.js +47 -47
- package/dist/x-checkbox.js +8 -8
- package/dist/x-chip.js +6 -6
- package/dist/x-collapse.js +10 -10
- package/dist/x-command-palette.js +23 -23
- package/dist/x-container.js +6 -6
- package/dist/x-context-menu.js +19 -19
- package/dist/x-copy.js +22 -22
- package/dist/x-currency-field.js +22 -22
- package/dist/x-date-picker.js +37 -37
- package/dist/x-divider.js +12 -12
- package/dist/x-drawer.js +11 -11
- package/dist/x-dropdown.js +5 -5
- package/dist/x-fieldset.js +6 -6
- package/dist/x-file-download.js +4 -4
- package/dist/x-form-field.js +15 -15
- package/dist/x-form.js +10 -10
- package/dist/x-gaussian-blur.js +32 -32
- package/dist/x-grid.js +7 -7
- package/dist/x-kinetic-typography.js +61 -61
- package/dist/x-menu-item.js +10 -10
- package/dist/x-menu.js +10 -10
- package/dist/x-modal.js +12 -12
- package/dist/x-navbar.js +13 -13
- package/dist/x-notification-center.js +9 -9
- package/dist/x-organic-divider.js +17 -17
- package/dist/x-organic-shape.js +14 -14
- package/dist/x-pagination.js +16 -16
- package/dist/x-popover.js +6 -6
- package/dist/x-progress-circle.js +9 -9
- package/dist/x-progress.js +10 -10
- package/dist/x-radio.js +11 -11
- package/dist/x-ripple-effect.js +12 -12
- package/dist/x-scroll-parallax.js +19 -19
- package/dist/x-scroll-stack.js +20 -0
- package/dist/x-scroll-story.js +35 -35
- package/dist/x-scroll-timeline.js +42 -42
- package/dist/x-scroll.js +40 -40
- package/dist/x-search-field.js +7 -7
- package/dist/x-select.js +9 -9
- package/dist/x-sidebar.js +16 -16
- package/dist/x-skeleton.js +5 -5
- package/dist/x-slider.js +16 -16
- package/dist/x-spacer.js +5 -5
- package/dist/x-spinner.js +5 -5
- package/dist/x-stat.js +11 -11
- package/dist/x-stepper.js +16 -16
- package/dist/x-switch.js +10 -10
- package/dist/x-tab.js +5 -5
- package/dist/x-table-cell.js +23 -23
- package/dist/x-table-row.js +8 -8
- package/dist/x-table.js +15 -15
- package/dist/x-tabs.js +11 -11
- package/dist/x-text-area.js +17 -17
- package/dist/x-timeline-item.js +23 -23
- package/dist/x-timeline.js +9 -9
- package/dist/x-toast.js +19 -19
- package/dist/x-toaster.js +8 -8
- package/dist/x-typography.js +10 -10
- package/package.json +6 -2
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var Aq=function(a){if(a!=null&&a.ua!=null)a=a.ua(a);else{var b=Aq[$APP.da(a==null?null:a)];if(b!=null)a=b.g?b.g(a):b.call(null,a);else if(b=Aq._,b!=null)a=b.g?b.g(a):b.call(null,a);else throw $APP.ra("IStack.-pop",a);}return a},Bq=function(a,b){return $APP.
|
|
3
|
-
if(1<$APP.B(a))a:{for(;;)if(""===(a==null?null:$APP.Oa(a)))a=a==null?null:Aq(a);else break a;a=void 0}return a},Dq=function(a){return a==null?!0:$APP.
|
|
4
|
-
A:""}()),k=Eq(e.group),m=e.value,p=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 x=function(){var A=k;return $APP.n(A)?A:""}(),y=typeof m==="string"?m:"";x=(""+$APP.
|
|
5
|
-
2,[$APP.Xi,a,Iq,$APP.
|
|
6
|
-
$APP.
|
|
7
|
-
Zq=function(a){return Xq($APP.
|
|
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=Hq($APP.l(a,"__xCommandPaletteItems"));e=Jq(g,e);e=$APP.
|
|
9
|
-
"");d=$APP.
|
|
10
|
-
""+$APP.
|
|
2
|
+
var Aq=function(a){if(a!=null&&a.ua!=null)a=a.ua(a);else{var b=Aq[$APP.da(a==null?null:a)];if(b!=null)a=b.g?b.g(a):b.call(null,a);else if(b=Aq._,b!=null)a=b.g?b.g(a):b.call(null,a);else throw $APP.ra("IStack.-pop",a);}return a},Bq=function(a,b){return $APP.ld($APP.Jc(function(c,d){return $APP.n(a.g?a.g(d):a.call(null,d))?$APP.ib(c,d):c},$APP.hb($APP.Nd),b))},Cq=function(a){var b=/\s+/;a="/(?:)/"===""+$APP.S.g(b)?$APP.kf.h($APP.fe($APP.Zc("",$APP.Jd.h($APP.S,$APP.u(a)))),""):$APP.fe((""+$APP.S.g(a)).split(b));
|
|
3
|
+
if(1<$APP.B(a))a:{for(;;)if(""===(a==null?null:$APP.Oa(a)))a=a==null?null:Aq(a);else break a;a=void 0}return a},Dq=function(a){return a==null?!0:$APP.O(a,"false")},Eq=function(a){return typeof a==="string"?(a=a.trim(),$APP.O(a,"")?a:null):null},Hq=function(a){if(a==null||$APP.q($APP.pa(a)))return $APP.Nd;for(var b=a.length,c=0,d=$APP.hb($APP.Nd);;){if($APP.C.h(c,b))return $APP.jb(d);var e=a[c],g=""+$APP.S.g(function(){var A=e.id;return $APP.n(A)?A:c}()),h=""+$APP.S.g(function(){var A=e.label;return $APP.n(A)?
|
|
4
|
+
A:""}()),k=Eq(e.group),m=e.value,p=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 x=function(){var A=k;return $APP.n(A)?A:""}(),y=typeof m==="string"?m:"";x=(""+$APP.S.g(h)+" "+$APP.S.g(v)+" "+$APP.S.g(x)+" "+$APP.S.g(y)).toLowerCase();v=c+1;d=$APP.md(d,new $APP.Q(null,7,[$APP.xi,g,$APP.W,h,Fq,k,$APP.si,m,$APP.xh,p,$APP.V,r,Gq,x],null));c=v}},Jq=function(a,b){b=typeof b==="string"?b.trim():"";var c=$APP.O(b,"")?$APP.Gd(Eq,Cq(b)):null;if($APP.uc(c))return new $APP.Q(null,
|
|
5
|
+
2,[$APP.Xi,a,Iq,$APP.Ee.h($APP.Ef,$APP.Gd(Fq,a))],null);a=Bq(function(d){return $APP.Cd(function(e){return $APP.O(-1,Gq.g(d).indexOf(e.toLowerCase()))},c)},a);return new $APP.Q(null,2,[$APP.Xi,a,Iq,$APP.Ee.h($APP.Ef,$APP.Gd(Fq,a))],null)},Kq=function(a,b,c){var d=$APP.B(a);if(d>0)for(var e=1;;)if(e<=d){var g=$APP.Sc(b+e*c,d),h=$APP.E(a,g,null),k=h;h=$APP.n(k)?$APP.q($APP.V.g(h)):k;if($APP.n(h))return g;e+=1}else return null;else return null},Xq=function(a){var b=$APP.N(a);a=$APP.H(b,$APP.Xh);var c=
|
|
6
|
+
$APP.H(b,$APP.gi),d=$APP.H(b,$APP.Dh),e=$APP.H(b,Lq),g=$APP.H(b,Mq),h=$APP.H(b,Nq),k=$APP.H(b,Oq),m=$APP.H(b,Pq),p=$APP.H(b,Qq);b=$APP.H(b,Rq);b=Dq(b);p=Dq(p);m=m!=null&&$APP.O(m,"false");m=b&&!m;g=g!=null?g!=null&&$APP.O(g,"false"):m;k=Dq(k);return $APP.gf([$APP.Mj,$APP.fi,Sq,Tq,Uq,Vq,$APP.W,$APP.fk,Wq,$APP.V],[function(){var r=Eq(c);return $APP.n(r)?r:"Search…"}(),p,function(){var r=Eq(e);return $APP.n(r)?r:"No results"}(),g,k,m,Eq(d),$APP.J(a),b,h!=null&&$APP.O(h,"false")])},Yq=function(a){return document.createElement(a)},
|
|
7
|
+
Zq=function(a){return Xq($APP.gf([$APP.Dh,Lq,Mq,Nq,Oq,Pq,Qq,Rq,$APP.Xh,$APP.gi],[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")]))},$q=function(a,b,c,d){b=new CustomEvent(b,{detail:d,bubbles:!0,composed:!0,cancelable:$APP.J(c)});a.dispatchEvent(b);return b},ar=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=Hq($APP.l(a,"__xCommandPaletteItems"));e=Jq(g,e);e=$APP.N(e);g=$APP.H(e,$APP.Xi);e=function(){var r=$APP.l(a,"__xCommandPaletteActiveIdx");return $APP.n(r)?r:0}();c.textContent="";if($APP.uc(g))return d.removeAttribute("hidden"),$APP.n(b)?b.removeAttribute("aria-activedescendant"):null;d.setAttribute("hidden",
|
|
9
|
+
"");d=$APP.Fd($APP.Eg,g);for(var h=null;;)if(g=$APP.w(d),$APP.n(g)){var k=g;g=$APP.E(k,0,null);k=$APP.E(k,1,null);var m=Fq.g(k);if($APP.n(function(){var r=m;return $APP.n(r)?$APP.O(m,h):r}())){var p=Yq("div");p.setAttribute("part","group-header");p.setAttribute("aria-hidden","true");p.textContent=m;c.appendChild(p)}p=Yq("div");p.setAttribute("part","item");p.setAttribute("role","option");p.setAttribute("id","x-cp-item-"+$APP.S.g(g));p.setAttribute("data-id",""+$APP.S.g($APP.xi.g(k)));p.setAttribute("data-idx",
|
|
10
|
+
""+$APP.S.g(g));p.setAttribute("tabindex","-1");$APP.n($APP.V.g(k))&&p.setAttribute("aria-disabled","true");p.textContent=$APP.W.g(k);$APP.C.h(g,e)&&p.setAttribute("aria-selected","true");c.appendChild(p);d=$APP.Lb(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.S.g(e)):null}return null},br=function(a){var b=$APP.l(a,"__xCommandPaletteRefs");if($APP.n(b)){var c=Zq(a),d=$APP.l(b,"panel"),e=$APP.l(b,"input"),g=$APP.l(b,
|
|
11
11
|
"overlay");b=$APP.l(b,"empty");var h=$APP.W.g(c),k=$APP.Mj.g(c),m=Sq.g(c);$APP.n(h)?d.setAttribute("aria-label",h):d.setAttribute("aria-label","Command palette");$APP.n(Vq.g(c))?g.removeAttribute("hidden"):g.setAttribute("hidden","");e.setAttribute("placeholder",k);e.setAttribute("aria-expanded",$APP.n($APP.fk.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
12
|
b.textContent=m;return ar(a)}return null},cr=function(a){if($APP.n(a.hasAttribute("open")))return null;var b=$q(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(),br(a),a=$q(a,"x-command-palette-open",!1,{}));return a},dr=function(a){if($APP.n(a.hasAttribute("open"))){var b=$q(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"),br(a),a=$q(a,"x-command-palette-close",!1,{}));return a}return null},er=function(a){var b=$APP.l(a,"__xCommandPaletteQuery");b=$APP.n(b)?b:"";a=Hq($APP.l(a,"__xCommandPaletteItems"));a=Jq(a,b);a=$APP.
|
|
14
|
-
0):(b=$APP.B(c),c=Kq(c,$APP.n(d)?d:b,-1),c=$APP.n(c)?c:0);a.__xCommandPaletteActiveIdx=c;ar(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.
|
|
15
|
-
b=$APP.
|
|
16
|
-
"");a.__xCommandPaletteQuery="";a.__xCommandPaletteActiveIdx=0;$q(a,"x-command-palette-query-change",!1,{query:""});ar(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=er(a);r=$APP.
|
|
17
|
-
r=dr(a);break a}}r=null}return r}function d(){var r=Zq(a);return $APP.n(Tq.g(r))?dr(a):null}function e(r){return ir(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.
|
|
18
|
-
v:""});return ar(a)}var h=$APP.l(a,"__xCommandPaletteRefs"),k=$APP.l(h,"input"),m=$APP.l(h,"overlay"),p=$APP.l(h,"list");h=$APP.l(h,"clear-btn");k.addEventListener("input",g);k.addEventListener("keydown",e);m.addEventListener("click",d);p.addEventListener("click",c);h.addEventListener("click",b);$APP.
|
|
13
|
+
b=$APP.l(a,"__xCommandPaletteRefs"),b=$APP.n(b)?$APP.l(b,"input"):null,$APP.n(b)&&b.removeAttribute("aria-activedescendant"),br(a),a=$q(a,"x-command-palette-close",!1,{}));return a}return null},er=function(a){var b=$APP.l(a,"__xCommandPaletteQuery");b=$APP.n(b)?b:"";a=Hq($APP.l(a,"__xCommandPaletteItems"));a=Jq(a,b);a=$APP.N(a);return $APP.H(a,$APP.Xi)},gr=function(a,b){var c=er(a);var d=$APP.l(a,"__xCommandPaletteActiveIdx");d=$APP.n(d)?d:0;$APP.C.h(b,fr)?(c=Kq(c,$APP.n(d)?d:-1,1),c=$APP.n(c)?c:
|
|
14
|
+
0):(b=$APP.B(c),c=Kq(c,$APP.n(d)?d:b,-1),c=$APP.n(c)?c:0);a.__xCommandPaletteActiveIdx=c;ar(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.S.g(c)+"']"):null;return $APP.n(a)?a.scrollIntoView({block:"nearest"}):null},ir=function(a,b){var c=b.key;return $APP.C.h(c,"ArrowDown")?(b.preventDefault(),gr(a,fr)):$APP.C.h(c,"ArrowUp")?(b.preventDefault(),gr(a,hr)):$APP.C.h(c,"Enter")?(b.preventDefault(),b=er(a),c=$APP.l(a,"__xCommandPaletteActiveIdx"),
|
|
15
|
+
b=$APP.E(b,$APP.n(c)?c:0,null),$APP.n($APP.n(b)?$APP.q($APP.V.g(b)):b)?(c=$q(a,"x-command-palette-select-request",!0,{item:$APP.Mg(b)}),$APP.n(c.defaultPrevented)?a=null:($q(a,"x-command-palette-select",!1,{item:$APP.Mg(b)}),a=dr(a))):a=null,a):$APP.C.h(c,"Escape")?(b=Zq(a),$APP.n(Uq.g(b))?dr(a):null):null},jr=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;$q(a,"x-command-palette-query-change",!1,{query:""});ar(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=er(a);r=$APP.E(v,r,null);if($APP.n($APP.n(r)?$APP.q($APP.V.g(r)):r)){v=$q(a,"x-command-palette-select-request",!0,{item:$APP.Mg(r)});if($APP.n(v.defaultPrevented)){r=null;break a}$q(a,"x-command-palette-select",!1,{item:$APP.Mg(r)});
|
|
17
|
+
r=dr(a);break a}}r=null}return r}function d(){var r=Zq(a);return $APP.n(Tq.g(r))?dr(a):null}function e(r){return ir(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",""));$q(a,"x-command-palette-query-change",!1,{query:$APP.n(v)?
|
|
18
|
+
v:""});return ar(a)}var h=$APP.l(a,"__xCommandPaletteRefs"),k=$APP.l(h,"input"),m=$APP.l(h,"overlay"),p=$APP.l(h,"list");h=$APP.l(h,"clear-btn");k.addEventListener("input",g);k.addEventListener("keydown",e);m.addEventListener("click",d);p.addEventListener("click",c);h.addEventListener("click",b);$APP.ma(a,"__xCommandPaletteHandlers",{input:g,keydown:e,scrim:d,list:c,clear:b})},kr=function(a){var b=$APP.l(a,"__xCommandPaletteRefs");a=$APP.l(a,"__xCommandPaletteHandlers");if($APP.n($APP.n(b)?a:b)){var c=
|
|
19
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},lr=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
20
|
this.setAttribute(c,""):this.removeAttribute(c)}})},mr=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 ar(this)}})},nr=function(a){Object.defineProperty(a,"open",{configurable:!0,writable:!0,value:function(){return cr(this)}});Object.defineProperty(a,"close",{configurable:!0,writable:!0,value:function(){return dr(this)}});
|
|
21
21
|
Object.defineProperty(a,"toggle",{configurable:!0,writable:!0,value:function(){return $APP.n(this.hasAttribute("open"))?dr(this):cr(this)}})},pr=function(){var a=class extends HTMLElement{};a.observedAttributes=or;var b=a.prototype;lr(b,"open","open");lr(b,"disabled","disabled");mr(b);nr(b);b.connectedCallback=function(){if(!$APP.n($APP.l(this,"__xCommandPaletteRefs"))){var c=this.attachShadow({mode:"open"}),d=Yq("style"),e=Yq("div"),g=Yq("div"),h=Yq("div"),k=Yq("span"),m=Yq("input"),p=Yq("button"),
|
|
@@ -23,11 +23,11 @@ r=Yq("div"),v=Yq("div"),x=Yq("div");d.textContent=":host{display:contents;}[part
|
|
|
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
24
|
"list");m.setAttribute("aria-expanded","false");m.setAttribute("aria-controls","x-cp-list");p.setAttribute("part","clear-btn");p.setAttribute("type","button");p.setAttribute("aria-label","Clear");p.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");x.setAttribute("part","empty");x.setAttribute("hidden","");h.appendChild(k);h.appendChild(m);h.appendChild(p);
|
|
25
25
|
r.appendChild(v);r.appendChild(x);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":p,list:v,empty:x}}kr(this);jr(this);return br(this)};b.disconnectedCallback=function(){return kr(this)};b.attributeChangedCallback=function(){return br(this)};return a},qr=function(){return $APP.n(customElements.get("x-command-palette"))?null:customElements.define("x-command-palette",pr())},rr=function rr(a,b,c){var e=
|
|
26
|
-
a.j-2>>>b&31;if(b>5){b-=5;var g=c.i[e];a=rr.m?rr.m(a,b,g):rr.call(null,a,b,g);if(a==null&&e===0)return null;c=$APP.
|
|
27
|
-
$APP.
|
|
28
|
-
$APP.
|
|
29
|
-
var Sq=new $APP.
|
|
30
|
-
"search-str",-821246171),Rq=new $APP.
|
|
31
|
-
"disabled-raw",498098381),tr=new $APP.
|
|
32
|
-
$APP.
|
|
33
|
-
$APP.Y,new $APP.Q(null,1,[tr,sr],null)],null),"x-command-palette-query-change",new $APP.Q(null,2,[$APP.Dj,!1,$APP.Y,new $APP.Q(null,1,[new $APP.
|
|
26
|
+
a.j-2>>>b&31;if(b>5){b-=5;var g=c.i[e];a=rr.m?rr.m(a,b,g):rr.call(null,a,b,g);if(a==null&&e===0)return null;c=$APP.Sd(c);c.i[e]=a;return c}if(e===0)return null;c=$APP.Sd(c);c.i[e]=null;return c};$APP.Wc.prototype.ua=$APP.ca(48,function(){return this.ga(null)});$APP.Xc.prototype.ua=$APP.ca(47,function(){throw Error("Can't pop empty list");});
|
|
27
|
+
$APP.$d.prototype.ua=$APP.ca(46,function(){if(this.j===0)throw Error("Can't pop empty vector");if(1===this.j)return $APP.Ta($APP.Nd,this.s);if(1<this.j-$APP.Td(this))return new $APP.$d(this.s,this.j-1,this.shift,this.root,this.na.slice(0,-1),null);var a=$APP.Vd(this,this.j-2),b=rr(this,this.shift,this.root);b=b==null?$APP.ae:b;var c=this.j-1;return 5<this.shift&&b.i[1]==null?new $APP.$d(this.s,c,this.shift-5,b.i[0],a,null):new $APP.$d(this.s,c,this.shift,b,a,null)});
|
|
28
|
+
$APP.xe.prototype.ua=$APP.ca(45,function(){return new $APP.$d(null,1,5,$APP.ae,[this.key],null)});$APP.vf.prototype.ua=$APP.ca(44,function(){return new $APP.$d(null,1,5,$APP.ae,[this.key],null)});$APP.wf.prototype.ua=$APP.ca(43,function(){return new $APP.$d(null,1,5,$APP.ae,[this.key],null)});
|
|
29
|
+
var Sq=new $APP.M(null,"empty-text","empty-text",1554384594),Tq=new $APP.M(null,"close-on-scrim?","close-on-scrim?",-367113965),Mq=new $APP.M(null,"close-on-scrim-raw","close-on-scrim-raw",159828234),Lq=new $APP.M(null,"empty-text-raw","empty-text-raw",1477406757),sr=new $APP.Fb(null,"object","object",-1179821820,null),Fq=new $APP.M(null,"group","group",582596132),Qq=new $APP.M(null,"dismissible-raw","dismissible-raw",947680658),fr=new $APP.M(null,"down","down",1565245570),Gq=new $APP.M(null,"search-str",
|
|
30
|
+
"search-str",-821246171),Rq=new $APP.M(null,"modal-raw","modal-raw",-263722282),Uq=new $APP.M(null,"close-on-escape?","close-on-escape?",-1559868909),hr=new $APP.M(null,"up","up",-269712113),Wq=new $APP.M(null,"modal?","modal?",2146094679),Iq=new $APP.M(null,"groups","groups",-136896102),Oq=new $APP.M(null,"close-on-escape-raw","close-on-escape-raw",-1942646255),Vq=new $APP.M(null,"scrim?","scrim?",744210580),Pq=new $APP.M(null,"no-scrim-raw","no-scrim-raw",-1344365743),Nq=new $APP.M(null,"disabled-raw",
|
|
31
|
+
"disabled-raw",498098381),tr=new $APP.M(null,"item","item",249373802);var or="open modal dismissible disabled no-scrim close-on-scrim close-on-escape label placeholder empty-text".split(" ");
|
|
32
|
+
$APP.zd(["x-command-palette-open-request",new $APP.Q(null,2,[$APP.Dj,!0,$APP.Y,$APP.Ad],null),"x-command-palette-open",new $APP.Q(null,2,[$APP.Dj,!1,$APP.Y,$APP.Ad],null),"x-command-palette-close-request",new $APP.Q(null,2,[$APP.Dj,!0,$APP.Y,$APP.Ad],null),"x-command-palette-close",new $APP.Q(null,2,[$APP.Dj,!1,$APP.Y,$APP.Ad],null),"x-command-palette-select-request",new $APP.Q(null,2,[$APP.Dj,!0,$APP.Y,new $APP.Q(null,1,[tr,sr],null)],null),"x-command-palette-select",new $APP.Q(null,2,[$APP.Dj,!1,
|
|
33
|
+
$APP.Y,new $APP.Q(null,1,[tr,sr],null)],null),"x-command-palette-query-change",new $APP.Q(null,2,[$APP.Dj,!1,$APP.Y,new $APP.Q(null,1,[new $APP.M(null,"query","query",-1288509510),$APP.X],null)],null)]);$APP.ja("baredom.exports.x_command_palette.init",qr);export const init=qr;
|
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.dk,
|
|
5
|
-
a=$APP.W.g(a);return $APP.n(a)?b.setAttribute("aria-label",a):b.removeAttribute("aria-label")},
|
|
6
|
-
d.setAttribute("part","base");d.appendChild(e);b.appendChild(c);b.appendChild(d);this.__xContainerState={root:b,base:d,slot:e}}return
|
|
7
|
-
|
|
2
|
+
var uB=function(a,b,c){return typeof a==="string"&&$APP.K(b,a)?a:c},vB=function(a){return a.__xContainerState},wB=function(a){Object.defineProperty(a,"fluid",{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute("fluid")},set:function(b){return $APP.n($APP.J(b))?this.setAttribute("fluid",""):this.removeAttribute("fluid")}})},xB=function(a){Object.defineProperty(a,"center",{configurable:!0,enumerable:!0,get:function(){return $APP.O("false",this.getAttribute("center"))},set:function(b){return $APP.J(b)?
|
|
3
|
+
this.removeAttribute("center"):this.setAttribute("center","false")}})},EB=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,[yB,c,$APP.Qg,d,$APP.dk,e,zB,g,AB,a.hasAttribute("fluid"),$APP.W,a.getAttribute("label")],null);var h=$APP.N(a);a=$APP.H(h,yB);c=$APP.H(h,$APP.Qg);d=$APP.H(h,$APP.dk);e=$APP.H(h,zB);g=$APP.H(h,AB);h=$APP.H(h,$APP.W);a=new $APP.Q(null,6,[yB,uB(a,BB,"div"),$APP.Qg,uB(c,CB,
|
|
4
|
+
"lg"),$APP.dk,uB(d,DB,"md"),zB,$APP.J(e),AB,$APP.J(g),$APP.W,typeof h==="string"&&$APP.O(h,"")?h:null],null);g=yB.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.Qg.g(a));b.setAttribute("data-padding",$APP.dk.g(a));b.setAttribute("data-center",$APP.n(zB.g(a))?"true":"false");b.setAttribute("data-fluid",$APP.n(AB.g(a))?"true":"false");
|
|
5
|
+
a=$APP.W.g(a);return $APP.n(a)?b.setAttribute("aria-label",a):b.removeAttribute("aria-label")},GB=function(){var a=class extends HTMLElement{};a.observedAttributes=FB;a.prototype.connectedCallback=function(){if(!$APP.n(vB(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 EB(this,vB(this))};a.prototype.disconnectedCallback=function(){return null};a.prototype.attributeChangedCallback=function(){var b=vB(this);return $APP.n(b)?EB(this,b):null};xB(a.prototype);wB(a.prototype);return a},HB=function(){$APP.n(customElements.get("x-container"))||customElements.define("x-container",GB());return null},yB=new $APP.M(null,"as","as",1148689641),
|
|
7
|
+
zB=new $APP.M(null,"center","center",-748944368),AB=new $APP.M(null,"fluid","fluid",-1823657759);var BB=new $APP.R(null,new $APP.Q(null,8,["article",null,"footer",null,"section",null,"main",null,"nav",null,"div",null,"aside",null,"header",null],null),null),CB=new $APP.R(null,new $APP.Q(null,6,["xs",null,"md",null,"lg",null,"full",null,"xl",null,"sm",null],null),null),DB=new $APP.R(null,new $APP.Q(null,4,["none",null,"md",null,"lg",null,"sm",null],null),null),FB="as size padding center fluid label".split(" ");$APP.ja("baredom.exports.x_container.init",HB);export const init=HB;
|
package/dist/x-context-menu.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
k=$APP.
|
|
4
|
-
2,[$APP.Wi,c,$APP.Ui,g+e+b],null)}}
|
|
5
|
-
|
|
6
|
-
"string"&&$APP.
|
|
7
|
-
$APP.n(b)||(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},
|
|
9
|
-
for(var c=null,d=0,e=0;;)if(e<d){var g=c.H(null,e);b.appendChild(g.cloneNode(!0));e+=1}else if(a=$APP.u(a))c=a,$APP.
|
|
10
|
-
$APP.q(k.contains(h.target)):k)?
|
|
11
|
-
"ArrowUp")?(h.preventDefault(),$APP.n(m)?(h=
|
|
12
|
-
"__onItemClick"),e=
|
|
13
|
-
if(
|
|
14
|
-
|
|
15
|
-
k=window.innerHeight,m=new $APP.Q(null,4,[$APP.Wi,b.left,$APP.Ui,b.top,$APP.
|
|
16
|
-
2,[$APP.
|
|
17
|
-
b,{configurable:!0,enumerable:!0,get:function(){return this.getAttribute(c)},set:function(d){return d!=null?this.setAttribute(c,""+$APP.
|
|
18
|
-
a.observedAttributes=
|
|
19
|
-
$APP.n(b)?(
|
|
20
|
-
|
|
2
|
+
var DP=function(a,b){return typeof a==="string"?(a=parseInt(a,10),$APP.q(isNaN(a))&&a>0?a:b):b},EP=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},FP=function(a,b,c,d){var e=$APP.N(c);c=$APP.H(e,$APP.Wi);var g=$APP.H(e,$APP.Ui),h=$APP.H(e,$APP.fh);e=$APP.H(e,$APP.Xj);var k=$APP.N(d);d=$APP.H(k,$APP.fh);
|
|
3
|
+
k=$APP.H(k,$APP.Xj);switch(a){case "bottom-start":return new $APP.Q(null,2,[$APP.Wi,c,$APP.Ui,g+e+b],null);case "bottom-end":return new $APP.Q(null,2,[$APP.Wi,c+h-d,$APP.Ui,g+e+b],null);case "top-start":return new $APP.Q(null,2,[$APP.Wi,c,$APP.Ui,g-k-b],null);case "top-end":return new $APP.Q(null,2,[$APP.Wi,c+h-d,$APP.Ui,g-k-b],null);case "right-start":return new $APP.Q(null,2,[$APP.Wi,c+h+b,$APP.Ui,g],null);case "left-start":return new $APP.Q(null,2,[$APP.Wi,c-d-b,$APP.Ui,g],null);default:return new $APP.Q(null,
|
|
4
|
+
2,[$APP.Wi,c,$APP.Ui,g+e+b],null)}},JP=function(a,b,c,d,e){function g(x){var y=FP(x,b,c,d);y=$APP.N(y);var A=$APP.H(y,$APP.Wi),D=$APP.H(y,$APP.Ui);y=A>=8&&A+m<=h-8;var G=D>=8&&D+p<=k-8;A=$APP.Bg.h($APP.Ag.h(A,8),h-m-8);D=$APP.Bg.h($APP.Ag.h(D,8),k-p-8);return new $APP.Q(null,5,[$APP.Wi,A,$APP.Ui,D,GP,x,HP,y&&G,IP,$APP.Ag.h(40,k-D-8)],null)}e=$APP.N(e);var h=$APP.H(e,$APP.fh),k=$APP.H(e,$APP.Xj);e=$APP.N(d);var m=$APP.H(e,$APP.fh),p=$APP.H(e,$APP.Xj),r=g(a),v=g(EP(a));return $APP.n(function(){var x=
|
|
5
|
+
HP.g(r);return $APP.n(x)?x:$APP.q(HP.g(v))}())?r:v},OP=function(a){a=new $APP.Q(null,5,[$APP.Xh,$APP.n(a.hasAttribute("open"))?a.getAttribute("open"):null,$APP.aj,$APP.n(a.hasAttribute("disabled"))?a.getAttribute("disabled"):null,$APP.Ak,a.getAttribute("placement"),KP,a.getAttribute("offset"),LP,a.getAttribute("z-index")],null);var b=$APP.N(a),c=$APP.H(b,$APP.Xh),d=$APP.H(b,$APP.aj),e=$APP.H(b,$APP.Ak);a=$APP.H(b,KP);b=$APP.H(b,LP);c=c!=null&&$APP.O(c,"false");d=d!=null&&$APP.O(d,"false");e=typeof e===
|
|
6
|
+
"string"&&$APP.K(MP,e)?e:"bottom-start";return new $APP.Q(null,5,[$APP.fk,c,$APP.V,d,$APP.Hj,e,$APP.Hh,DP(a,8),NP,DP(b,1E3)],null)},PP=function(a,b,c,d){b=new CustomEvent(b,{detail:d,bubbles:!0,composed:!0,cancelable:c});a.dispatchEvent(b);return $APP.q(b.defaultPrevented)},QP=function(a){return $APP.ic(a.querySelectorAll("[role\x3dmenuitem]:not([disabled]):not([aria-disabled\x3dtrue])"))},RP=function(a){return $APP.n(a)?a.focus():null},SP=function(a){var b=document.getElementById("__xOverlayRoot");
|
|
7
|
+
$APP.n(b)||(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.S.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},TP=function(a){return $APP.n(a)?a.shadowRoot.querySelector("[part\x3dpanel]"):null},UP=function(a,b,c,d){var e=$APP.N(d);d=$APP.H(e,NP);e=$APP.H(e,IP);a.style.zIndex=""+$APP.S.g(d);a=TP(a);$APP.n(a)&&(a.style.left=""+$APP.S.g(b)+"px",a.style.top=""+$APP.S.g(c)+"px",a.style.maxHeight=""+$APP.S.g(e)+"px")},VP=function(a,b){a=$APP.u($APP.ic(a.children));
|
|
9
|
+
for(var c=null,d=0,e=0;;)if(e<d){var g=c.H(null,e);b.appendChild(g.cloneNode(!0));e+=1}else if(a=$APP.u(a))c=a,$APP.Ac(c)?(a=$APP.ob(c),d=$APP.pb(c),c=a,g=$APP.B(a),a=d,d=g):(g=$APP.w(c),b.appendChild(g.cloneNode(!0)),a=$APP.z(c),c=null,d=0),e=0;else break},XP=function(a,b){function c(h){h.stopPropagation();h=h.target.closest("[role\x3dmenuitem]");return $APP.n(h)?(PP(a,"x-context-menu-select",!1,{item:h}),WP.h?WP.h(a,"select"):WP.call(null,a,"select")):null}function d(h){var k=TP(b);return $APP.n($APP.n(k)?
|
|
10
|
+
$APP.q(k.contains(h.target)):k)?WP.h?WP.h(a,"backdrop"):WP.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(),WP.h?WP.h(a,"keyboard"):WP.call(null,a,"keyboard")):$APP.C.h(k,"Tab")?WP.h?WP.h(a,"keyboard"):WP.call(null,a,"keyboard"):$APP.C.h(k,"ArrowDown")?(h.preventDefault(),$APP.n(m)?(h=QP(g),m=$APP.jd(h).indexOf(m),m=$APP.E(h,$APP.Sc(m+1,$APP.B(h)),null),m=RP(m)):m=RP($APP.w(QP(g))),m):$APP.C.h(k,
|
|
11
|
+
"ArrowUp")?(h.preventDefault(),$APP.n(m)?(h=QP(g),k=$APP.B(h),m=$APP.jd(h).indexOf(m),m=$APP.E(h,$APP.Sc(m+(k-1),k),null),m=RP(m)):m=RP($APP.w(QP(g))),m):($APP.C.h(k,"Enter")||$APP.C.h(k," "))&&$APP.n(m)?(h.preventDefault(),m.click()):null}var g=TP(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},YP=function(a){if($APP.n(a)){var b=$APP.l(a,"__onKey"),c=$APP.l(a,"__onClickBackdrop"),d=$APP.l(a,
|
|
12
|
+
"__onItemClick"),e=TP(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)}},WP=function(a,b){return $APP.n(a.hasAttribute("open"))&&PP(a,"x-context-menu-close-request",!0,{reason:b})?(a.removeAttribute("open"),YP($APP.l(a,"__xContextMenuLayer")),a.__xContextMenuLayer=null,PP(a,"x-context-menu-close",!1,{reason:b})):null},ZP=function(a,b,c,d){if($APP.n(a.hasAttribute("disabled")))return null;
|
|
13
|
+
if(PP(a,"x-context-menu-open-request",!0,{reason:d})){var e=OP(a);e=$APP.N(e);var g=$APP.H(e,$APP.Hj),h=$APP.H(e,$APP.Hh),k=$APP.H(e,NP),m=window.innerWidth,p=window.innerHeight,r=new $APP.Q(null,4,[$APP.Wi,b,$APP.Ui,c,$APP.fh,1,$APP.Xj,1],null);b=JP(g,h,r,new $APP.Q(null,2,[$APP.fh,200,$APP.Xj,300],null),new $APP.Q(null,2,[$APP.fh,m,$APP.Xj,p],null));var v=SP(k);VP(a,TP(v));XP(a,v);UP(v,$APP.Wi.g(b),$APP.Ui.g(b),$APP.zg.m(b,NP,k));a.setAttribute("open","");a.__xContextMenuLayer=v;requestAnimationFrame(function(){var x=
|
|
14
|
+
TP(v);if($APP.n(x)){var y=JP(g,h,r,new $APP.Q(null,2,[$APP.fh,x.offsetWidth,$APP.Xj,x.offsetHeight],null),new $APP.Q(null,2,[$APP.fh,m,$APP.Xj,p],null));UP(v,$APP.Wi.g(y),$APP.Ui.g(y),$APP.zg.m(y,NP,k));return RP($APP.w(QP(x)))}return null});return PP(a,"x-context-menu-open",!1,{reason:d})}return null},$P=function(a,b){if($APP.n(a.hasAttribute("disabled")))return null;b=b.getBoundingClientRect();var c=OP(a);c=$APP.N(c);var d=$APP.H(c,$APP.Hj),e=$APP.H(c,$APP.Hh),g=$APP.H(c,NP),h=window.innerWidth,
|
|
15
|
+
k=window.innerHeight,m=new $APP.Q(null,4,[$APP.Wi,b.left,$APP.Ui,b.top,$APP.fh,b.width,$APP.Xj,b.height],null);if(PP(a,"x-context-menu-open-request",!0,{reason:"programmatic"})){b=JP(d,e,m,new $APP.Q(null,2,[$APP.fh,200,$APP.Xj,300],null),new $APP.Q(null,2,[$APP.fh,h,$APP.Xj,k],null));var p=SP(g);VP(a,TP(p));XP(a,p);UP(p,$APP.Wi.g(b),$APP.Ui.g(b),$APP.zg.m(b,NP,g));a.setAttribute("open","");a.__xContextMenuLayer=p;requestAnimationFrame(function(){var r=TP(p);if($APP.n(r)){var v=JP(d,e,m,new $APP.Q(null,
|
|
16
|
+
2,[$APP.fh,r.offsetWidth,$APP.Xj,r.offsetHeight],null),new $APP.Q(null,2,[$APP.fh,h,$APP.Xj,k],null));UP(p,$APP.Wi.g(v),$APP.Ui.g(v),$APP.zg.m(v,NP,g));return RP($APP.w(QP(r)))}return null});return PP(a,"x-context-menu-open",!1,{reason:"programmatic"})}return null},aQ=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)}})},bQ=function(a,b,c){Object.defineProperty(a,
|
|
17
|
+
b,{configurable:!0,enumerable:!0,get:function(){return this.getAttribute(c)},set:function(d){return d!=null?this.setAttribute(c,""+$APP.S.g(d)):this.removeAttribute(c)}})},cQ=function(a){a.openAt=function(b,c){return ZP(this,b,c,"programmatic")};a.toggleAt=function(b,c){return $APP.n(this.hasAttribute("open"))?WP(this,"toggle"):ZP(this,b,c,"toggle")};a.openForElement=function(b){return $P(this,b)};a.close=function(){return WP(this,"programmatic")}},eQ=function(){var a=class extends HTMLElement{};
|
|
18
|
+
a.observedAttributes=dQ;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)?(YP(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)){YP(b);this.__xContextMenuLayer=null;b=void 0;break a}}b=null}return b};aQ(a.prototype,"open","open");aQ(a.prototype,"disabled","disabled");bQ(a.prototype,"placement","placement");bQ(a.prototype,"offset","offset");bQ(a.prototype,"zIndex","z-index");
|
|
20
|
+
cQ(a.prototype);return a},fQ=function(){return $APP.n(customElements.get("x-context-menu"))?null:customElements.define("x-context-menu",eQ())},IP=new $APP.M(null,"max-height","max-height",-612563804),GP=new $APP.M(null,"final-placement","final-placement",-1586044424),HP=new $APP.M(null,"fits","fits",2008565808),NP=new $APP.M(null,"z-index","z-index",1892827090),LP=new $APP.M(null,"z-index-raw","z-index-raw",-1179679257),KP=new $APP.M(null,"offset-raw","offset-raw",-1418404095);var dQ=["open","disabled","placement","offset","z-index"],MP=new $APP.R(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.ja("baredom.exports.x_context_menu.init",fQ);export const init=fQ;
|
package/dist/x-copy.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var Ju=function(a){return a==null?!0:$APP.C.h(a,"false")?!1:$APP.C.h(a,"0")?!1:!0},Ku=function(a){return typeof a==="string"&&$APP.
|
|
3
|
-
$APP.
|
|
4
|
-
$APP.
|
|
2
|
+
var Ju=function(a){return a==null?!0:$APP.C.h(a,"false")?!1:$APP.C.h(a,"0")?!1:!0},Ku=function(a){return typeof a==="string"&&$APP.O(a,"")?(a=parseInt(a,10),$APP.q(isNaN(a))&&a>0?a:1200):1200},Lu=function(a){return Math.min(1E4,Math.max(100,a))},Zu=function(a){var b=$APP.N(a);a=$APP.H(b,Mu);var c=$APP.H(b,Nu),d=$APP.H(b,Ou),e=$APP.H(b,$APP.Pg),g=$APP.H(b,$APP.vi),h=$APP.H(b,Pu),k=$APP.H(b,Qu),m=$APP.H(b,$APP.aj),p=$APP.H(b,Ru);b=$APP.H(b,Su);return $APP.gf([Tu,$APP.ij,Uu,Vu,Wu,$APP.ch,Xu,$APP.V,Yu,
|
|
3
|
+
$APP.Di],[Ju(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,Lu(Ku(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.J(m),function(){var r;if(r=typeof p==="string")r=(r=$APP.O(p,""))?p:r;return $APP.n(r)?r:"Copied"}(),typeof e==="string"&&$APP.O(e.trim(),"")?e.trim():null])},$u=function(a){var b=
|
|
4
|
+
$APP.N(a);a=$APP.H(b,$APP.Di);var c=$APP.H(b,$APP.ch),d=$APP.H(b,Uu);b=$APP.H(b,$APP.ij);return{text:$APP.n(a)?a:"",mode:$APP.n(b)?b:"text",from:$APP.n(c)?c:null,fromAttr:$APP.n(d)?d:null}},av=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")},bv=function(a){return Zu($APP.
|
|
7
|
-
$APP.
|
|
8
|
-
return typeof b==="string"&&$APP.
|
|
9
|
-
1,5,$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")},bv=function(a){return Zu($APP.gf([Ou,
|
|
7
|
+
$APP.Pg,$APP.vi,Pu,Qu,$APP.aj,Ru,Su,Mu,Nu],[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")]))},cv=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");
|
|
8
|
+
return typeof b==="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:""):""},dv=function(a){var b=cv(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.Mg(new $APP.$d(null,
|
|
9
|
+
1,5,$APP.ae,[new ClipboardItem({"text/html":new Blob([b],{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
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;}}})},ev=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.
|
|
12
|
-
{detail:c,bubbles:!0,composed:!0,cancelable:d});a.dispatchEvent(b);return b},gv=function(a){if($APP.n(a.hasAttribute("disabled")))return Promise.resolve(null);var b=bv(a),c=$u(b);c=fv(a,"x-copy-request",c,!0);return $APP.n(c.defaultPrevented)?Promise.resolve(null):dv(a).then(function(d){fv(a,"x-copy-success",{text:$APP.n(d)?d:""},!1);$APP.n(Tu.g(b))&&ev(a,"success",Yu.g(b),Wu.g(b));return d}).catch(function(d){fv(a,"x-copy-error",{error:""+$APP.
|
|
13
|
-
return Promise.reject(d)})},hv=function(a,b){if(typeof b==="string"&&$APP.
|
|
14
|
-
iv=function(a){function b(e){var g=a.getAttribute("hotkey");return $APP.n(hv(e,g))?(e.preventDefault(),gv(a)):null}function c(){return gv(a)}var d=av(a);$APP.l(d,"trigger").addEventListener("click",c);document.addEventListener("keydown",b);$APP.
|
|
15
|
-
"click");b=$APP.l(b,"keydown");$APP.n(d)&&c.removeEventListener("click",d);$APP.n(b)&&document.removeEventListener("keydown",b)}a.__xCopyHandlers=null},kv=function(a){var b=av(a),c=a.hasAttribute("disabled");$APP.l(b,"trigger").disabled=$APP.
|
|
16
|
-
2,5,$APP
|
|
17
|
-
v,x,y,A,D,
|
|
18
|
-
this.setAttribute(
|
|
19
|
-
"true"):this.setAttribute("show-tooltip","false")},enumerable:!0,configurable:!0});Object.defineProperty(a,"tooltipMs",{get:function(){return Ku(this.getAttribute("tooltip-ms"))},set:function(r){return r==null?this.removeAttribute("tooltip-ms"):this.setAttribute("tooltip-ms",""+$APP.
|
|
20
|
-
configurable:!0});Object.defineProperty(a,"copy",{value:function(){return gv(this)},enumerable:!0,configurable:!0,writable:!0})},nv=function(){var a=class extends HTMLElement{};a.observedAttributes=mv;a.prototype.connectedCallback=function(){av(this);jv(this);iv(this);kv(this);return null};a.prototype.disconnectedCallback=function(){jv(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.
|
|
21
|
-
customElements.define("x-copy",nv());return null},Tu=new $APP.
|
|
22
|
-
"hotkey","hotkey",-329017295),Ru=new $APP.
|
|
23
|
-
$APP.
|
|
24
|
-
"note","note",1426297904),"property-only override"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.
|
|
25
|
-
$APP.
|
|
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))}},fv=function(a,b,c,d){b=new CustomEvent(b,
|
|
12
|
+
{detail:c,bubbles:!0,composed:!0,cancelable:d});a.dispatchEvent(b);return b},gv=function(a){if($APP.n(a.hasAttribute("disabled")))return Promise.resolve(null);var b=bv(a),c=$u(b);c=fv(a,"x-copy-request",c,!0);return $APP.n(c.defaultPrevented)?Promise.resolve(null):dv(a).then(function(d){fv(a,"x-copy-success",{text:$APP.n(d)?d:""},!1);$APP.n(Tu.g(b))&&ev(a,"success",Yu.g(b),Wu.g(b));return d}).catch(function(d){fv(a,"x-copy-error",{error:""+$APP.S.g(d)},!1);$APP.n(Tu.g(b))&&ev(a,"error",Xu.g(b),Wu.g(b));
|
|
13
|
+
return Promise.reject(d)})},hv=function(a,b){if(typeof b==="string"&&$APP.O(b,"")){var c=b.toLowerCase().split("+");b=$APP.lc(c);var d=$APP.J($APP.Dd(function(h){return $APP.C.h(h,"ctrl")},c)),e=$APP.J($APP.Dd(function(h){return $APP.C.h(h,"shift")},c)),g=$APP.J($APP.Dd(function(h){return $APP.C.h(h,"alt")},c));c=$APP.J($APP.Dd(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
|
+
iv=function(a){function b(e){var g=a.getAttribute("hotkey");return $APP.n(hv(e,g))?(e.preventDefault(),gv(a)):null}function c(){return gv(a)}var d=av(a);$APP.l(d,"trigger").addEventListener("click",c);document.addEventListener("keydown",b);$APP.ma(a,"__xCopyHandlers",{click:c,keydown:b})},jv=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},kv=function(a){var b=av(a),c=a.hasAttribute("disabled");$APP.l(b,"trigger").disabled=$APP.J(c);$APP.n(c)?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled")},lv=function(a){for(var b=$APP.u(new $APP.$d(null,7,5,$APP.ae,[new $APP.$d(null,2,5,$APP.ae,["text","text"],null),new $APP.$d(null,2,5,$APP.ae,["from","from"],null),new $APP.$d(null,
|
|
16
|
+
2,5,$APP.ae,["fromAttr","from-attr"],null),new $APP.$d(null,2,5,$APP.ae,["mode","mode"],null),new $APP.$d(null,2,5,$APP.ae,["successMessage","success-message"],null),new $APP.$d(null,2,5,$APP.ae,["errorMessage","error-message"],null),new $APP.$d(null,2,5,$APP.ae,["hotkey","hotkey"],null)],null)),c=null,d=0,e=0;;)if(e<d){var g=c.H(null,e),h=$APP.E(g,0,null),k=$APP.E(g,1,null);Object.defineProperty(a,h,{get:function(r,v,x,y,A,D,G){return function(){return this.getAttribute(G)}}(b,c,d,e,g,h,k),set:function(r,
|
|
17
|
+
v,x,y,A,D,G){return function(I){return I==null?this.removeAttribute(G):this.setAttribute(G,""+$APP.S.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.Ac(g))b=$APP.ob(g),e=$APP.pb(g),c=b,d=$APP.B(b),b=e;else{k=$APP.w(g);var m=$APP.E(k,0,null),p=$APP.E(k,1,null);Object.defineProperty(a,m,{get:function(r,v,x,y,A,D,G){return function(){return this.getAttribute(G)}}(b,c,d,e,k,m,p,g,h),set:function(r,v,x,y,A,D,G){return function(I){return I==null?this.removeAttribute(G):
|
|
18
|
+
this.setAttribute(G,""+$APP.S.g(I))}}(b,c,d,e,k,m,p,g,h),enumerable:!0,configurable:!0});b=$APP.z(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 Ju(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 Ku(this.getAttribute("tooltip-ms"))},set:function(r){return r==null?this.removeAttribute("tooltip-ms"):this.setAttribute("tooltip-ms",""+$APP.S.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 gv(this)},enumerable:!0,configurable:!0,writable:!0})},nv=function(){var a=class extends HTMLElement{};a.observedAttributes=mv;a.prototype.connectedCallback=function(){av(this);jv(this);iv(this);kv(this);return null};a.prototype.disconnectedCallback=function(){jv(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.O(c,d)&&kv(this);return null};lv(a.prototype);return a},ov=function(){$APP.n(customElements.get("x-copy"))||
|
|
21
|
+
customElements.define("x-copy",nv());return null},Tu=new $APP.M(null,"show-tooltip?","show-tooltip?",-1214081087),Nu=new $APP.M(null,"tooltip-ms-raw","tooltip-ms-raw",-1973326401),pv=new $APP.M(null,"fromAttr","fromAttr",-1768252533),Yu=new $APP.M(null,"success-message","success-message",-96541601),Qu=new $APP.M(null,"from-attr-raw","from-attr-raw",761657416),Wu=new $APP.M(null,"tooltip-ms","tooltip-ms",1062450417),Pu=new $APP.M(null,"error-message-raw","error-message-raw",1910536231),Vu=new $APP.M(null,
|
|
22
|
+
"hotkey","hotkey",-329017295),Ru=new $APP.M(null,"success-message-raw","success-message-raw",388691116),Ou=new $APP.M(null,"from-raw","from-raw",-44462428),Uu=new $APP.M(null,"from-attr","from-attr",1217901743),Mu=new $APP.M(null,"hotkey-raw","hotkey-raw",1972404222),Xu=new $APP.M(null,"error-message","error-message",1756021561),Su=new $APP.M(null,"show-tooltip-raw","show-tooltip-raw",453600717);var mv="text from from-attr mode disabled show-tooltip tooltip-ms success-message error-message hotkey".split(" ");
|
|
23
|
+
$APP.gf([new $APP.M(null,"errorMessage","errorMessage",982744869),$APP.Fj,new $APP.M(null,"textValue","textValue",-598870870),$APP.ij,pv,new $APP.M(null,"tooltipMs","tooltipMs",1056463375),Vu,$APP.ch,new $APP.M(null,"showTooltip","showTooltip",482349691),new $APP.M(null,"successMessage","successMessage",-789572803),$APP.Di],[new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.T,"error-message"],null),new $APP.Q(null,2,[$APP.Z,$APP.Yj,$APP.T,"disabled"],null),new $APP.Q(null,3,[$APP.Z,$APP.X,$APP.T,null,new $APP.M(null,
|
|
24
|
+
"note","note",1426297904),"property-only override"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.T,"mode"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.T,"from-attr"],null),new $APP.Q(null,2,[$APP.Z,$APP.U,$APP.T,"tooltip-ms"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.T,"hotkey"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.T,"from"],null),new $APP.Q(null,2,[$APP.Z,$APP.Yj,$APP.T,"show-tooltip"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.T,"success-message"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,
|
|
25
|
+
$APP.T,"text"],null)]);$APP.zd(["x-copy-request",new $APP.Q(null,2,[$APP.Dj,!0,$APP.Y,new $APP.Q(null,4,[$APP.Di,$APP.X,$APP.ij,$APP.X,$APP.ch,$APP.X,pv,$APP.X],null)],null),"x-copy-success",new $APP.Q(null,2,[$APP.Dj,!1,$APP.Y,new $APP.Q(null,1,[$APP.Di,$APP.X],null)],null),"x-copy-error",new $APP.Q(null,2,[$APP.Dj,!1,$APP.Y,new $APP.Q(null,1,[$APP.Vh,$APP.X],null)],null)]);$APP.ja("baredom.exports.x_copy.init",ov);export const init=ov;
|
package/dist/x-currency-field.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
"")?void 0:b,{minimumFractionDigits:2,maximumFractionDigits:2})).format(c)}catch(d){return a}},
|
|
2
|
+
var LC=function(a){a=(""+$APP.S.g($APP.n(a)?a:"")).trim().toUpperCase();return $APP.C.h(a,"")?"USD":a},MC=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},NC=function(a,b){try{var c=(new Intl.NumberFormat($APP.C.h(b,"")?"en-US":b,{style:"currency",currency:a})).formatToParts(0),d=$APP.Dd(function(e){return $APP.C.h("currency",e.type)?e.value:null},$APP.ic(c));return $APP.n(d)?d:a}catch(e){return a}},OC=function(a,b){var c=parseFloat(a);if($APP.n(isNaN(c)))return a;try{return(new Intl.NumberFormat($APP.C.h(b,
|
|
3
|
+
"")?void 0:b,{minimumFractionDigits:2,maximumFractionDigits:2})).format(c)}catch(d){return a}},PC=function(a){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("label"),g=document.createElement("div"),h=document.createElement("span"),k=document.createElement("input"),m=document.createElement("span"),p=document.createElement("span");c.textContent=":host{display:block;color-scheme:light dark;--x-currency-field-bg:#ffffff;--x-currency-field-color:#111827;--x-currency-field-border:1px solid #d1d5db;--x-currency-field-border-radius:6px;--x-currency-field-focus-ring-color:#2563eb;--x-currency-field-symbol-color:#6b7280;--x-currency-field-label-color:#374151;--x-currency-field-hint-color:#6b7280;--x-currency-field-error-color:#dc2626;--x-currency-field-disabled-opacity:0.45;}@media (prefers-color-scheme:dark){:host{--x-currency-field-bg:#1f2937;--x-currency-field-color:#f9fafb;--x-currency-field-border:1px solid #4b5563;--x-currency-field-focus-ring-color:#3b82f6;--x-currency-field-symbol-color:#9ca3af;--x-currency-field-label-color:#d1d5db;--x-currency-field-hint-color:#9ca3af;--x-currency-field-error-color:#f87171;}}[part\x3dfield]{display:flex;flex-direction:column;gap:0.25rem;}[part\x3dlabel]{display:block;font-size:0.875rem;font-weight:500;color:var(--x-currency-field-label-color);}.label-hidden{display:none;}[part\x3dinput-wrapper]{display:flex;align-items:center;background:var(--x-currency-field-bg);border:var(--x-currency-field-border);border-radius:var(--x-currency-field-border-radius);transition:border-color 120ms ease,box-shadow 120ms ease;}[part\x3dinput-wrapper]:focus-within{border-color:var(--x-currency-field-focus-ring-color);box-shadow:0 0 0 3px color-mix(in srgb,var(--x-currency-field-focus-ring-color) 20%,transparent);}:host([data-invalid]) [part\x3dinput-wrapper]{border-color:var(--x-currency-field-error-color);}:host([data-invalid]) [part\x3dinput-wrapper]:focus-within{box-shadow:0 0 0 3px color-mix(in srgb,var(--x-currency-field-error-color) 20%,transparent);}[part\x3dsymbol]{flex-shrink:0;padding:0.5rem 0 0.5rem 0.75rem;font-size:1rem;color:var(--x-currency-field-symbol-color);user-select:none;pointer-events:none;}[part\x3dinput]{flex:1;min-width:0;padding:0.5rem 0.75rem;background:transparent;color:var(--x-currency-field-color);border:none;outline:none;font-size:1rem;line-height:1.5;font-family:inherit;}[part\x3dinput]:disabled{opacity:1;cursor:not-allowed;}:host([disabled]) [part\x3dinput-wrapper]{opacity:var(--x-currency-field-disabled-opacity);cursor:not-allowed;}[part\x3dhint]{display:block;font-size:0.8125rem;color:var(--x-currency-field-hint-color);}.hint-hidden{display:none;}[part\x3derror]{display:block;font-size:0.8125rem;color:var(--x-currency-field-error-color);}.error-hidden{display:none;}@media (prefers-reduced-motion:reduce){[part\x3dinput-wrapper]{transition:none;}}";
|
|
4
4
|
d.setAttribute("part","field");e.setAttribute("part","label");e.setAttribute("id","label");e.setAttribute("for","input");g.setAttribute("part","input-wrapper");h.setAttribute("part","symbol");h.setAttribute("aria-hidden","true");k.setAttribute("part","input");k.setAttribute("id","input");k.setAttribute("inputmode","decimal");k.setAttribute("aria-labelledby","label");m.setAttribute("part","hint");m.setAttribute("id","hint");m.setAttribute("aria-live","polite");p.setAttribute("part","error");p.setAttribute("id",
|
|
5
|
-
"error");p.setAttribute("role","alert");p.setAttribute("aria-live","assertive");g.appendChild(h);g.appendChild(k);d.appendChild(e);d.appendChild(g);d.appendChild(m);d.appendChild(p);b.appendChild(c);b.appendChild(d);a.__xCurrencyFieldRefs={field:d,label:e,wrapper:g,symbol:h,input:k,hint:m,error:p}},
|
|
6
|
-
$APP.q(isNaN(a));k=$APP.n(k)?parseFloat(k):null;m=$APP.n(m)?parseFloat(m):null;return $APP.n(e)?b.setValidity({customError:!0},g,c):$APP.n($APP.n(h)?$APP.C.h(d,""):h)?b.setValidity({valueMissing:!0},"Please fill in this field.",c):$APP.
|
|
7
|
-
"Value must be at most "+$APP.
|
|
8
|
-
a.hasAttribute("required"),a.getAttribute("max"),a.hasAttribute("readonly"),a.getAttribute("value"),a.getAttribute("locale"),a.getAttribute("placeholder")]);var k=$APP.
|
|
9
|
-
$APP.uk,$APP.Mj,$APP.
|
|
10
|
-
$APP.
|
|
11
|
-
e.disabled=$APP.V.g(h);e.readOnly=$APP.uk.g(h);e.required=$APP.
|
|
12
|
-
c.classList.add("label-hidden");g.textContent=$APP.qj.g(h);$APP.n(r)?g.classList.remove("hint-hidden"):g.classList.add("hint-hidden");b.textContent=m;$APP.n(p)?b.classList.remove("error-hidden"):b.classList.add("error-hidden");
|
|
13
|
-
$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=a.getAttribute("value");return b.value=$APP.n(c)?c:""}return null}},
|
|
14
|
-
$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=b.value,d=parseFloat(c);c=$APP.n(isNaN(d))?c:""+$APP.
|
|
15
|
-
c);b.addEventListener("input",d);b.addEventListener("change",e);a.__xCurrencyFieldHandlers={focus:c,input:d,change:e}}},
|
|
16
|
-
(
|
|
17
|
-
b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){var d=this.getAttribute(c);return $APP.n(d)?d:""},set:function(d){d!=null&&$APP.
|
|
18
|
-
this.getAttribute("value");return $APP.n(b)?b:""},set:function(b){b=b!=null&&$APP.
|
|
19
|
-
|
|
20
|
-
$APP.n(c)&&(c=$APP.l(c,"input"),$APP.C.h(c,this.shadowRoot.activeElement)||(
|
|
21
|
-
return
|
|
22
|
-
"currency","currency",-898327568),
|
|
23
|
-
$APP.
|
|
24
|
-
new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.
|
|
5
|
+
"error");p.setAttribute("role","alert");p.setAttribute("aria-live","assertive");g.appendChild(h);g.appendChild(k);d.appendChild(e);d.appendChild(g);d.appendChild(m);d.appendChild(p);b.appendChild(c);b.appendChild(d);a.__xCurrencyFieldRefs={field:d,label:e,wrapper:g,symbol:h,input:k,hint:m,error:p}},QC=function(a,b,c,d){var e=a.hasAttribute("error");var g=a.getAttribute("error");g=$APP.n(g)?g:"";var h=a.hasAttribute("required"),k=a.getAttribute("min"),m=a.getAttribute("max");a=parseFloat(d);var p=
|
|
6
|
+
$APP.q(isNaN(a));k=$APP.n(k)?parseFloat(k):null;m=$APP.n(m)?parseFloat(m):null;return $APP.n(e)?b.setValidity({customError:!0},g,c):$APP.n($APP.n(h)?$APP.C.h(d,""):h)?b.setValidity({valueMissing:!0},"Please fill in this field.",c):$APP.O(d,"")&&!p?b.setValidity({badInput:!0},"Please enter a valid number.",c):$APP.n(p?$APP.n(k)?$APP.q(isNaN(k))&&a<k:k:p)?b.setValidity({rangeUnderflow:!0},"Value must be at least "+$APP.S.g(k)+".",c):$APP.n(p?$APP.n(m)?$APP.q(isNaN(m))&&a>m:m:p)?b.setValidity({rangeOverflow:!0},
|
|
7
|
+
"Value must be at most "+$APP.S.g(m)+".",c):b.setValidity({},"",c)},VC=function(a){var b=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){var c=$APP.l(b,"label"),d=$APP.l(b,"symbol"),e=$APP.l(b,"input"),g=$APP.l(b,"hint");b=$APP.l(b,"error");var h=$APP.gf([$APP.Dh,RC,$APP.Ai,$APP.$h,$APP.ui,$APP.aj,SC,$APP.Tg,$APP.Mh,$APP.Cj,$APP.Rj,TC,$APP.gi],[a.getAttribute("label"),a.getAttribute("currency"),a.getAttribute("name"),a.getAttribute("error"),a.getAttribute("hint"),a.hasAttribute("disabled"),a.getAttribute("min"),
|
|
8
|
+
a.hasAttribute("required"),a.getAttribute("max"),a.hasAttribute("readonly"),a.getAttribute("value"),a.getAttribute("locale"),a.getAttribute("placeholder")]);var k=$APP.N(h);h=$APP.H(k,$APP.gi);var m=$APP.H(k,$APP.Dh),p=$APP.H(k,RC),r=$APP.H(k,$APP.Ai),v=$APP.H(k,$APP.$h),x=$APP.H(k,$APP.ui),y=$APP.H(k,$APP.aj),A=$APP.H(k,SC),D=$APP.H(k,$APP.Tg),G=$APP.H(k,$APP.Mh),I=$APP.H(k,$APP.Cj),F=$APP.H(k,$APP.Rj);k=$APP.H(k,TC);var P=$APP.n(v)?v:"",la=$APP.n(x)?x:"",Ca=$APP.n(m)?m:"";h=$APP.gf([$APP.lk,$APP.zh,
|
|
9
|
+
$APP.uk,$APP.Mj,$APP.Jh,$APP.vk,$APP.mj,$APP.si,$APP.Fi,$APP.Oh,$APP.qj,UC,$APP.Ih,$APP.W,$APP.Vh,$APP.V],[$APP.n(A)?A:"",$APP.J(D),$APP.J(I),$APP.n(h)?h:"",typeof x==="string"&&$APP.O(x,""),$APP.n(k)?k:"",$APP.n(r)?r:"",$APP.n(F)?F:"",typeof m==="string"&&$APP.O(m,""),typeof v==="string"&&$APP.O(v,""),la,LC(p),$APP.n(G)?G:"",Ca,P,$APP.J(y)]);m=$APP.Oh.g(h);$APP.n(m)?p=null:(v=$APP.N(h),p=$APP.H(v,$APP.si),r=$APP.H(v,$APP.lk),v=$APP.H(v,$APP.Ih),x=parseFloat(p),y=$APP.O(p,"")&&$APP.q(isNaN(x)),A=
|
|
10
|
+
$APP.O(r,"")?parseFloat(r):null,D=$APP.O(v,"")?parseFloat(v):null,p=$APP.O(p,"")&&!y?"Please enter a valid number.":$APP.n(y?$APP.n(A)?$APP.q(isNaN(A))&&x<A:A:y)?"Value must be at least "+$APP.S.g(r)+".":$APP.n(y?$APP.n(D)?$APP.q(isNaN(D))&&x>D:D:y)?"Value must be at most "+$APP.S.g(v)+".":"");r=p;p=$APP.n(m)?m:$APP.O($APP.n(r)?r:"","");m=$APP.n(m)?$APP.Vh.g(h):$APP.n(r)?r:"";r=$APP.Jh.g(h);v=$APP.Fi.g(h);y=UC.g(h);x=$APP.vk.g(h);d.textContent=NC(y,x);e.name=$APP.mj.g(h);e.placeholder=$APP.Mj.g(h);
|
|
11
|
+
e.disabled=$APP.V.g(h);e.readOnly=$APP.uk.g(h);e.required=$APP.zh.g(h);d=$APP.n($APP.zh.g(h))?"true":"false";e.setAttribute("aria-required",d);e.setAttribute("aria-invalid",$APP.n(p)?"true":"false");d=$APP.n($APP.n(r)?p:r)?"hint error":$APP.n(r)?"hint":$APP.n(p)?"error":null;$APP.n(d)?e.setAttribute("aria-describedby",d):e.removeAttribute("aria-describedby");$APP.C.h(e,a.shadowRoot.activeElement)||(d=$APP.si.g(h),e.value=$APP.C.h(d,"")?"":OC(d,x));c.textContent=$APP.W.g(h);$APP.n(v)?c.classList.remove("label-hidden"):
|
|
12
|
+
c.classList.add("label-hidden");g.textContent=$APP.qj.g(h);$APP.n(r)?g.classList.remove("hint-hidden"):g.classList.add("hint-hidden");b.textContent=m;$APP.n(p)?b.classList.remove("error-hidden"):b.classList.add("error-hidden");MC(a,"data-invalid",p);c=$APP.l(a,"__xCurrencyFieldInternals");$APP.n(c)?(g=a.getAttribute("value"),a=QC(a,c,e,$APP.n(g)?g:"")):a=null;return a}return null},WC=function(a,b,c){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:!1}))},XC=function(a){return function(){var b=
|
|
13
|
+
$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=a.getAttribute("value");return b.value=$APP.n(c)?c:""}return null}},YC=function(a){return function(){var b=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=b.value;var d=a.getAttribute("name");d=$APP.n(d)?d:"";var e=$APP.l(a,"__xCurrencyFieldInternals");$APP.n(e)&&(e.setFormValue(c),QC(a,e,b,c));return WC(a,"x-currency-field-input",{name:d,value:c})}return null}},ZC=function(a){return function(){var b=
|
|
14
|
+
$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=b.value,d=parseFloat(c);c=$APP.n(isNaN(d))?c:""+$APP.S.g(d);d=a.getAttribute("name");d=$APP.n(d)?d:"";a.setAttribute("value",c);var e=$APP.l(a,"__xCurrencyFieldInternals");$APP.n(e)&&(e.setFormValue(c),QC(a,e,b,c));return WC(a,"x-currency-field-change",{name:d,value:c})}return null}},$C=function(a){var b=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=XC(a),d=YC(a),e=ZC(a);b.addEventListener("focus",
|
|
15
|
+
c);b.addEventListener("input",d);b.addEventListener("change",e);a.__xCurrencyFieldHandlers={focus:c,input:d,change:e}}},aD=function(a){var b=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){var c=$APP.l(a,"__xCurrencyFieldHandlers");if($APP.n(c)){b=$APP.l(b,"input");b.removeEventListener("focus",$APP.l(c,"focus"));b.removeEventListener("input",$APP.l(c,"input"));b.removeEventListener("change",$APP.l(c,"change"));a.__xCurrencyFieldHandlers=null;return}}return null},bD=function(a){$APP.n($APP.l(a,"__xCurrencyFieldRefs"))||
|
|
16
|
+
(PC(a),$APP.n(a.attachInternals)&&$APP.ma(a,"__xCurrencyFieldInternals",a.attachInternals()));aD(a);var b=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=a.getAttribute("value");LC(a.getAttribute("currency"));var d=function(){var e=a.getAttribute("locale");return $APP.n(e)?e:""}();$APP.n(c)&&(b.value=OC(c,d))}b=$APP.l(a,"__xCurrencyFieldInternals");$APP.n(b)&&b.setFormValue(function(){var e=a.getAttribute("value");return $APP.n(e)?e:""}());$C(a);return VC(a)},cD=function(a,
|
|
17
|
+
b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){var d=this.getAttribute(c);return $APP.n(d)?d:""},set:function(d){d!=null&&$APP.O(d)?(d=""+$APP.S.g(d),d=this.setAttribute(c,d)):d=this.removeAttribute(c);return d}})},dD=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return MC(this,c,$APP.J(d))}})},eD=function(a){Object.defineProperty(a,"value",{configurable:!0,enumerable:!0,get:function(){var b=
|
|
18
|
+
this.getAttribute("value");return $APP.n(b)?b:""},set:function(b){b=b!=null&&$APP.O(b)?""+$APP.S.g(b):"";this.setAttribute("value",b);var c=$APP.l(this,"__xCurrencyFieldRefs");if($APP.n(c)){c=$APP.l(c,"input");LC(this.getAttribute("currency"));var d=this.getAttribute("locale");d=$APP.n(d)?d:"";return $APP.C.h(c,this.shadowRoot.activeElement)?null:c.value=$APP.C.h(b,"")?"":OC(b,d)}return null}})},gD=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=!0;a.observedAttributes=
|
|
19
|
+
fD;eD(b);cD(b,"name","name");cD(b,"currency","currency");cD(b,"locale","locale");cD(b,"min","min");cD(b,"max","max");cD(b,"placeholder","placeholder");cD(b,"label","label");cD(b,"hint","hint");cD(b,"error","error");dD(b,"disabled","disabled");dD(b,"readOnly","readonly");dD(b,"required","required");b.connectedCallback=function(){return bD(this)};b.disconnectedCallback=function(){return aD(this)};b.attributeChangedCallback=function(c,d,e){$APP.C.h(c,"value")&&(c=$APP.l(this,"__xCurrencyFieldRefs"),
|
|
20
|
+
$APP.n(c)&&(c=$APP.l(c,"input"),$APP.C.h(c,this.shadowRoot.activeElement)||(LC(this.getAttribute("currency")),d=this.getAttribute("locale"),d=$APP.n(d)?d:"",c.value=e==null||$APP.C.h(e,"")?"":OC(e,d))));return VC(this)};b.formDisabledCallback=function(c){MC(this,"disabled",$APP.J(c));return VC(this)};b.formResetCallback=function(){this.removeAttribute("value");var c=$APP.l(this,"__xCurrencyFieldRefs");$APP.n(c)&&($APP.l(c,"input").value="");c=$APP.l(this,"__xCurrencyFieldInternals");$APP.n(c)&&c.setFormValue("");
|
|
21
|
+
return VC(this)};b.checkValidity=function(){var c=$APP.l(this,"__xCurrencyFieldInternals");return $APP.n(c)?c.checkValidity():!0};b.reportValidity=function(){var c=$APP.l(this,"__xCurrencyFieldInternals");return $APP.n(c)?c.reportValidity():!0};return a},hD=function(){return $APP.n(customElements.get("x-currency-field"))?null:customElements.define("x-currency-field",gD())},SC=new $APP.M(null,"min-raw","min-raw",183137548),RC=new $APP.M(null,"currency-raw","currency-raw",1169887491),UC=new $APP.M(null,
|
|
22
|
+
"currency","currency",-898327568),TC=new $APP.M(null,"locale-raw","locale-raw",385401846);var fD="name value currency locale min max placeholder label hint error disabled required readonly".split(" ");
|
|
23
|
+
$APP.gf([$APP.lk,$APP.Mj,$APP.Fj,$APP.vk,$APP.mj,$APP.si,$APP.qj,UC,$APP.Ij,$APP.Ih,$APP.W,$APP.Vh,$APP.dh],[new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.T,"min"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.T,"placeholder"],null),new $APP.Q(null,2,[$APP.Z,$APP.Yj,$APP.T,"disabled"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.T,"locale"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.T,"name"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.T,"value"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.T,"hint"],null),
|
|
24
|
+
new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.T,"currency"],null),new $APP.Q(null,2,[$APP.Z,$APP.Yj,$APP.T,"readonly"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.T,"max"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.T,"label"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.T,"error"],null),new $APP.Q(null,2,[$APP.Z,$APP.Yj,$APP.T,"required"],null)]);$APP.ja("baredom.exports.x_currency_field.init",hD);export const init=hD;
|