@vanelsas/baredom 3.1.0 → 3.4.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 +87 -0
- package/README.md +79 -168
- package/custom-elements.json +3779 -3184
- package/dist/baredom.d.ts +91 -86
- package/dist/base.js +600 -547
- package/dist/integrity.json +108 -103
- package/dist/x-alert.js +17 -16
- package/dist/x-avatar-group.js +9 -9
- package/dist/x-avatar.js +14 -14
- package/dist/x-badge.js +9 -9
- package/dist/x-bento-grid.js +5 -5
- package/dist/x-bento-item.js +4 -4
- package/dist/x-breadcrumbs.js +13 -13
- package/dist/x-button.js +1 -1
- package/dist/x-calendar.d.ts +55 -0
- package/dist/x-calendar.js +40 -0
- package/dist/x-cancel-dialogue.js +14 -14
- package/dist/x-card.js +7 -7
- package/dist/x-carousel.js +34 -34
- package/dist/x-chart.js +47 -47
- package/dist/x-checkbox.js +1 -1
- package/dist/x-chip.js +1 -1
- package/dist/x-code.d.ts +48 -0
- package/dist/x-code.js +28 -0
- package/dist/x-collapse.js +10 -10
- package/dist/x-color-picker.js +46 -46
- package/dist/x-combobox.d.ts +1 -0
- package/dist/x-combobox.js +32 -30
- package/dist/x-command-palette.js +27 -27
- package/dist/x-confetti.js +24 -24
- package/dist/x-container.js +5 -5
- package/dist/x-context-menu.js +20 -21
- package/dist/x-copy.js +1 -21
- package/dist/x-currency-field.js +24 -24
- package/dist/x-date-picker.d.ts +6 -4
- package/dist/x-date-picker.js +42 -42
- package/dist/x-divider.js +10 -10
- package/dist/x-drawer.js +11 -11
- package/dist/x-dropdown.js +12 -12
- package/dist/x-fieldset.js +5 -5
- package/dist/x-file-download.js +6 -6
- package/dist/x-file-upload.js +23 -23
- package/dist/x-form-field.js +14 -14
- package/dist/x-form.js +11 -10
- package/dist/x-gaussian-blur.js +13 -13
- package/dist/x-grid.js +6 -6
- package/dist/x-i18n-provider.js +7 -7
- package/dist/x-i18n.js +4 -4
- package/dist/x-icon.js +7 -7
- package/dist/x-image.js +17 -17
- package/dist/x-kbd.js +15 -15
- package/dist/x-kinetic-canvas.js +25 -25
- package/dist/x-kinetic-font.js +23 -23
- package/dist/x-kinetic-typography.js +34 -34
- package/dist/x-liquid-dock.js +31 -31
- package/dist/x-liquid-fill.js +41 -41
- package/dist/x-liquid-glass.js +35 -35
- package/dist/x-menu-item.js +8 -8
- package/dist/x-menu.js +9 -9
- package/dist/x-metaball-cursor.js +23 -23
- package/dist/x-modal.js +12 -12
- package/dist/x-morph-stack.js +37 -37
- package/dist/x-multi-combobox.d.ts +6 -5
- package/dist/x-multi-combobox.js +39 -36
- package/dist/x-navbar.js +15 -15
- package/dist/x-neural-glow.js +29 -29
- package/dist/x-notification-center.js +9 -9
- package/dist/x-organic-divider.js +17 -17
- package/dist/x-organic-progress.js +32 -32
- package/dist/x-organic-shape.js +12 -12
- package/dist/x-otp-input.js +21 -21
- package/dist/x-pagination.js +14 -14
- package/dist/x-particle-button.js +49 -49
- package/dist/x-popover.js +27 -27
- package/dist/x-progress-circle.js +8 -8
- package/dist/x-progress.js +7 -7
- package/dist/x-proximity-list.js +20 -20
- package/dist/x-radio.js +11 -11
- package/dist/x-range-slider.d.ts +51 -0
- package/dist/x-range-slider.js +29 -0
- package/dist/x-rating.d.ts +49 -0
- package/dist/x-rating.js +24 -0
- package/dist/x-ripple-effect.js +9 -9
- package/dist/x-scroll-parallax.js +17 -17
- package/dist/x-scroll-stack.js +16 -16
- package/dist/x-scroll-story.js +33 -33
- package/dist/x-scroll-timeline.js +45 -45
- package/dist/x-scroll.js +37 -37
- package/dist/x-search-field.d.ts +1 -0
- package/dist/x-search-field.js +1 -1
- package/dist/x-select.d.ts +2 -0
- package/dist/x-select.js +1 -1
- package/dist/x-sidebar.js +16 -16
- package/dist/x-skeleton-group.js +12 -12
- package/dist/x-skeleton.js +1 -1
- package/dist/x-slider.js +16 -16
- package/dist/x-soft-body.js +18 -18
- package/dist/x-spacer.js +4 -4
- package/dist/x-spinner.js +4 -4
- package/dist/x-splash.js +12 -12
- package/dist/x-split-pane.d.ts +44 -0
- package/dist/x-split-pane.js +16 -0
- package/dist/x-spotlight-card.js +12 -12
- package/dist/x-stat.js +10 -10
- package/dist/x-stepper.js +13 -13
- package/dist/x-switch.js +10 -10
- package/dist/x-tab.js +6 -6
- package/dist/x-table-cell.js +19 -19
- package/dist/x-table-row.js +8 -8
- package/dist/x-table.js +13 -13
- package/dist/x-tabs.js +11 -11
- package/dist/x-text-area.js +18 -18
- package/dist/x-theme.js +25 -25
- package/dist/x-timeline-item.js +20 -20
- package/dist/x-timeline.js +8 -8
- package/dist/x-toast.js +22 -22
- package/dist/x-toaster.js +7 -7
- package/dist/x-tooltip.js +12 -12
- package/dist/x-trace-history.js +126 -119
- package/dist/x-typography.js +6 -6
- package/dist/x-welcome-tour.js +63 -63
- package/package.json +28 -1
package/dist/x-context-menu.js
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var W8=function(a){return $APP.n(a)?a.shadowRoot.querySelector("[part\x3dpanel]"):null},X8=function(a,b){return typeof a==="string"?(a=parseInt(a,10),$APP.p(isNaN(a))&&a>0?a:b):b},
|
|
3
|
-
$APP.
|
|
4
|
-
2,[$APP.
|
|
5
|
-
null)),h=$APP.C(f,$APP.
|
|
6
|
-
c=$APP.C(b,$APP.
|
|
7
|
-
b);b=document.createElement("div");$APP.T(b,"part","panel");$APP.T(b,"role","menu");$APP.T(b,"tabindex","-1");a.shadowRoot.appendChild(b);return a},
|
|
8
|
-
c=$APP.
|
|
9
|
-
h=b.shadowRoot.activeElement;return $APP.
|
|
10
|
-
null},!0);$APP.n(d)&&$APP.
|
|
11
|
-
(document.addEventListener("keydown",c),document.addEventListener("click",b),$APP.
|
|
12
|
-
(f9(a),$APP.U(a,"open"),$APP.
|
|
13
|
-
|
|
14
|
-
"__xContextMenuInitialized")){var b=a.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);$APP.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
new $APP.
|
|
21
|
-
|
|
22
|
-
!1,$APP.V,new $APP.N(null,1,[$APP.Op,$APP.Mq],null)],null)]);$APP.fa("baredom.exports.x_context_menu.init",h9);export const init=h9;
|
|
2
|
+
var W8=function(a){return $APP.n(a)?a.shadowRoot.querySelector("[part\x3dpanel]"):null},X8=function(a,b){return typeof a==="string"?(a=parseInt(a,10),$APP.p(isNaN(a))&&a>0?a:b):b},Zsa=function(a){return $APP.z.j(a,"bottom-start")?"top-start":$APP.z.j(a,"bottom-end")?"top-end":$APP.z.j(a,"top-start")?"bottom-start":$APP.z.j(a,"top-end")?"bottom-end":$APP.z.j(a,"right-start")?"left-start":$APP.z.j(a,"left-start")?"right-start":a},$sa=function(a,b,c,d){var e=$APP.G(c);c=$APP.C(e,$APP.nt);var f=$APP.C(e,
|
|
3
|
+
$APP.mt),h=$APP.C(e,$APP.io);e=$APP.C(e,$APP.jo);var k=$APP.G(d);d=$APP.C(k,$APP.io);k=$APP.C(k,$APP.jo);switch(a){case "bottom-start":return new $APP.M(null,2,[$APP.nt,c,$APP.mt,f+e+b],null);case "bottom-end":return new $APP.M(null,2,[$APP.nt,c+h-d,$APP.mt,f+e+b],null);case "top-start":return new $APP.M(null,2,[$APP.nt,c,$APP.mt,f-k-b],null);case "top-end":return new $APP.M(null,2,[$APP.nt,c+h-d,$APP.mt,f-k-b],null);case "right-start":return new $APP.M(null,2,[$APP.nt,c+h+b,$APP.mt,f],null);case "left-start":return new $APP.M(null,
|
|
4
|
+
2,[$APP.nt,c-d-b,$APP.mt,f],null);default:return new $APP.M(null,2,[$APP.nt,c,$APP.mt,f+e+b],null)}},ata=function(a,b,c,d){function e(y){var A=$sa(y,b,c,d);A=$APP.G(A);var E=$APP.C(A,$APP.nt),H=$APP.C(A,$APP.mt);A=E>=8&&E+m<=h-8;var N=H>=8&&H+r<=k-8;E=$APP.yo.j($APP.Po.j(E,8),h-m-8);H=$APP.yo.j($APP.Po.j(H,8),k-r-8);return new $APP.M(null,5,[$APP.nt,E,$APP.mt,H,$APP.Op,y,$APP.zt,A&&N,$APP.cs,$APP.Po.j(40,k-H-8)],null)}var f=$APP.G(new $APP.M(null,2,[$APP.io,window.innerWidth,$APP.jo,window.innerHeight],
|
|
5
|
+
null)),h=$APP.C(f,$APP.io),k=$APP.C(f,$APP.jo);f=$APP.G(d);var m=$APP.C(f,$APP.io),r=$APP.C(f,$APP.jo),t=e(a),x=e(Zsa(a));return $APP.n(function(){var y=$APP.zt.i(t);return $APP.n(y)?y:$APP.p($APP.zt.i(x))}())?t:x},a9=function(a){a=new $APP.M(null,5,[$APP.aq,$APP.n(a.hasAttribute("open"))?a.getAttribute("open"):null,$APP.Xj,$APP.n(a.hasAttribute("disabled"))?a.getAttribute("disabled"):null,$APP.Ru,a.getAttribute("placement"),Y8,a.getAttribute("offset"),Z8,a.getAttribute("z-index")],null);var b=$APP.G(a),
|
|
6
|
+
c=$APP.C(b,$APP.aq),d=$APP.C(b,$APP.Xj),e=$APP.C(b,$APP.Ru);a=$APP.C(b,Y8);b=$APP.C(b,Z8);c=$APP.Hi(c);d=$APP.Hi(d);e=typeof e==="string"&&$APP.cd(bta,e)?e:"bottom-start";return new $APP.M(null,5,[$APP.pu,c,$APP.fk,d,$APP.or,e,$APP.Lp,X8(a,8),$8,X8(b,1E3)],null)},b9=function(a){return $APP.Cc(a.querySelectorAll("[role\x3dmenuitem]:not([disabled]):not([aria-disabled\x3dtrue])"))},c9=function(a){return $APP.n(a)?a.focus():null},cta=function(a,b){a=$APP.zk(a,":host{color-scheme:light dark;--x-context-menu-bg:var(--x-color-bg,rgba(255,255,255,0.97));--x-context-menu-border:var(--x-color-border,rgba(0,0,0,0.1));--x-context-menu-shadow:var(--x-shadow-lg,0 8px 32px rgba(0,0,0,0.14),0 2px 8px rgba(0,0,0,0.08));--x-context-menu-radius:var(--x-radius-md,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:var(--x-color-text,rgba(0,0,0,0.87));--x-context-menu-separator:var(--x-color-border,rgba(0,0,0,0.1));}@media(prefers-color-scheme:dark){:host{--x-context-menu-bg:var(--x-color-bg,#1e293b);--x-context-menu-border:var(--x-color-border,rgba(255,255,255,0.12));--x-context-menu-shadow:var(--x-shadow-lg,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:var(--x-color-text,rgba(255,255,255,0.9));--x-context-menu-separator:var(--x-color-border,rgba(255,255,255,0.12));}}[part\x3dpanel]{position:absolute;min-width:160px;max-width:calc(100vw - 1rem);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);}",
|
|
7
|
+
b);b=document.createElement("div");$APP.T(b,"part","panel");$APP.T(b,"role","menu");$APP.T(b,"tabindex","-1");a.shadowRoot.appendChild(b);return a},dta=function(a,b){a=$APP.q($APP.Cc(a.children));for(var c=null,d=0,e=0;;)if(e<d){var f=c.C(null,e);b.appendChild(f.cloneNode(!0));e+=1}else if(a=$APP.q(a))c=a,$APP.Yc(c)?(a=$APP.Db(c),d=$APP.Eb(c),c=a,f=$APP.w(a),a=d,d=f):(f=$APP.u(c),b.appendChild(f.cloneNode(!0)),a=$APP.v(c),c=null,d=0),e=0;else break},d9=function(a,b,c,d,e,f){d=ata(c,d,b,e);b=$APP.nt.i(d);
|
|
8
|
+
c=$APP.mt.i(d);f=$APP.Yg.m(d,$8,f);d=$APP.G(f);f=$APP.C(d,$8);d=$APP.C(d,$APP.cs);a.style.zIndex=""+$APP.P.i(f);a=W8(a);$APP.n(a)&&(a.style.left=""+$APP.P.i(b)+"px",a.style.top=""+$APP.P.i(c)+"px",a.style.maxHeight=""+$APP.P.i(d)+"px")},eta=function(a,b){function c(e){e.stopPropagation();e=e.target.closest("[role\x3dmenuitem]");return $APP.n(e)?($APP.dj(a,"x-context-menu-select",{item:e}),e9.j?e9.j(a,"select"):e9.call(null,a,"select")):null}var d=W8(b);$APP.Ak(b,b,"keydown",function(e){var f=e.key,
|
|
9
|
+
h=b.shadowRoot.activeElement;return $APP.z.j(f,"Tab")?e9.j?e9.j(a,"keyboard"):e9.call(null,a,"keyboard"):$APP.z.j(f,"ArrowDown")?(e.preventDefault(),$APP.n(h)?(e=b9(d),h=$APP.gd(e).indexOf(h),h=$APP.B(e,$APP.sd(h+1,$APP.w(e)),null),h=c9(h)):h=c9($APP.u(b9(d))),h):$APP.z.j(f,"ArrowUp")?(e.preventDefault(),$APP.n(h)?(e=b9(d),f=$APP.w(e),h=$APP.gd(e).indexOf(h),h=$APP.B(e,$APP.sd(h+(f-1),f),null),h=c9(h)):h=c9($APP.u(b9(d))),h):($APP.z.j(f,"Enter")||$APP.z.j(f," "))&&$APP.n(h)?(e.preventDefault(),h.click()):
|
|
10
|
+
null},!0);$APP.n(d)&&$APP.Ak(b,d,"click",c,!1)},fta=function(a){function b(d){var e=$APP.l(a,"__xContextMenuLayer");if($APP.n(e)){var f=W8(e);d=d.composedPath();d=$APP.ne(function(h){return h===f},$APP.Cc(d));return $APP.n($APP.n(f)?$APP.p(d):f)?e9.j?e9.j(a,"backdrop"):e9.call(null,a,"backdrop"):null}return null}function c(d){return $APP.z.j(d.key,"Escape")?(d.preventDefault(),e9.j?e9.j(a,"keyboard"):e9.call(null,a,"keyboard")):null}$APP.Dk(a,"__xContextMenuDocDeferral",function(){return $APP.n(a.hasAttribute("open"))?
|
|
11
|
+
(document.addEventListener("keydown",c),document.addEventListener("click",b),$APP.Q(a,"__xContextMenuDocH",{keydown:c,click:b})):null})},f9=function(a){$APP.Ck(a,"__xContextMenuDocDeferral");var b=$APP.l(a,"__xContextMenuDocH");$APP.n(b)&&(document.removeEventListener("keydown",$APP.l(b,"keydown")),document.removeEventListener("click",$APP.l(b,"click")),$APP.Q(a,"__xContextMenuDocH",null))},e9=function(a,b){return $APP.n(a.hasAttribute("open"))&&$APP.fj(a,"x-context-menu-close-request",{reason:b})?
|
|
12
|
+
(f9(a),$APP.U(a,"open"),$APP.Bk($APP.l(a,"__xContextMenuLayer")),$APP.Q(a,"__xContextMenuLayer",null),$APP.Q(a,"__xContextMenuAnchor",null),$APP.Q(a,"__xContextMenuModel",null),$APP.dj(a,"x-context-menu-close",{reason:b})):null},g9=function(a,b,c){if($APP.n(a.hasAttribute("disabled")))return null;$APP.n($APP.l(a,"__xContextMenuLayer"))&&e9(a,"programmatic");if($APP.fj(a,"x-context-menu-open-request",{reason:c})){var d=a9(a);d=$APP.G(d);var e=$APP.C(d,$APP.or),f=$APP.C(d,$APP.Lp),h=$APP.C(d,$8),k=
|
|
13
|
+
cta(a,h);dta(a,W8(k));eta(a,k);d9(k,b,e,f,new $APP.M(null,2,[$APP.io,200,$APP.jo,300],null),h);$APP.T(a,"open","");$APP.Q(a,"__xContextMenuLayer",k);$APP.Q(a,"__xContextMenuAnchor",b);$APP.Q(a,"__xContextMenuModel",d);fta(a);requestAnimationFrame(function(){var m=W8(k);$APP.n(m)&&d9(k,b,e,f,new $APP.M(null,2,[$APP.io,m.offsetWidth,$APP.jo,m.offsetHeight],null),h);return $APP.n(m)?c9($APP.u(b9(m))):null});return $APP.dj(a,"x-context-menu-open",{reason:c})}return null},gta=function(a){if(!$APP.Ti(a,
|
|
14
|
+
"__xContextMenuInitialized")){var b=a.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);$APP.Ui(a,"__xContextMenuInitialized")}return $APP.n(a.hasAttribute("open"))?$APP.U(a,"open"):null},hta=function(a){f9(a);var b=$APP.l(a,"__xContextMenuLayer");return $APP.n(b)?($APP.Bk(b),$APP.Q(a,"__xContextMenuLayer",null),$APP.Q(a,"__xContextMenuAnchor",null),$APP.Q(a,"__xContextMenuModel",
|
|
15
|
+
null)):null},ita=function(a,b,c,d){if($APP.I(c,d))if($APP.z.j(b,"open")&&$APP.p(a.hasAttribute("open"))){if(b=$APP.l(a,"__xContextMenuLayer"),$APP.n(b))return f9(a),$APP.Bk(b),$APP.Q(a,"__xContextMenuLayer",null),$APP.Q(a,"__xContextMenuAnchor",null),$APP.Q(a,"__xContextMenuModel",null)}else if(c=$APP.l(a,"__xContextMenuLayer"),b=$APP.n(c)?$APP.z.j(b,"placement")||$APP.z.j(b,"offset")||$APP.z.j(b,"z-index"):c,$APP.n(b)&&(b=a9(a),$APP.I(b,$APP.l(a,"__xContextMenuModel")))){c=$APP.l(a,"__xContextMenuLayer");
|
|
16
|
+
if($APP.n(c)&&(d=$APP.l(a,"__xContextMenuAnchor"),$APP.n(d))){var e=a9(a),f=$APP.G(e);e=$APP.C(f,$APP.or);var h=$APP.C(f,$APP.Lp);f=$APP.C(f,$8);var k=W8(c);d9(c,d,e,h,$APP.n(k)?new $APP.M(null,2,[$APP.io,k.offsetWidth,$APP.jo,k.offsetHeight],null):new $APP.M(null,2,[$APP.io,200,$APP.jo,300],null),f)}return $APP.Q(a,"__xContextMenuModel",b)}return null},jta=function(a){Object.defineProperty(a,"openAt",{value:function(b,c){return g9(this,new $APP.M(null,4,[$APP.nt,b,$APP.mt,c,$APP.io,1,$APP.jo,1],
|
|
17
|
+
null),"programmatic")},writable:!0,configurable:!0});Object.defineProperty(a,"toggleAt",{value:function(b,c){return $APP.n(this.hasAttribute("open"))?e9(this,"toggle"):g9(this,new $APP.M(null,4,[$APP.nt,b,$APP.mt,c,$APP.io,1,$APP.jo,1],null),"toggle")},writable:!0,configurable:!0});Object.defineProperty(a,"openForElement",{value:function(b){b=b.getBoundingClientRect();return g9(this,new $APP.M(null,4,[$APP.nt,b.left,$APP.mt,b.top,$APP.io,b.width,$APP.jo,b.height],null),"programmatic")},writable:!0,
|
|
18
|
+
configurable:!0});return Object.defineProperty(a,"close",{value:function(){return e9(this,"programmatic")},writable:!0,configurable:!0})},lta=function(a){$APP.sj(a,kta);return jta(a)},h9=function(){return $APP.xi("x-context-menu",new $APP.M(null,5,[$APP.hi,mta,$APP.fi,gta,$APP.ci,hta,$APP.bi,ita,$APP.gi,lta],null))},Z8=new $APP.F(null,"z-index-raw","z-index-raw",-1179679257),$8=new $APP.F(null,"z-index","z-index",1892827090),Y8=new $APP.F(null,"offset-raw","offset-raw",-1418404095);var mta=["open","disabled","placement","offset","z-index"],bta=new $APP.ah(null,new $APP.M(null,6,["right-start",null,"bottom-start",null,"bottom-end",null,"top-end",null,"top-start",null,"left-start",null],null),null),kta=new $APP.M(null,5,[$APP.Lt,new $APP.M(null,2,[$APP.O,$APP.qj,$APP.W,"open"],null),$APP.Jm,new $APP.M(null,2,[$APP.O,$APP.qj,$APP.W,"disabled"],null),$APP.or,new $APP.M(null,2,[$APP.O,$APP.X,$APP.W,"placement"],null),$APP.Lp,new $APP.M(null,2,[$APP.O,$APP.X,$APP.W,"offset"],null),
|
|
19
|
+
new $APP.F(null,"zIndex","zIndex",-1588341609),new $APP.M(null,2,[$APP.O,$APP.X,$APP.W,"z-index"],null)],null);
|
|
20
|
+
$APP.he(["x-context-menu-open-request",new $APP.M(null,2,[$APP.Pt,!0,$APP.V,new $APP.M(null,1,[$APP.mq,$APP.X],null)],null),"x-context-menu-open",new $APP.M(null,2,[$APP.Pt,!1,$APP.V,new $APP.M(null,1,[$APP.mq,$APP.X],null)],null),"x-context-menu-close-request",new $APP.M(null,2,[$APP.Pt,!0,$APP.V,new $APP.M(null,1,[$APP.mq,$APP.X],null)],null),"x-context-menu-close",new $APP.M(null,2,[$APP.Pt,!1,$APP.V,new $APP.M(null,1,[$APP.mq,$APP.X],null)],null),"x-context-menu-select",new $APP.M(null,2,[$APP.Pt,
|
|
21
|
+
!1,$APP.V,new $APP.M(null,1,[$APP.Rr,$APP.Ps],null)],null)]);$APP.fa("baredom.exports.x_context_menu.init",h9);export const init=h9;
|
package/dist/x-copy.js
CHANGED
|
@@ -1,22 +1,2 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
fN,$APP.cr],[RM(b),$APP.y.j(f,"html")?"html":"text",typeof k==="string"&&$APP.I(k.trim(),"")?k.trim():null,typeof a==="string"&&$APP.I(a.trim(),"")?a.trim():null,TM(SM(c)),typeof d==="string"&&$APP.I(d.trim(),"")?d.trim():null,function(){var u;if(u=typeof h==="string")u=(u=$APP.I(h,""))?h:u;return $APP.n(u)?u:"Copy failed"}(),$APP.E(m),function(){var u;if(u=typeof q==="string")u=(u=$APP.I(q,""))?q:u;return $APP.n(u)?u:"Copied"}(),typeof e==="string"&&$APP.I(e.trim(),"")?e.trim():null])},hN=function(a){var b=
|
|
4
|
-
$APP.H(a);a=$APP.C(b,$APP.cr);var c=$APP.C(b,$APP.mn),d=$APP.C(b,bN);b=$APP.C(b,$APP.Jo);return{text:$APP.n(a)?a:"",mode:$APP.n(b)?b:"text",from:$APP.n(c)?c:null,fromAttr:$APP.n(d)?d:null}},iN=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"),f=document.createElement("slot"),h=document.createElement("span"),k=document.createElement("slot"),m=document.createElement("span");
|
|
5
|
-
c.textContent=":host{display:inline-block;position:relative;color-scheme:light dark;--x-copy-tooltip-bg:var(--x-color-bg,#1e293b);--x-copy-tooltip-fg:var(--x-color-text,#f8fafc);--x-copy-tooltip-success-bg:var(--x-color-primary,#15803d);--x-copy-tooltip-success-fg:#ffffff;--x-copy-tooltip-error-bg:var(--x-color-danger,#b91c1c);--x-copy-tooltip-error-fg:#fef2f2;--x-copy-tooltip-radius:var(--x-radius-md,6px);--x-copy-tooltip-padding:4px 8px;--x-copy-tooltip-font-size:var(--x-font-size-sm,0.8125rem);--x-copy-tooltip-z:100;}@media (prefers-color-scheme:dark){:host{--x-copy-tooltip-bg:var(--x-color-bg,#0f172a);--x-copy-tooltip-fg:var(--x-color-text,#e2e8f0);--x-copy-tooltip-success-bg:var(--x-color-primary,#166534);--x-copy-tooltip-success-fg:#ffffff;--x-copy-tooltip-error-bg:var(--x-color-danger,#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
|
-
$APP.T(d,"part","wrap");$APP.T(e,"part","trigger");$APP.T(e,"type","button");e.appendChild(f);$APP.T(h,"part","tooltip");$APP.T(h,"role","status");$APP.T(h,"aria-live","polite");$APP.T(k,"name","tooltip");$APP.T(m,"part","tooltip-text");h.appendChild(k);h.appendChild(m);d.appendChild(e);d.appendChild(h);b.appendChild(c);b.appendChild(d);$APP.R(a,"__xCopyRefs",{root:b,wrap:d,trigger:e,tooltip:h,tooltipSlot:k,tooltipText:m});return $APP.l(a,"__xCopyRefs")},jN=function(a){return gN($APP.Yf([WM,$APP.an,
|
|
7
|
-
$APP.$q,XM,YM,$APP.Wi,ZM,$M,UM,VM],[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")]))},kN=function(a){var b=$APP.l(a,"__xCopyTextValue");if(typeof b==="string")return b;b=a.getAttribute("text");if(typeof b==="string"&&$APP.I(b,""))return b;b=a.getAttribute("from");return typeof b===
|
|
8
|
-
"string"&&$APP.I(b,"")&&(b=document.querySelector(b),$APP.n(b))?(a=a.getAttribute("from-attr"),a=typeof a==="string"&&$APP.I(a,"")?b.getAttribute(a):b.textContent,$APP.n(a)?a:""):""},lN=function(a){var b=document.createElement("textarea");b.value=a;b.style.position="fixed";b.style.opacity="0";document.body.appendChild(b);b.select();document.execCommand("copy");b.remove()},mN=function(a){var b={};b["text/html"]=new Blob([a],{type:"text/html"});b["text/plain"]=new Blob([a],{type:"text/plain"});return b},
|
|
9
|
-
nN=function(a){return $APP.n(function(){var b=navigator.clipboard;return $APP.n(b)?window.ClipboardItem:b}())?navigator.clipboard.write($APP.Xm(new $APP.K(null,1,5,$APP.M,[new ClipboardItem(mN(a))],null))).then(function(){return a}):new Promise(function(b,c){try{return lN(a),b.i?b.i(a):b.call(null,a)}catch(d){if(d instanceof Error)return b=d,c.i?c.i(b):c.call(null,b);throw d;}})},oN=function(a){return $APP.n(navigator.clipboard)?navigator.clipboard.writeText(a).then(function(){return a}).catch(function(b){return new Promise(function(c,
|
|
10
|
-
d){try{return lN(a),c.i?c.i(a):c.call(null,a)}catch(e){if(e instanceof Error)return d.i?d.i(b):d.call(null,b);throw e;}})}):new Promise(function(b,c){try{return lN(a),b.i?b.i(a):b.call(null,a)}catch(d){if(d instanceof Error)return b=d,c.i?c.i(b):c.call(null,b);throw d;}})},pN=function(a){var b=kN(a);a=a.getAttribute("mode");return $APP.y.j($APP.n(a)?a:"text","html")?nN(b):oN(b)},qN=function(a,b,c,d){var e=$APP.l(a,"__xCopyRefs");if($APP.n(e)){var f=$APP.l(a,"__xCopyTid");$APP.n(f)&&(clearTimeout(f),
|
|
11
|
-
$APP.R(a,"__xCopyTid",null));$APP.T(a,"data-tooltip-open","");$APP.T(a,"data-tooltip-kind",b);$APP.l(e,"tooltipText").textContent=c;$APP.R(a,"__xCopyTid",setTimeout(function(){$APP.R(a,"__xCopyTid",null);$APP.U(a,"data-tooltip-open");$APP.U(a,"data-tooltip-kind");var h=$APP.l(a,"__xCopyRefs");return $APP.n(h)?$APP.l(h,"tooltipText").textContent="":null},d))}},rN=function(a){if($APP.n(a.hasAttribute("disabled")))return Promise.resolve(null);var b=jN(a),c=hN(b);return $APP.ri(a,"x-copy-request",c)?
|
|
12
|
-
pN(a).then(function(d){$APP.pi(a,"x-copy-success",{text:$APP.n(d)?d:""});$APP.n(aN.i(b))&&qN(a,"success",fN.i(b),dN.i(b));return d}).catch(function(d){$APP.pi(a,"x-copy-error",{error:""+$APP.P.i(d)});$APP.n(aN.i(b))&&qN(a,"error",eN.i(b),dN.i(b));return Promise.reject(d)}):Promise.resolve(null)},sN=function(a,b){if(typeof b==="string"&&$APP.I(b,"")){var c=b.toLowerCase().split("+");b=$APP.Ec(c);var d=$APP.E($APP.fe(function(h){return $APP.y.j(h,"ctrl")},c)),e=$APP.E($APP.fe(function(h){return $APP.y.j(h,
|
|
13
|
-
"shift")},c)),f=$APP.E($APP.fe(function(h){return $APP.y.j(h,"alt")},c));c=$APP.E($APP.fe(function(h){return $APP.y.j(h,"meta")},c));return $APP.y.j(a.key.toLowerCase(),b)&&$APP.y.j(d,a.ctrlKey)&&$APP.y.j(e,a.shiftKey)&&$APP.y.j(f,a.altKey)&&$APP.y.j(c,a.metaKey)}return null},tN=function(a){function b(e){var f=a.getAttribute("hotkey");return $APP.n(sN(e,f))?(e.preventDefault(),rN(a)):null}function c(){return rN(a)}var d=iN(a);$APP.l(d,"trigger").addEventListener("click",c);document.addEventListener("keydown",
|
|
14
|
-
b);$APP.R(a,"__xCopyHandlers",{click:c,keydown:b})},uN=function(a){var b=$APP.l(a,"__xCopyTid");$APP.n(b)&&(clearTimeout(b),$APP.R(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,"click");b=$APP.l(b,"keydown");$APP.n(d)&&c.removeEventListener("click",d);$APP.n(b)&&document.removeEventListener("keydown",b)}return $APP.R(a,"__xCopyHandlers",null)},vN=function(a){if($APP.n($APP.l(a,"__xCopyRefs"))){var b=
|
|
15
|
-
jN(a);if($APP.I($APP.l(a,"__xCopyModel"),b)){var c=iN(a);c=$APP.l(c,"trigger");var d=$APP.cj.i(b);c.disabled=$APP.E(d);$APP.n(d)?$APP.T(a,"aria-disabled","true"):$APP.U(a,"aria-disabled");a=$APP.R(a,"__xCopyModel",b)}else a=null;return a}return null},wN=function(a){iN(a);uN(a);tN(a);return vN(a)},xN=function(a){return uN(a)},yN=function(a,b,c,d){return $APP.I(c,d)?vN(a):null},zN=function(a){$APP.yi(a,"text","text");$APP.yi(a,"from","from");$APP.yi(a,"fromAttr","from-attr");$APP.yi(a,"mode","mode");
|
|
16
|
-
$APP.yi(a,"successMessage","success-message");$APP.yi(a,"errorMessage","error-message");$APP.yi(a,"hotkey","hotkey");$APP.ui(a,"disabled","disabled");Object.defineProperty(a,"showTooltip",{get:function(){return RM(this.getAttribute("show-tooltip"))},set:function(b){return $APP.n(b)?$APP.T(this,"show-tooltip","true"):$APP.T(this,"show-tooltip","false")},enumerable:!0,configurable:!0});Object.defineProperty(a,"tooltipMs",{get:function(){return SM(this.getAttribute("tooltip-ms"))},set:function(b){return b==
|
|
17
|
-
null?$APP.U(this,"tooltip-ms"):$APP.T(this,"tooltip-ms",""+$APP.P.i(b|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"textValue",{get:function(){return $APP.l(this,"__xCopyTextValue")},set:function(b){return typeof b==="string"?$APP.R(this,"__xCopyTextValue",b):$APP.R(this,"__xCopyTextValue")},enumerable:!0,configurable:!0});return Object.defineProperty(a,"copy",{value:function(){return rN(this)},enumerable:!0,configurable:!0,writable:!0})},BN=function(){return $APP.Kh("x-copy",new $APP.N(null,
|
|
18
|
-
5,[$APP.Bh,AN,$APP.zh,wN,$APP.qh,xN,$APP.ph,yN,$APP.Ah,zN],null))},aN=new $APP.F(null,"show-tooltip?","show-tooltip?",-1214081087),VM=new $APP.F(null,"tooltip-ms-raw","tooltip-ms-raw",-1973326401),fN=new $APP.F(null,"success-message","success-message",-96541601),XM=new $APP.F(null,"error-message-raw","error-message-raw",1910536231),cN=new $APP.F(null,"hotkey","hotkey",-329017295),eN=new $APP.F(null,"error-message","error-message",1756021561),CN=new $APP.F(null,"fromAttr","fromAttr",-1768252533),YM=
|
|
19
|
-
new $APP.F(null,"from-attr-raw","from-attr-raw",761657416),dN=new $APP.F(null,"tooltip-ms","tooltip-ms",1062450417),ZM=new $APP.F(null,"success-message-raw","success-message-raw",388691116),WM=new $APP.F(null,"from-raw","from-raw",-44462428),bN=new $APP.F(null,"from-attr","from-attr",1217901743),UM=new $APP.F(null,"hotkey-raw","hotkey-raw",1972404222),$M=new $APP.F(null,"show-tooltip-raw","show-tooltip-raw",453600717);var AN="text from from-attr mode disabled show-tooltip tooltip-ms success-message error-message hotkey".split(" ");
|
|
20
|
-
$APP.Yf([new $APP.F(null,"errorMessage","errorMessage",982744869),$APP.Hk,new $APP.F(null,"textValue","textValue",-598870870),$APP.Jo,CN,new $APP.F(null,"tooltipMs","tooltipMs",1056463375),cN,$APP.mn,new $APP.F(null,"showTooltip","showTooltip",482349691),new $APP.F(null,"successMessage","successMessage",-789572803),$APP.cr],[new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"error-message"],null),new $APP.N(null,2,[$APP.O,$APP.Ci,$APP.W,"disabled"],null),new $APP.N(null,3,[$APP.O,$APP.Y,$APP.W,null,new $APP.F(null,
|
|
21
|
-
"note","note",1426297904),"property-only override"],null),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"mode"],null),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"from-attr"],null),new $APP.N(null,2,[$APP.O,$APP.Z,$APP.W,"tooltip-ms"],null),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"hotkey"],null),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"from"],null),new $APP.N(null,2,[$APP.O,$APP.Ci,$APP.W,"show-tooltip"],null),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"success-message"],null),new $APP.N(null,2,[$APP.O,$APP.Y,
|
|
22
|
-
$APP.W,"text"],null)]);$APP.be(["x-copy-request",new $APP.N(null,2,[$APP.Mr,!0,$APP.V,new $APP.N(null,4,[$APP.cr,$APP.Y,$APP.Jo,$APP.Y,$APP.mn,$APP.Y,CN,$APP.Y],null)],null),"x-copy-success",new $APP.N(null,2,[$APP.Mr,!1,$APP.V,new $APP.N(null,1,[$APP.cr,$APP.Y],null)],null),"x-copy-error",new $APP.N(null,2,[$APP.Mr,!1,$APP.V,new $APP.N(null,1,[$APP.On,$APP.Y],null)],null)]);$APP.fa("baredom.exports.x_copy.init",BN);export const init=BN;
|
|
2
|
+
var wM=function(){return $APP.Fm()};$APP.fa("baredom.exports.x_copy.init",wM);export const init=wM;
|
package/dist/x-currency-field.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
$APP.T(d,"part","field");$APP.T(e,"part","label");$APP.T(e,"id","label");$APP.T(e,"for","input");$APP.T(f,"part","input-wrapper");$APP.T(h,"part","symbol");$APP.T(h,"aria-hidden","true");$APP.T(k,"part","input");$APP.T(k,"id","input");$APP.T(k,"inputmode","decimal");$APP.T(k,"aria-labelledby","label");$APP.T(m,"part","hint");$APP.T(m,"id","hint");$APP.T(m,"aria-live","polite");$APP.T(
|
|
5
|
-
f.appendChild(k);d.appendChild(e);d.appendChild(f);d.appendChild(m);d.appendChild(
|
|
6
|
-
null;$APP.n(e)?b.setValidity({customError:!0},f,c):$APP.n($APP.n(h)?$APP.
|
|
7
|
-
|
|
8
|
-
a.getAttribute("value"),a.getAttribute("locale"),a.getAttribute("placeholder")]);var c=$APP.
|
|
9
|
-
$APP.
|
|
10
|
-
$APP.
|
|
11
|
-
|
|
12
|
-
k:
|
|
13
|
-
$APP.n(e)&&(f=a.getAttribute("value"),
|
|
14
|
-
$APP.n(d)&&(d.setFormValue(c),
|
|
15
|
-
"value",c),e=$APP.l(a,"__xCurrencyFieldInternals"),$APP.n(e)&&(e.setFormValue(c),
|
|
16
|
-
c);b.addEventListener("input",d);b.addEventListener("change",e);f.focus=c;f.input=d;f.change=e;$APP.
|
|
17
|
-
b){$APP.
|
|
18
|
-
|
|
19
|
-
c=a.getAttribute("locale"),c=$APP.n(c)?c:"",b.value=d==null||$APP.
|
|
20
|
-
this.shadowRoot.activeElement)?null:c.value=$APP.
|
|
21
|
-
"");$APP.
|
|
22
|
-
|
|
23
|
-
$APP.
|
|
24
|
-
new $APP.
|
|
25
|
-
$APP.
|
|
2
|
+
var $Y=function(a){a=(""+$APP.P.i($APP.n(a)?a:"")).trim().toUpperCase();return $APP.z.j(a,"")?"USD":a},fla=function(a,b){try{var c=(new Intl.NumberFormat($APP.z.j(b,"")?"en-US":b,{style:"currency",currency:a})).formatToParts(0),d=$APP.ne(function(e){return $APP.z.j("currency",e.type)?e.value:null},$APP.Cc(c));return $APP.n(d)?d:a}catch(e){return a}},aZ=function(a,b){var c=parseFloat(a);if($APP.n(isNaN(c)))return a;try{return(new Intl.NumberFormat($APP.z.j(b,"")?void 0:b,{minimumFractionDigits:2,maximumFractionDigits:2})).format(c)}catch(d){return a}},
|
|
3
|
+
gla=function(a){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("label"),f=document.createElement("div"),h=document.createElement("span"),k=document.createElement("input"),m=document.createElement("span"),r=document.createElement("span"),t={};c.textContent=":host{display:block;color-scheme:light dark;--x-currency-field-bg:var(--x-color-surface,#ffffff);--x-currency-field-color:var(--x-color-text,#111827);--x-currency-field-border:1px solid var(--x-color-border,#d1d5db);--x-currency-field-border-radius:var(--x-radius-md,6px);--x-currency-field-focus-ring-color:var(--x-color-primary,#2563eb);--x-currency-field-symbol-color:var(--x-color-text-muted,#6b7280);--x-currency-field-label-color:var(--x-color-text-muted,#374151);--x-currency-field-hint-color:var(--x-color-text-muted,#6b7280);--x-currency-field-error-color:var(--x-color-danger,#dc2626);--x-currency-field-disabled-opacity:0.45;}@media (prefers-color-scheme:dark){:host{--x-currency-field-bg:var(--x-color-surface-hover,#1f2937);--x-currency-field-color:var(--x-color-text,#f9fafb);--x-currency-field-border:1px solid var(--x-color-border,#4b5563);--x-currency-field-focus-ring-color:var(--x-color-primary,#3b82f6);--x-currency-field-symbol-color:var(--x-color-text-muted,#9ca3af);--x-currency-field-label-color:var(--x-color-text-muted,#d1d5db);--x-currency-field-hint-color:var(--x-color-text-muted,#9ca3af);--x-currency-field-error-color:var(--x-color-danger,#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
|
+
$APP.T(d,"part","field");$APP.T(e,"part","label");$APP.T(e,"id","label");$APP.T(e,"for","input");$APP.T(f,"part","input-wrapper");$APP.T(h,"part","symbol");$APP.T(h,"aria-hidden","true");$APP.T(k,"part","input");$APP.T(k,"id","input");$APP.T(k,"inputmode","decimal");$APP.T(k,"aria-labelledby","label");$APP.T(m,"part","hint");$APP.T(m,"id","hint");$APP.T(m,"aria-live","polite");$APP.T(r,"part","error");$APP.T(r,"id","error");$APP.T(r,"role","alert");$APP.T(r,"aria-live","assertive");f.appendChild(h);
|
|
5
|
+
f.appendChild(k);d.appendChild(e);d.appendChild(f);d.appendChild(m);d.appendChild(r);b.appendChild(c);b.appendChild(d);t.field=d;t.label=e;t.wrapper=f;t.symbol=h;t.input=k;t.hint=m;t.error=r;$APP.Q(a,"__xCurrencyFieldRefs",t)},bZ=function(a,b,c,d){var e=a.hasAttribute("error");var f=a.getAttribute("error");f=$APP.n(f)?f:"";var h=a.hasAttribute("required"),k=a.getAttribute("min"),m=a.getAttribute("max");a=parseFloat(d);var r=$APP.p(isNaN(a));k=$APP.n(k)?parseFloat(k):null;m=$APP.n(m)?parseFloat(m):
|
|
6
|
+
null;$APP.n(e)?b.setValidity({customError:!0},f,c):$APP.n($APP.n(h)?$APP.z.j(d,""):h)?b.setValidity({valueMissing:!0},"Please fill in this field.",c):$APP.I(d,"")&&!r?b.setValidity({badInput:!0},"Please enter a valid number.",c):$APP.n(r?$APP.n(k)?$APP.p(isNaN(k))&&a<k:k:r)?b.setValidity({rangeUnderflow:!0},"Value must be at least "+$APP.P.i(k)+".",c):$APP.n(r?$APP.n(m)?$APP.p(isNaN(m))&&a>m:m:r)?b.setValidity({rangeOverflow:!0},"Value must be at most "+$APP.P.i(m)+".",c):b.setValidity({},"",c)},
|
|
7
|
+
cZ=function(a,b,c,d){a.textContent=b;$APP.n(c)?a.classList.remove(d):a.classList.add(d)},iZ=function(a){if($APP.n($APP.l(a,"__xCurrencyFieldRefs"))){var b=$APP.Eg([$APP.Wj,dZ,$APP.Tj,$APP.In,$APP.yq,$APP.Xj,eZ,$APP.Yj,$APP.Cs,$APP.ql,$APP.Uj,fZ,$APP.Vj],[a.getAttribute("label"),a.getAttribute("currency"),a.getAttribute("name"),a.getAttribute("error"),a.getAttribute("hint"),a.hasAttribute("disabled"),a.getAttribute("min"),a.hasAttribute("required"),a.getAttribute("max"),a.hasAttribute("readonly"),
|
|
8
|
+
a.getAttribute("value"),a.getAttribute("locale"),a.getAttribute("placeholder")]);var c=$APP.G(b);b=$APP.C(c,$APP.Vj);var d=$APP.C(c,$APP.Wj),e=$APP.C(c,dZ),f=$APP.C(c,$APP.Tj),h=$APP.C(c,$APP.In),k=$APP.C(c,$APP.yq),m=$APP.C(c,$APP.Xj),r=$APP.C(c,eZ),t=$APP.C(c,$APP.Yj),x=$APP.C(c,$APP.Cs),y=$APP.C(c,$APP.ql),A=$APP.C(c,$APP.Uj);c=$APP.C(c,fZ);var E=$APP.n(h)?h:"",H=$APP.n(k)?k:"",N=$APP.n(d)?d:"";b=$APP.Eg([$APP.Fr,$APP.vj,$APP.vl,$APP.dk,$APP.Np,$APP.Lu,$APP.ck,$APP.Si,$APP.et,$APP.tj,$APP.Bt,gZ,
|
|
9
|
+
$APP.ws,$APP.ek,$APP.uj,$APP.fk],[$APP.n(r)?r:"",$APP.D(t),$APP.D(y),$APP.n(b)?b:"",typeof k==="string"&&$APP.I(k,""),$APP.n(c)?c:"",$APP.n(f)?f:"",$APP.n(A)?A:"",typeof d==="string"&&$APP.I(d,""),typeof h==="string"&&$APP.I(h,""),H,$Y(e),$APP.n(x)?x:"",N,E,$APP.D(m)]);$APP.I($APP.l(a,"__xCurrencyFieldModel"),b)?(f=$APP.l(a,"__xCurrencyFieldRefs"),$APP.n(f)?(h=$APP.l(f,"label"),r=$APP.l(f,"symbol"),d=$APP.l(f,"input"),e=$APP.l(f,"hint"),f=$APP.l(f,"error"),t=$APP.G(b),k=$APP.C(t,$APP.tj),m=$APP.C(t,
|
|
10
|
+
$APP.uj),$APP.n(k)?t=null:(y=$APP.G(t),t=$APP.C(y,$APP.Si),x=$APP.C(y,$APP.Fr),y=$APP.C(y,$APP.ws),A=parseFloat(t),c=$APP.I(t,"")&&$APP.p(isNaN(A)),E=$APP.I(x,"")?parseFloat(x):null,H=$APP.I(y,"")?parseFloat(y):null,t=$APP.I(t,"")&&!c?"Please enter a valid number.":$APP.n(c?$APP.n(E)?$APP.p(isNaN(E))&&A<E:E:c)?"Value must be at least "+$APP.P.i(x)+".":$APP.n(c?$APP.n(H)?$APP.p(isNaN(H))&&A>H:H:c)?"Value must be at most "+$APP.P.i(y)+".":""),k=new $APP.M(null,2,[$APP.tj,$APP.n(k)?k:$APP.I($APP.n(t)?
|
|
11
|
+
t:"",""),hZ,$APP.n(k)?m:$APP.n(t)?t:""],null),m=$APP.G(k),k=$APP.C(m,$APP.tj),m=$APP.C(m,hZ),x=$APP.G(b),t=$APP.C(x,gZ),x=$APP.C(x,$APP.Lu),r.textContent=fla(t,x),A=$APP.G(b),r=$APP.C(A,$APP.ck),t=$APP.C(A,$APP.dk),x=$APP.C(A,$APP.fk),y=$APP.C(A,$APP.vl),A=$APP.C(A,$APP.vj),d.name=r,d.placeholder=t,d.disabled=x,d.readOnly=y,d.required=A,$APP.T(d,"aria-required",$APP.n($APP.vj.i(b))?"true":"false"),$APP.T(d,"aria-invalid",$APP.n(k)?"true":"false"),r=$APP.G(b),r=$APP.C(r,$APP.Np),r=$APP.n($APP.n(r)?
|
|
12
|
+
k:r)?"hint error":$APP.n(r)?"hint":$APP.n(k)?"error":null,$APP.n(r)?$APP.T(d,"aria-describedby",r):$APP.U(d,"aria-describedby"),t=$APP.G(b),r=$APP.C(t,$APP.Si),$APP.C(t,gZ),t=$APP.C(t,$APP.Lu),$APP.z.j(d,a.shadowRoot.activeElement)||(d.value=$APP.z.j(r,"")?"":aZ(r,t)),t=$APP.G(b),r=$APP.C(t,$APP.ek),t=$APP.C(t,$APP.et),cZ(h,r,t,"label-hidden"),r=$APP.G(b),h=$APP.C(r,$APP.Bt),r=$APP.C(r,$APP.Np),cZ(e,h,r,"hint-hidden"),cZ(f,m,k,"error-hidden"),$APP.Zi(a,"data-invalid",k),e=$APP.l(a,"__xCurrencyFieldInternals"),
|
|
13
|
+
$APP.n(e)&&(f=a.getAttribute("value"),bZ(a,e,d,$APP.n(f)?f:"")),a=$APP.Q(a,"__xCurrencyFieldModel",b)):a=null):a=null;return a}return null},hla=function(a){var b=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=b.value,d=function(){var f=a.getAttribute("value");return $APP.n(f)?f:""}(),e=function(){var f=a.getAttribute("name");return $APP.n(f)?f:""}();return $APP.fj(a,"x-currency-field-change-request",{name:e,value:c,previousValue:d})?(d=$APP.l(a,"__xCurrencyFieldInternals"),
|
|
14
|
+
$APP.n(d)&&(d.setFormValue(c),bZ(a,d,b,c)),$APP.dj(a,"x-currency-field-input",{name:e,value:c})):b.value=d}return null},ila=function(a){var b=$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.P.i(d);var e=function(){var f=a.getAttribute("value");return $APP.n(f)?f:""}();d=function(){var f=a.getAttribute("name");return $APP.n(f)?f:""}();return $APP.fj(a,"x-currency-field-change-request",{name:d,value:c,previousValue:e})?($APP.T(a,
|
|
15
|
+
"value",c),e=$APP.l(a,"__xCurrencyFieldInternals"),$APP.n(e)&&(e.setFormValue(c),bZ(a,e,b,c)),$APP.dj(a,"x-currency-field-change",{name:d,value:c})):b.value=e}return null},jla=function(a){var b=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=function(){var h=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(h)){h=$APP.l(h,"input");var k=a.getAttribute("value");h=h.value=$APP.n(k)?k:""}else h=null;return h},d=function(){return hla(a)},e=function(){return ila(a)},f={};b.addEventListener("focus",
|
|
16
|
+
c);b.addEventListener("input",d);b.addEventListener("change",e);f.focus=c;f.input=d;f.change=e;$APP.Q(a,"__xCurrencyFieldHandlers",f)}},jZ=function(a){var b=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){var c=$APP.l(a,"__xCurrencyFieldHandlers");if($APP.n(c))return 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")),$APP.Q(a,"__xCurrencyFieldHandlers",null)}return null},kla=function(a,
|
|
17
|
+
b){$APP.Zi(a,"disabled",$APP.D(b));return iZ(a)},lla=function(a){$APP.U(a,"value");var b=$APP.l(a,"__xCurrencyFieldRefs");$APP.n(b)&&($APP.l(b,"input").value="");b=$APP.l(a,"__xCurrencyFieldInternals");$APP.n(b)&&b.setFormValue("");return iZ(a)},mla=function(a){$APP.n($APP.l(a,"__xCurrencyFieldRefs"))||(gla(a),$APP.n(a.attachInternals)&&$APP.Q(a,"__xCurrencyFieldInternals",a.attachInternals()));jZ(a);var b=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=a.getAttribute("value");
|
|
18
|
+
$Y(a.getAttribute("currency"));var d=function(){var e=a.getAttribute("locale");return $APP.n(e)?e:""}();$APP.n(c)&&(b.value=aZ(c,d))}b=$APP.l(a,"__xCurrencyFieldInternals");$APP.n(b)&&b.setFormValue(function(){var e=a.getAttribute("value");return $APP.n(e)?e:""}());jla(a);return iZ(a)},nla=function(a){return jZ(a)},ola=function(a,b,c,d){return $APP.I(c,d)?($APP.z.j(b,"value")&&(b=$APP.l(a,"__xCurrencyFieldRefs"),$APP.n(b)&&(b=$APP.l(b,"input"),$APP.z.j(b,a.shadowRoot.activeElement)||($Y(a.getAttribute("currency")),
|
|
19
|
+
c=a.getAttribute("locale"),c=$APP.n(c)?c:"",b.value=d==null||$APP.z.j(d,"")?"":aZ(d,c)))),iZ(a)):null},pla=function(a){Object.defineProperty(a,"value",{configurable:!0,enumerable:!0,get:function(){var b=this.getAttribute("value");return $APP.n(b)?b:""},set:function(b){b=b!=null&&$APP.I(b)?""+$APP.P.i(b):"";$APP.T(this,"value",b);var c=$APP.l(this,"__xCurrencyFieldRefs");if($APP.n(c)){c=$APP.l(c,"input");$Y(this.getAttribute("currency"));var d=this.getAttribute("locale");d=$APP.n(d)?d:"";return $APP.z.j(c,
|
|
20
|
+
this.shadowRoot.activeElement)?null:c.value=$APP.z.j(b,"")?"":aZ(b,d)}return null}})},qla=function(a){Object.defineProperty(a,"checkValidity",{value:function(){var b=$APP.l(this,"__xCurrencyFieldInternals");return $APP.n(b)?b.checkValidity():!0},writable:!0,configurable:!0});return Object.defineProperty(a,"reportValidity",{value:function(){var b=$APP.l(this,"__xCurrencyFieldInternals");return $APP.n(b)?b.reportValidity():!0},writable:!0,configurable:!0})},rla=function(a){pla(a);$APP.lj(a,"name","name",
|
|
21
|
+
"");$APP.lj(a,"currency","currency","");$APP.lj(a,"locale","locale","");$APP.lj(a,"min","min","");$APP.lj(a,"max","max","");$APP.lj(a,"placeholder","placeholder","");$APP.lj(a,"label","label","");$APP.lj(a,"hint","hint","");$APP.lj(a,"error","error","");$APP.ij(a,"disabled","disabled");$APP.ij(a,"readOnly","readonly");$APP.ij(a,"required","required");return qla(a)},kZ=function(){return $APP.xi("x-currency-field",new $APP.M(null,8,[$APP.hi,sla,$APP.fi,mla,$APP.ci,nla,$APP.bi,ola,$APP.di,!0,$APP.ai,
|
|
22
|
+
kla,$APP.$h,lla,$APP.gi,rla],null))},eZ=new $APP.F(null,"min-raw","min-raw",183137548),gZ=new $APP.F(null,"currency","currency",-898327568),hZ=new $APP.F(null,"display-error","display-error",-179691836),fZ=new $APP.F(null,"locale-raw","locale-raw",385401846),dZ=new $APP.F(null,"currency-raw","currency-raw",1169887491);var sla="name value currency locale min max placeholder label hint error disabled required readonly".split(" ");
|
|
23
|
+
$APP.Eg([$APP.Fr,$APP.dk,$APP.Jm,$APP.Lu,$APP.ck,$APP.Si,$APP.Bt,gZ,$APP.St,$APP.ws,$APP.ek,$APP.uj,$APP.bs],[new $APP.M(null,2,[$APP.O,$APP.X,$APP.W,"min"],null),new $APP.M(null,2,[$APP.O,$APP.X,$APP.W,"placeholder"],null),new $APP.M(null,2,[$APP.O,$APP.qj,$APP.W,"disabled"],null),new $APP.M(null,2,[$APP.O,$APP.X,$APP.W,"locale"],null),new $APP.M(null,2,[$APP.O,$APP.X,$APP.W,"name"],null),new $APP.M(null,2,[$APP.O,$APP.X,$APP.W,"value"],null),new $APP.M(null,2,[$APP.O,$APP.X,$APP.W,"hint"],null),
|
|
24
|
+
new $APP.M(null,2,[$APP.O,$APP.X,$APP.W,"currency"],null),new $APP.M(null,2,[$APP.O,$APP.qj,$APP.W,"readonly"],null),new $APP.M(null,2,[$APP.O,$APP.X,$APP.W,"max"],null),new $APP.M(null,2,[$APP.O,$APP.X,$APP.W,"label"],null),new $APP.M(null,2,[$APP.O,$APP.X,$APP.W,"error"],null),new $APP.M(null,2,[$APP.O,$APP.qj,$APP.W,"required"],null)]);
|
|
25
|
+
$APP.he(["x-currency-field-change-request",new $APP.M(null,2,[$APP.Pt,!0,$APP.V,new $APP.M(null,3,[$APP.ck,$APP.X,$APP.Si,$APP.X,$APP.ss,$APP.X],null)],null),"x-currency-field-input",new $APP.M(null,2,[$APP.Pt,!1,$APP.V,new $APP.M(null,2,[$APP.ck,$APP.X,$APP.Si,$APP.X],null)],null),"x-currency-field-change",new $APP.M(null,2,[$APP.Pt,!1,$APP.V,new $APP.M(null,2,[$APP.ck,$APP.X,$APP.Si,$APP.X],null)],null)]);$APP.fa("baredom.exports.x_currency_field.init",kZ);export const init=kZ;
|
package/dist/x-date-picker.d.ts
CHANGED
|
@@ -9,14 +9,16 @@ export interface XDatePickerEventMap {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export interface XDatePicker extends HTMLElement {
|
|
12
|
-
|
|
12
|
+
open: boolean;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
name: string;
|
|
13
15
|
value: string;
|
|
16
|
+
mode: string;
|
|
14
17
|
start: string;
|
|
15
|
-
end: string;
|
|
16
|
-
disabled: boolean;
|
|
17
18
|
readOnly: boolean;
|
|
19
|
+
error: string;
|
|
20
|
+
end: string;
|
|
18
21
|
required: boolean;
|
|
19
|
-
open: boolean;
|
|
20
22
|
focus(): void;
|
|
21
23
|
commit(): void;
|
|
22
24
|
clear(): void;
|