@vanelsas/baredom 3.0.0 → 3.1.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 +18 -0
- package/custom-elements.json +3393 -2954
- package/dist/baredom.d.ts +86 -86
- package/dist/base.js +533 -524
- package/dist/integrity.json +103 -103
- package/dist/x-alert.js +16 -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 +14 -13
- package/dist/x-button.js +1 -1
- package/dist/x-cancel-dialogue.js +14 -13
- package/dist/x-card.d.ts +1 -1
- package/dist/x-card.js +7 -7
- package/dist/x-carousel.d.ts +3 -0
- package/dist/x-carousel.js +35 -33
- package/dist/x-chart.js +47 -47
- package/dist/x-checkbox.js +1 -1
- package/dist/x-chip.js +1 -1
- package/dist/x-collapse.d.ts +1 -0
- package/dist/x-collapse.js +11 -10
- package/dist/x-color-picker.js +46 -45
- package/dist/x-combobox.d.ts +2 -0
- package/dist/x-combobox.js +30 -26
- package/dist/x-command-palette.d.ts +3 -0
- package/dist/x-command-palette.js +28 -26
- package/dist/x-confetti.js +24 -24
- package/dist/x-container.js +5 -6
- package/dist/x-context-menu.d.ts +4 -0
- package/dist/x-context-menu.js +21 -20
- package/dist/x-copy.js +20 -20
- package/dist/x-currency-field.d.ts +2 -0
- package/dist/x-currency-field.js +24 -23
- package/dist/x-date-picker.d.ts +3 -0
- package/dist/x-date-picker.js +42 -42
- package/dist/x-divider.js +10 -9
- package/dist/x-drawer.js +11 -10
- package/dist/x-dropdown.d.ts +3 -0
- package/dist/x-dropdown.js +12 -11
- package/dist/x-fieldset.js +6 -5
- package/dist/x-file-download.js +7 -7
- package/dist/x-file-upload.d.ts +2 -0
- package/dist/x-file-upload.js +23 -22
- package/dist/x-form-field.js +15 -15
- package/dist/x-form.d.ts +4 -0
- package/dist/x-form.js +10 -9
- package/dist/x-gaussian-blur.js +13 -12
- package/dist/x-grid.js +6 -7
- 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 +16 -16
- package/dist/x-kinetic-canvas.js +26 -25
- package/dist/x-kinetic-font.js +27 -27
- package/dist/x-kinetic-typography.js +35 -33
- package/dist/x-liquid-dock.js +34 -38
- package/dist/x-liquid-fill.js +42 -45
- package/dist/x-liquid-glass.js +41 -47
- package/dist/x-menu-item.js +8 -8
- package/dist/x-menu.js +10 -11
- package/dist/x-metaball-cursor.js +23 -26
- package/dist/x-modal.js +12 -11
- package/dist/x-morph-stack.d.ts +4 -0
- package/dist/x-morph-stack.js +37 -37
- package/dist/x-multi-combobox.js +36 -36
- package/dist/x-navbar.js +15 -12
- package/dist/x-neural-glow.js +30 -33
- package/dist/x-notification-center.d.ts +2 -0
- package/dist/x-notification-center.js +9 -9
- package/dist/x-organic-divider.js +18 -17
- package/dist/x-organic-progress.js +35 -37
- package/dist/x-organic-shape.js +14 -13
- package/dist/x-otp-input.js +22 -22
- package/dist/x-pagination.js +14 -15
- package/dist/x-particle-button.js +51 -51
- package/dist/x-popover.d.ts +3 -0
- package/dist/x-popover.js +27 -25
- package/dist/x-progress-circle.d.ts +3 -0
- package/dist/x-progress-circle.js +9 -9
- package/dist/x-progress.js +8 -10
- package/dist/x-proximity-list.js +20 -20
- package/dist/x-radio.js +11 -11
- package/dist/x-ripple-effect.js +10 -11
- package/dist/x-scroll-parallax.js +17 -18
- package/dist/x-scroll-stack.js +16 -17
- package/dist/x-scroll-story.js +33 -34
- package/dist/x-scroll-timeline.js +46 -45
- package/dist/x-scroll.d.ts +3 -0
- package/dist/x-scroll.js +38 -40
- package/dist/x-search-field.d.ts +2 -0
- package/dist/x-search-field.js +1 -1
- package/dist/x-select.js +1 -1
- package/dist/x-sidebar.js +18 -17
- package/dist/x-skeleton-group.js +12 -12
- package/dist/x-skeleton.js +1 -1
- package/dist/x-slider.js +16 -15
- package/dist/x-soft-body.js +20 -22
- package/dist/x-spacer.js +4 -4
- package/dist/x-spinner.js +4 -4
- package/dist/x-splash.js +12 -13
- package/dist/x-spotlight-card.js +12 -12
- package/dist/x-stat.js +10 -10
- package/dist/x-stepper.js +13 -14
- package/dist/x-switch.js +11 -10
- package/dist/x-tab.js +7 -7
- package/dist/x-table-cell.js +21 -20
- package/dist/x-table-row.js +8 -8
- package/dist/x-table.d.ts +32 -32
- package/dist/x-table.js +13 -12
- package/dist/x-tabs.js +11 -11
- package/dist/x-text-area.js +19 -19
- 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.d.ts +1 -0
- package/dist/x-toast.js +22 -22
- package/dist/x-toaster.js +7 -8
- package/dist/x-tooltip.d.ts +2 -0
- package/dist/x-tooltip.js +12 -12
- package/dist/x-trace-history.js +120 -117
- package/dist/x-typography.js +9 -9
- package/dist/x-welcome-tour.js +63 -61
- package/package.json +4 -2
package/dist/x-context-menu.d.ts
CHANGED
|
@@ -16,6 +16,10 @@ export interface XContextMenu extends HTMLElement {
|
|
|
16
16
|
placement: string;
|
|
17
17
|
offset: string;
|
|
18
18
|
zIndex: string;
|
|
19
|
+
openAt(x: number, y: number): void;
|
|
20
|
+
toggleAt(x: number, y: number): void;
|
|
21
|
+
openForElement(anchor: Record<string, any>): void;
|
|
22
|
+
close(): void;
|
|
19
23
|
|
|
20
24
|
addEventListener<K extends keyof XContextMenuEventMap>(
|
|
21
25
|
type: K,
|
package/dist/x-context-menu.js
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
$APP
|
|
4
|
-
2,[$APP.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
b);b=document.createElement("div")
|
|
8
|
-
|
|
9
|
-
"keyboard"):
|
|
10
|
-
|
|
11
|
-
{keydown:c,click:b}
|
|
12
|
-
b,c
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
new $APP.
|
|
20
|
-
|
|
21
|
-
|
|
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},Gna=function(a){return $APP.y.j(a,"bottom-start")?"top-start":$APP.y.j(a,"bottom-end")?"top-end":$APP.y.j(a,"top-start")?"bottom-start":$APP.y.j(a,"top-end")?"bottom-end":$APP.y.j(a,"right-start")?"left-start":$APP.y.j(a,"left-start")?"right-start":a},Hna=function(a,b,c,d){var e=$APP.H(c);c=$APP.C(e,$APP.mr);var f=$APP.C(e,
|
|
3
|
+
$APP.lr),h=$APP.C(e,$APP.Vl);e=$APP.C(e,$APP.Wl);var k=$APP.H(d);d=$APP.C(k,$APP.Vl);k=$APP.C(k,$APP.Wl);switch(a){case "bottom-start":return new $APP.N(null,2,[$APP.mr,c,$APP.lr,f+e+b],null);case "bottom-end":return new $APP.N(null,2,[$APP.mr,c+h-d,$APP.lr,f+e+b],null);case "top-start":return new $APP.N(null,2,[$APP.mr,c,$APP.lr,f-k-b],null);case "top-end":return new $APP.N(null,2,[$APP.mr,c+h-d,$APP.lr,f-k-b],null);case "right-start":return new $APP.N(null,2,[$APP.mr,c+h+b,$APP.lr,f],null);case "left-start":return new $APP.N(null,
|
|
4
|
+
2,[$APP.mr,c-d-b,$APP.lr,f],null);default:return new $APP.N(null,2,[$APP.mr,c,$APP.lr,f+e+b],null)}},Ina=function(a,b,c,d){function e(z){var A=Hna(z,b,c,d);A=$APP.H(A);var D=$APP.C(A,$APP.mr),G=$APP.C(A,$APP.lr);A=D>=8&&D+m<=h-8;var J=G>=8&&G+q<=k-8;D=$APP.Hm.j($APP.Gm.j(D,8),h-m-8);G=$APP.Hm.j($APP.Gm.j(G,8),k-q-8);return new $APP.N(null,5,[$APP.mr,D,$APP.lr,G,$APP.En,z,$APP.xr,A&&J,$APP.$p,$APP.Gm.j(40,k-G-8)],null)}var f=$APP.H(new $APP.N(null,2,[$APP.Vl,window.innerWidth,$APP.Wl,window.innerHeight],
|
|
5
|
+
null)),h=$APP.C(f,$APP.Vl),k=$APP.C(f,$APP.Wl);f=$APP.H(d);var m=$APP.C(f,$APP.Vl),q=$APP.C(f,$APP.Wl),u=e(a),x=e(Gna(a));return $APP.n(function(){var z=$APP.xr.i(u);return $APP.n(z)?z:$APP.p($APP.xr.i(x))}())?u:x},a9=function(a){a=new $APP.N(null,5,[$APP.Rn,$APP.n(a.hasAttribute("open"))?a.getAttribute("open"):null,$APP.Wi,$APP.n(a.hasAttribute("disabled"))?a.getAttribute("disabled"):null,$APP.Gs,a.getAttribute("placement"),Y8,a.getAttribute("offset"),Z8,a.getAttribute("z-index")],null);var b=$APP.H(a),
|
|
6
|
+
c=$APP.C(b,$APP.Rn),d=$APP.C(b,$APP.Wi),e=$APP.C(b,$APP.Gs);a=$APP.C(b,Y8);b=$APP.C(b,Z8);c=$APP.Uh(c);d=$APP.Uh(d);e=typeof e==="string"&&$APP.$c(Jna,e)?e:"bottom-start";return new $APP.N(null,5,[$APP.ls,c,$APP.cj,d,$APP.Yo,e,$APP.Bn,X8(a,8),$8,X8(b,1E3)],null)},b9=function(a){return $APP.Ac(a.querySelectorAll("[role\x3dmenuitem]:not([disabled]):not([aria-disabled\x3dtrue])"))},c9=function(a){return $APP.n(a)?a.focus():null},Kna=function(a,b){a=$APP.uj(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},Lna=function(a,b){a=$APP.r($APP.Ac(a.children));for(var c=null,d=0,e=0;;)if(e<d){var f=c.F(null,e);b.appendChild(f.cloneNode(!0));e+=1}else if(a=$APP.r(a))c=a,$APP.Wc(c)?(a=$APP.Cb(c),d=$APP.Db(c),c=a,f=$APP.w(a),a=d,d=f):(f=$APP.t(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=Ina(c,d,b,e);b=$APP.mr.i(d);
|
|
8
|
+
c=$APP.lr.i(d);f=$APP.Vk.m(d,$8,f);d=$APP.H(f);f=$APP.C(d,$8);d=$APP.C(d,$APP.$p);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")},Mna=function(a,b){function c(e){e.stopPropagation();e=e.target.closest("[role\x3dmenuitem]");return $APP.n(e)?($APP.pi(a,"x-context-menu-select",{item:e}),e9.j?e9.j(a,"select"):e9.call(null,a,"select")):null}var d=W8(b);$APP.vj(b,b,"keydown",function(e){var f=e.key,
|
|
9
|
+
h=b.shadowRoot.activeElement;return $APP.y.j(f,"Tab")?e9.j?e9.j(a,"keyboard"):e9.call(null,a,"keyboard"):$APP.y.j(f,"ArrowDown")?(e.preventDefault(),$APP.n(h)?(e=b9(d),h=$APP.dd(e).indexOf(h),h=$APP.B(e,$APP.qd(h+1,$APP.w(e)),null),h=c9(h)):h=c9($APP.t(b9(d))),h):$APP.y.j(f,"ArrowUp")?(e.preventDefault(),$APP.n(h)?(e=b9(d),f=$APP.w(e),h=$APP.dd(e).indexOf(h),h=$APP.B(e,$APP.qd(h+(f-1),f),null),h=c9(h)):h=c9($APP.t(b9(d))),h):($APP.y.j(f,"Enter")||$APP.y.j(f," "))&&$APP.n(h)?(e.preventDefault(),h.click()):
|
|
10
|
+
null},!0);$APP.n(d)&&$APP.vj(b,d,"click",c,!1)},Nna=function(a){function b(d){var e=$APP.l(a,"__xContextMenuLayer");if($APP.n(e)){var f=W8(e);d=d.composedPath();d=$APP.fe(function(h){return h===f},$APP.Ac(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.y.j(d.key,"Escape")?(d.preventDefault(),e9.j?e9.j(a,"keyboard"):e9.call(null,a,"keyboard")):null}$APP.yj(a,"__xContextMenuDocDeferral",function(){return $APP.n(a.hasAttribute("open"))?
|
|
11
|
+
(document.addEventListener("keydown",c),document.addEventListener("click",b),$APP.R(a,"__xContextMenuDocH",{keydown:c,click:b})):null})},f9=function(a){$APP.xj(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.R(a,"__xContextMenuDocH",null))},e9=function(a,b){return $APP.n(a.hasAttribute("open"))&&$APP.ri(a,"x-context-menu-close-request",{reason:b})?
|
|
12
|
+
(f9(a),$APP.U(a,"open"),$APP.wj($APP.l(a,"__xContextMenuLayer")),$APP.R(a,"__xContextMenuLayer",null),$APP.R(a,"__xContextMenuAnchor",null),$APP.R(a,"__xContextMenuModel",null),$APP.pi(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.ri(a,"x-context-menu-open-request",{reason:c})){var d=a9(a);d=$APP.H(d);var e=$APP.C(d,$APP.Yo),f=$APP.C(d,$APP.Bn),h=$APP.C(d,$8),k=
|
|
13
|
+
Kna(a,h);Lna(a,W8(k));Mna(a,k);d9(k,b,e,f,new $APP.N(null,2,[$APP.Vl,200,$APP.Wl,300],null),h);$APP.T(a,"open","");$APP.R(a,"__xContextMenuLayer",k);$APP.R(a,"__xContextMenuAnchor",b);$APP.R(a,"__xContextMenuModel",d);Nna(a);requestAnimationFrame(function(){var m=W8(k);$APP.n(m)&&d9(k,b,e,f,new $APP.N(null,2,[$APP.Vl,m.offsetWidth,$APP.Wl,m.offsetHeight],null),h);return $APP.n(m)?c9($APP.t(b9(m))):null});return $APP.pi(a,"x-context-menu-open",{reason:c})}return null},Ona=function(a){if(!$APP.fi(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.R(a,"__xContextMenuInitialized",!0)}return $APP.n(a.hasAttribute("open"))?$APP.U(a,"open"):null},Pna=function(a){f9(a);var b=$APP.l(a,"__xContextMenuLayer");return $APP.n(b)?($APP.wj(b),$APP.R(a,"__xContextMenuLayer",null),$APP.R(a,"__xContextMenuAnchor",null),$APP.R(a,
|
|
15
|
+
"__xContextMenuModel",null)):null},Qna=function(a,b,c,d){if($APP.I(c,d))if($APP.y.j(b,"open")&&$APP.p(a.hasAttribute("open"))){if(b=$APP.l(a,"__xContextMenuLayer"),$APP.n(b))return f9(a),$APP.wj(b),$APP.R(a,"__xContextMenuLayer",null),$APP.R(a,"__xContextMenuAnchor",null),$APP.R(a,"__xContextMenuModel",null)}else if(c=$APP.l(a,"__xContextMenuLayer"),b=$APP.n(c)?$APP.y.j(b,"placement")||$APP.y.j(b,"offset")||$APP.y.j(b,"z-index"):c,$APP.n(b)&&(b=a9(a),$APP.I(b,$APP.l(a,"__xContextMenuModel")))){c=
|
|
16
|
+
$APP.l(a,"__xContextMenuLayer");if($APP.n(c)&&(d=$APP.l(a,"__xContextMenuAnchor"),$APP.n(d))){var e=a9(a),f=$APP.H(e);e=$APP.C(f,$APP.Yo);var h=$APP.C(f,$APP.Bn);f=$APP.C(f,$8);var k=W8(c);d9(c,d,e,h,$APP.n(k)?new $APP.N(null,2,[$APP.Vl,k.offsetWidth,$APP.Wl,k.offsetHeight],null):new $APP.N(null,2,[$APP.Vl,200,$APP.Wl,300],null),f)}return $APP.R(a,"__xContextMenuModel",b)}return null},Rna=function(a){Object.defineProperty(a,"openAt",{value:function(b,c){return g9(this,new $APP.N(null,4,[$APP.mr,b,
|
|
17
|
+
$APP.lr,c,$APP.Vl,1,$APP.Wl,1],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.N(null,4,[$APP.mr,b,$APP.lr,c,$APP.Vl,1,$APP.Wl,1],null),"toggle")},writable:!0,configurable:!0});Object.defineProperty(a,"openForElement",{value:function(b){b=b.getBoundingClientRect();return g9(this,new $APP.N(null,4,[$APP.mr,b.left,$APP.lr,b.top,$APP.Vl,b.width,$APP.Wl,b.height],null),
|
|
18
|
+
"programmatic")},writable:!0,configurable:!0});return Object.defineProperty(a,"close",{value:function(){return e9(this,"programmatic")},writable:!0,configurable:!0})},Tna=function(a){$APP.Ei(a,Sna);return Rna(a)},h9=function(){return $APP.Kh("x-context-menu",new $APP.N(null,5,[$APP.Bh,Una,$APP.zh,Ona,$APP.qh,Pna,$APP.ph,Qna,$APP.Ah,Tna],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",
|
|
19
|
+
-1418404095);var Una=["open","disabled","placement","offset","z-index"],Jna=new $APP.rg(null,new $APP.N(null,6,["right-start",null,"bottom-start",null,"bottom-end",null,"top-end",null,"top-start",null,"left-start",null],null),null),Sna=new $APP.N(null,5,[$APP.Ir,new $APP.N(null,2,[$APP.O,$APP.Ci,$APP.W,"open"],null),$APP.Hk,new $APP.N(null,2,[$APP.O,$APP.Ci,$APP.W,"disabled"],null),$APP.Yo,new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"placement"],null),$APP.Bn,new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"offset"],null),
|
|
20
|
+
new $APP.F(null,"zIndex","zIndex",-1588341609),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"z-index"],null)],null);
|
|
21
|
+
$APP.be(["x-context-menu-open-request",new $APP.N(null,2,[$APP.Mr,!0,$APP.V,new $APP.N(null,1,[$APP.$n,$APP.Y],null)],null),"x-context-menu-open",new $APP.N(null,2,[$APP.Mr,!1,$APP.V,new $APP.N(null,1,[$APP.$n,$APP.Y],null)],null),"x-context-menu-close-request",new $APP.N(null,2,[$APP.Mr,!0,$APP.V,new $APP.N(null,1,[$APP.$n,$APP.Y],null)],null),"x-context-menu-close",new $APP.N(null,2,[$APP.Mr,!1,$APP.V,new $APP.N(null,1,[$APP.$n,$APP.Y],null)],null),"x-context-menu-select",new $APP.N(null,2,[$APP.Mr,
|
|
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;
|
package/dist/x-copy.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
$APP.
|
|
2
|
+
var RM=function(a){return a==null?!0:$APP.y.j(a,"false")?!1:$APP.y.j(a,"0")?!1:!0},SM=function(a){return typeof a==="string"&&$APP.I(a,"")?(a=parseInt(a,10),$APP.p(isNaN(a))&&a>0?a:1200):1200},TM=function(a){return Math.min(1E4,Math.max(100,a))},gN=function(a){var b=$APP.H(a);a=$APP.C(b,UM);var c=$APP.C(b,VM),d=$APP.C(b,WM),e=$APP.C(b,$APP.an),f=$APP.C(b,$APP.$q),h=$APP.C(b,XM),k=$APP.C(b,YM),m=$APP.C(b,$APP.Wi),q=$APP.C(b,ZM);b=$APP.C(b,$M);return $APP.Yf([aN,$APP.Jo,bN,cN,dN,$APP.mn,eN,$APP.cj,
|
|
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
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
|
-
|
|
7
|
-
$APP
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
d
|
|
11
|
-
$APP.
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
$APP.
|
|
16
|
-
"disabled");Object.defineProperty(a,"showTooltip",{get:function(){return
|
|
17
|
-
Object.defineProperty(a,"textValue",{get:function(){return $APP.
|
|
18
|
-
|
|
19
|
-
"success-message-raw",388691116),
|
|
20
|
-
$APP.
|
|
21
|
-
"note","note",1426297904),"property-only override"],null),new $APP.
|
|
22
|
-
$APP.W,"text"],null)]);$APP.
|
|
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;
|
package/dist/x-currency-field.js
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
$APP.
|
|
5
|
-
f.appendChild(
|
|
6
|
-
f,c):$APP.n($APP.n(h)?$APP.
|
|
7
|
-
|
|
8
|
-
a.getAttribute("placeholder")]);var
|
|
9
|
-
"",$APP.
|
|
10
|
-
$APP.n(
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
if($APP.n(b)){b=$APP.
|
|
14
|
-
if($APP.n(b)){b=$APP.
|
|
15
|
-
|
|
16
|
-
b.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
new $APP.
|
|
24
|
-
|
|
2
|
+
var QZ=function(a){a=(""+$APP.P.i($APP.n(a)?a:"")).trim().toUpperCase();return $APP.y.j(a,"")?"USD":a},rga=function(a,b){try{var c=(new Intl.NumberFormat($APP.y.j(b,"")?"en-US":b,{style:"currency",currency:a})).formatToParts(0),d=$APP.fe(function(e){return $APP.y.j("currency",e.type)?e.value:null},$APP.Ac(c));return $APP.n(d)?d:a}catch(e){return a}},RZ=function(a,b){var c=parseFloat(a);if($APP.n(isNaN(c)))return a;try{return(new Intl.NumberFormat($APP.y.j(b,"")?void 0:b,{minimumFractionDigits:2,maximumFractionDigits:2})).format(c)}catch(d){return a}},
|
|
3
|
+
sga=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"),q=document.createElement("span"),u={};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(q,"part","error");$APP.T(q,"id","error");$APP.T(q,"role","alert");$APP.T(q,"aria-live","assertive");f.appendChild(h);
|
|
5
|
+
f.appendChild(k);d.appendChild(e);d.appendChild(f);d.appendChild(m);d.appendChild(q);b.appendChild(c);b.appendChild(d);u.field=d;u.label=e;u.wrapper=f;u.symbol=h;u.input=k;u.hint=m;u.error=q;$APP.R(a,"__xCurrencyFieldRefs",u)},SZ=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 q=$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.y.j(d,""):h)?b.setValidity({valueMissing:!0},"Please fill in this field.",c):$APP.I(d,"")&&!q?b.setValidity({badInput:!0},"Please enter a valid number.",c):$APP.n(q?$APP.n(k)?$APP.p(isNaN(k))&&a<k:k:q)?b.setValidity({rangeUnderflow:!0},"Value must be at least "+$APP.P.i(k)+".",c):$APP.n(q?$APP.n(m)?$APP.p(isNaN(m))&&a>m:m:q)?b.setValidity({rangeOverflow:!0},"Value must be at most "+$APP.P.i(m)+".",c):b.setValidity({},"",c)},
|
|
7
|
+
TZ=function(a,b,c,d){a.textContent=b;$APP.n(c)?a.classList.remove(d):a.classList.add(d)},ZZ=function(a){if($APP.n($APP.l(a,"__xCurrencyFieldRefs"))){var b=$APP.Yf([$APP.Vi,UZ,$APP.Si,$APP.Un,$APP.ko,$APP.Wi,VZ,$APP.Xi,$APP.yq,$APP.hk,$APP.Ti,WZ,$APP.Ui],[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.H(b);b=$APP.C(c,$APP.Ui);var d=$APP.C(c,$APP.Vi),e=$APP.C(c,UZ),f=$APP.C(c,$APP.Si),h=$APP.C(c,$APP.Un),k=$APP.C(c,$APP.ko),m=$APP.C(c,$APP.Wi),q=$APP.C(c,VZ),u=$APP.C(c,$APP.Xi),x=$APP.C(c,$APP.yq),z=$APP.C(c,$APP.hk),A=$APP.C(c,$APP.Ti);c=$APP.C(c,WZ);var D=$APP.n(h)?h:"",G=$APP.n(k)?k:"",J=$APP.n(d)?d:"";b=$APP.Yf([$APP.Dp,$APP.dj,$APP.mk,$APP.aj,$APP.Dn,$APP.Cs,$APP.$i,$APP.ei,$APP.dr,$APP.zq,$APP.zr,XZ,
|
|
9
|
+
$APP.sq,$APP.bj,$APP.On,$APP.cj],[$APP.n(q)?q:"",$APP.E(u),$APP.E(z),$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,""),G,QZ(e),$APP.n(x)?x:"",J,D,$APP.E(m)]);$APP.I($APP.l(a,"__xCurrencyFieldModel"),b)?(f=$APP.l(a,"__xCurrencyFieldRefs"),$APP.n(f)?(h=$APP.l(f,"label"),q=$APP.l(f,"symbol"),d=$APP.l(f,"input"),e=$APP.l(f,"hint"),f=$APP.l(f,"error"),u=$APP.H(b),k=$APP.C(u,$APP.zq),m=$APP.C(u,
|
|
10
|
+
$APP.On),$APP.n(k)?u=null:(z=$APP.H(u),u=$APP.C(z,$APP.ei),x=$APP.C(z,$APP.Dp),z=$APP.C(z,$APP.sq),A=parseFloat(u),c=$APP.I(u,"")&&$APP.p(isNaN(A)),D=$APP.I(x,"")?parseFloat(x):null,G=$APP.I(z,"")?parseFloat(z):null,u=$APP.I(u,"")&&!c?"Please enter a valid number.":$APP.n(c?$APP.n(D)?$APP.p(isNaN(D))&&A<D:D:c)?"Value must be at least "+$APP.P.i(x)+".":$APP.n(c?$APP.n(G)?$APP.p(isNaN(G))&&A>G:G:c)?"Value must be at most "+$APP.P.i(z)+".":""),k=new $APP.N(null,2,[$APP.zq,$APP.n(k)?k:$APP.I($APP.n(u)?
|
|
11
|
+
u:"",""),YZ,$APP.n(k)?m:$APP.n(u)?u:""],null),m=$APP.H(k),k=$APP.C(m,$APP.zq),m=$APP.C(m,YZ),x=$APP.H(b),u=$APP.C(x,XZ),x=$APP.C(x,$APP.Cs),q.textContent=rga(u,x),A=$APP.H(b),q=$APP.C(A,$APP.$i),u=$APP.C(A,$APP.aj),x=$APP.C(A,$APP.cj),z=$APP.C(A,$APP.mk),A=$APP.C(A,$APP.dj),d.name=q,d.placeholder=u,d.disabled=x,d.readOnly=z,d.required=A,$APP.T(d,"aria-required",$APP.n($APP.dj.i(b))?"true":"false"),$APP.T(d,"aria-invalid",$APP.n(k)?"true":"false"),q=$APP.H(b),q=$APP.C(q,$APP.Dn),q=$APP.n($APP.n(q)?
|
|
12
|
+
k:q)?"hint error":$APP.n(q)?"hint":$APP.n(k)?"error":null,$APP.n(q)?$APP.T(d,"aria-describedby",q):$APP.U(d,"aria-describedby"),u=$APP.H(b),q=$APP.C(u,$APP.ei),$APP.C(u,XZ),u=$APP.C(u,$APP.Cs),$APP.y.j(d,a.shadowRoot.activeElement)||(d.value=$APP.y.j(q,"")?"":RZ(q,u)),u=$APP.H(b),q=$APP.C(u,$APP.bj),u=$APP.C(u,$APP.dr),TZ(h,q,u,"label-hidden"),q=$APP.H(b),h=$APP.C(q,$APP.zr),q=$APP.C(q,$APP.Dn),TZ(e,h,q,"hint-hidden"),TZ(f,m,k,"error-hidden"),$APP.ki(a,"data-invalid",k),e=$APP.l(a,"__xCurrencyFieldInternals"),
|
|
13
|
+
$APP.n(e)&&(f=a.getAttribute("value"),SZ(a,e,d,$APP.n(f)?f:"")),a=$APP.R(a,"__xCurrencyFieldModel",b)):a=null):a=null;return a}return null},tga=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.ri(a,"x-currency-field-change-request",{name:e,value:c,previousValue:d})?(d=$APP.l(a,"__xCurrencyFieldInternals"),
|
|
14
|
+
$APP.n(d)&&(d.setFormValue(c),SZ(a,d,b,c)),$APP.pi(a,"x-currency-field-input",{name:e,value:c})):b.value=d}return null},uga=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.ri(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),SZ(a,e,b,c)),$APP.pi(a,"x-currency-field-change",{name:d,value:c})):b.value=e}return null},vga=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 tga(a)},e=function(){return uga(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.R(a,"__xCurrencyFieldHandlers",f)}},$Z=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.R(a,"__xCurrencyFieldHandlers",null)}return null},wga=function(a,
|
|
17
|
+
b){$APP.ki(a,"disabled",$APP.E(b));return ZZ(a)},xga=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 ZZ(a)},yga=function(a){$APP.n($APP.l(a,"__xCurrencyFieldRefs"))||(sga(a),$APP.n(a.attachInternals)&&$APP.R(a,"__xCurrencyFieldInternals",a.attachInternals()));$Z(a);var b=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=a.getAttribute("value");
|
|
18
|
+
QZ(a.getAttribute("currency"));var d=function(){var e=a.getAttribute("locale");return $APP.n(e)?e:""}();$APP.n(c)&&(b.value=RZ(c,d))}b=$APP.l(a,"__xCurrencyFieldInternals");$APP.n(b)&&b.setFormValue(function(){var e=a.getAttribute("value");return $APP.n(e)?e:""}());vga(a);return ZZ(a)},zga=function(a){return $Z(a)},Aga=function(a,b,c,d){return $APP.I(c,d)?($APP.y.j(b,"value")&&(b=$APP.l(a,"__xCurrencyFieldRefs"),$APP.n(b)&&(b=$APP.l(b,"input"),$APP.y.j(b,a.shadowRoot.activeElement)||(QZ(a.getAttribute("currency")),
|
|
19
|
+
c=a.getAttribute("locale"),c=$APP.n(c)?c:"",b.value=d==null||$APP.y.j(d,"")?"":RZ(d,c)))),ZZ(a)):null},Bga=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");QZ(this.getAttribute("currency"));var d=this.getAttribute("locale");d=$APP.n(d)?d:"";return $APP.y.j(c,
|
|
20
|
+
this.shadowRoot.activeElement)?null:c.value=$APP.y.j(b,"")?"":RZ(b,d)}return null}})},Cga=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})},Dga=function(a){Bga(a);$APP.xi(a,"name","name",
|
|
21
|
+
"");$APP.xi(a,"currency","currency","");$APP.xi(a,"locale","locale","");$APP.xi(a,"min","min","");$APP.xi(a,"max","max","");$APP.xi(a,"placeholder","placeholder","");$APP.xi(a,"label","label","");$APP.xi(a,"hint","hint","");$APP.xi(a,"error","error","");$APP.ui(a,"disabled","disabled");$APP.ui(a,"readOnly","readonly");$APP.ui(a,"required","required");return Cga(a)},a_=function(){return $APP.Kh("x-currency-field",new $APP.N(null,8,[$APP.Bh,Ega,$APP.zh,yga,$APP.qh,zga,$APP.ph,Aga,$APP.rh,!0,$APP.oh,
|
|
22
|
+
wga,$APP.nh,xga,$APP.Ah,Dga],null))},VZ=new $APP.F(null,"min-raw","min-raw",183137548),XZ=new $APP.F(null,"currency","currency",-898327568),YZ=new $APP.F(null,"display-error","display-error",-179691836),WZ=new $APP.F(null,"locale-raw","locale-raw",385401846),UZ=new $APP.F(null,"currency-raw","currency-raw",1169887491);var Ega="name value currency locale min max placeholder label hint error disabled required readonly".split(" ");
|
|
23
|
+
$APP.Yf([$APP.Dp,$APP.aj,$APP.Hk,$APP.Cs,$APP.$i,$APP.ei,$APP.zr,XZ,$APP.Or,$APP.sq,$APP.bj,$APP.On,$APP.Zp],[new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"min"],null),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"placeholder"],null),new $APP.N(null,2,[$APP.O,$APP.Ci,$APP.W,"disabled"],null),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"locale"],null),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"name"],null),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"value"],null),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"hint"],null),
|
|
24
|
+
new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"currency"],null),new $APP.N(null,2,[$APP.O,$APP.Ci,$APP.W,"readonly"],null),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"max"],null),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"label"],null),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"error"],null),new $APP.N(null,2,[$APP.O,$APP.Ci,$APP.W,"required"],null)]);
|
|
25
|
+
$APP.be(["x-currency-field-change-request",new $APP.N(null,2,[$APP.Mr,!0,$APP.V,new $APP.N(null,3,[$APP.$i,$APP.Y,$APP.ei,$APP.Y,$APP.oq,$APP.Y],null)],null),"x-currency-field-input",new $APP.N(null,2,[$APP.Mr,!1,$APP.V,new $APP.N(null,2,[$APP.$i,$APP.Y,$APP.ei,$APP.Y],null)],null),"x-currency-field-change",new $APP.N(null,2,[$APP.Mr,!1,$APP.V,new $APP.N(null,2,[$APP.$i,$APP.Y,$APP.ei,$APP.Y],null)],null)]);$APP.fa("baredom.exports.x_currency_field.init",a_);export const init=a_;
|
package/dist/x-date-picker.d.ts
CHANGED