@vanelsas/baredom 2.4.1 → 2.6.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 +25 -0
- package/README.md +63 -270
- package/custom-elements.json +7373 -0
- package/dist/baredom.d.ts +97 -0
- package/dist/base.js +74 -74
- package/dist/integrity.json +93 -93
- package/dist/x-alert.d.ts +43 -0
- package/dist/x-alert.js +17 -17
- package/dist/x-avatar-group.d.ts +18 -0
- package/dist/x-avatar-group.js +10 -10
- package/dist/x-avatar.d.ts +21 -0
- package/dist/x-avatar.js +13 -13
- package/dist/x-badge.d.ts +19 -0
- package/dist/x-badge.js +11 -11
- package/dist/x-bento-grid.d.ts +12 -0
- package/dist/x-bento-grid.js +5 -5
- package/dist/x-bento-item.d.ts +12 -0
- package/dist/x-bento-item.js +4 -4
- package/dist/x-breadcrumbs.d.ts +20 -0
- package/dist/x-breadcrumbs.js +14 -14
- package/dist/x-button.d.ts +45 -0
- package/dist/x-button.js +15 -15
- package/dist/x-cancel-dialogue.d.ts +50 -0
- package/dist/x-cancel-dialogue.js +12 -12
- package/dist/x-card.d.ts +39 -0
- package/dist/x-card.js +7 -7
- package/dist/x-carousel.d.ts +48 -0
- package/dist/x-carousel.js +28 -28
- package/dist/x-chart.d.ts +23 -0
- package/dist/x-chart.js +46 -46
- package/dist/x-checkbox.d.ts +45 -0
- package/dist/x-checkbox.js +11 -11
- package/dist/x-chip.d.ts +41 -0
- package/dist/x-chip.js +8 -8
- package/dist/x-collapse.d.ts +42 -0
- package/dist/x-collapse.js +10 -10
- package/dist/x-color-picker.d.ts +47 -0
- package/dist/x-color-picker.js +41 -41
- package/dist/x-combobox.d.ts +47 -0
- package/dist/x-combobox.js +25 -25
- package/dist/x-command-palette.d.ts +46 -0
- package/dist/x-command-palette.js +24 -24
- package/dist/x-container.d.ts +14 -0
- package/dist/x-container.js +6 -6
- package/dist/x-context-menu.d.ts +17 -0
- package/dist/x-context-menu.js +18 -18
- package/dist/x-copy.d.ts +51 -0
- package/dist/x-copy.js +20 -20
- package/dist/x-currency-field.d.ts +52 -0
- package/dist/x-currency-field.js +23 -21
- package/dist/x-date-picker.d.ts +20 -0
- package/dist/x-date-picker.js +37 -37
- package/dist/x-divider.d.ts +20 -0
- package/dist/x-divider.js +8 -8
- package/dist/x-drawer.d.ts +44 -0
- package/dist/x-drawer.js +11 -11
- package/dist/x-dropdown.d.ts +42 -0
- package/dist/x-dropdown.js +9 -9
- package/dist/x-fieldset.d.ts +14 -0
- package/dist/x-fieldset.js +5 -5
- package/dist/x-file-download.d.ts +40 -0
- package/dist/x-file-download.js +7 -7
- package/dist/x-file-upload.d.ts +46 -0
- package/dist/x-file-upload.js +22 -22
- package/dist/x-form-field.d.ts +47 -0
- package/dist/x-form-field.js +15 -15
- package/dist/x-form.d.ts +41 -0
- package/dist/x-form.js +9 -9
- package/dist/x-gaussian-blur.d.ts +20 -0
- package/dist/x-gaussian-blur.js +16 -16
- package/dist/x-grid.d.ts +12 -0
- package/dist/x-grid.js +6 -6
- package/dist/x-icon.d.ts +15 -0
- package/dist/x-icon.js +7 -7
- package/dist/x-image.d.ts +48 -0
- package/dist/x-image.js +18 -18
- package/dist/x-kinetic-font.d.ts +48 -0
- package/dist/x-kinetic-font.js +28 -28
- package/dist/x-kinetic-typography.d.ts +27 -0
- package/dist/x-kinetic-typography.js +37 -37
- package/dist/x-liquid-dock.d.ts +47 -0
- package/dist/x-liquid-dock.js +35 -35
- package/dist/x-liquid-fill.d.ts +46 -0
- package/dist/x-liquid-fill.js +40 -40
- package/dist/x-liquid-glass.d.ts +25 -0
- package/dist/x-liquid-glass.js +35 -35
- package/dist/x-menu-item.d.ts +41 -0
- package/dist/x-menu-item.js +10 -10
- package/dist/x-menu.d.ts +42 -0
- package/dist/x-menu.js +10 -10
- package/dist/x-metaball-cursor.d.ts +21 -0
- package/dist/x-metaball-cursor.js +25 -25
- package/dist/x-modal.d.ts +44 -0
- package/dist/x-modal.js +11 -11
- package/dist/x-morph-stack.d.ts +46 -0
- package/dist/x-morph-stack.js +39 -39
- package/dist/x-navbar.d.ts +46 -0
- package/dist/x-navbar.js +12 -12
- package/dist/x-neural-glow.d.ts +22 -0
- package/dist/x-neural-glow.js +30 -30
- package/dist/x-notification-center.d.ts +42 -0
- package/dist/x-notification-center.js +10 -10
- package/dist/x-organic-divider.d.ts +19 -0
- package/dist/x-organic-divider.js +15 -15
- package/dist/x-organic-progress.d.ts +45 -0
- package/dist/x-organic-progress.js +35 -35
- package/dist/x-organic-shape.d.ts +18 -0
- package/dist/x-organic-shape.js +12 -12
- package/dist/x-pagination.d.ts +45 -0
- package/dist/x-pagination.js +17 -16
- package/dist/x-particle-button.d.ts +47 -0
- package/dist/x-particle-button.js +46 -46
- package/dist/x-popover.d.ts +45 -0
- package/dist/x-popover.js +23 -23
- package/dist/x-progress-circle.d.ts +41 -0
- package/dist/x-progress-circle.js +7 -7
- package/dist/x-progress.d.ts +44 -0
- package/dist/x-progress.js +7 -7
- package/dist/x-radio.d.ts +44 -0
- package/dist/x-radio.js +11 -11
- package/dist/x-ripple-effect.d.ts +42 -0
- package/dist/x-ripple-effect.js +11 -11
- package/dist/x-scroll-parallax.d.ts +45 -0
- package/dist/x-scroll-parallax.js +17 -17
- package/dist/x-scroll-stack.d.ts +46 -0
- package/dist/x-scroll-stack.js +18 -18
- package/dist/x-scroll-story.d.ts +56 -0
- package/dist/x-scroll-story.js +33 -33
- package/dist/x-scroll-timeline.d.ts +58 -0
- package/dist/x-scroll-timeline.js +44 -44
- package/dist/x-scroll.d.ts +51 -0
- package/dist/x-scroll.js +39 -39
- package/dist/x-search-field.d.ts +47 -0
- package/dist/x-search-field.js +15 -14
- package/dist/x-select.d.ts +41 -0
- package/dist/x-select.js +10 -10
- package/dist/x-sidebar.d.ts +40 -0
- package/dist/x-sidebar.js +16 -16
- package/dist/x-skeleton-group.d.ts +15 -0
- package/dist/x-skeleton-group.js +13 -13
- package/dist/x-skeleton.d.ts +16 -0
- package/dist/x-skeleton.js +1 -1
- package/dist/x-slider.d.ts +49 -0
- package/dist/x-slider.js +18 -16
- package/dist/x-soft-body.d.ts +44 -0
- package/dist/x-soft-body.js +20 -20
- package/dist/x-spacer.d.ts +15 -0
- package/dist/x-spacer.js +5 -5
- package/dist/x-spinner.d.ts +15 -0
- package/dist/x-spinner.js +5 -5
- package/dist/x-splash.d.ts +42 -0
- package/dist/x-splash.js +13 -13
- package/dist/x-stat.d.ts +21 -0
- package/dist/x-stat.js +9 -9
- package/dist/x-stepper.d.ts +42 -0
- package/dist/x-stepper.js +14 -14
- package/dist/x-switch.d.ts +44 -0
- package/dist/x-switch.js +10 -10
- package/dist/x-tab.d.ts +40 -0
- package/dist/x-tab.js +7 -7
- package/dist/x-table-cell.d.ts +50 -0
- package/dist/x-table-cell.js +19 -19
- package/dist/x-table-row.d.ts +43 -0
- package/dist/x-table-row.js +10 -10
- package/dist/x-table.d.ts +124 -0
- package/dist/x-table.js +13 -13
- package/dist/x-tabs.d.ts +71 -0
- package/dist/x-tabs.js +11 -11
- package/dist/x-text-area.d.ts +48 -0
- package/dist/x-text-area.js +20 -18
- package/dist/x-theme.d.ts +15 -0
- package/dist/x-theme.js +24 -24
- package/dist/x-timeline-item.d.ts +46 -0
- package/dist/x-timeline-item.js +19 -19
- package/dist/x-timeline.d.ts +78 -0
- package/dist/x-timeline.js +9 -9
- package/dist/x-toast.d.ts +45 -0
- package/dist/x-toast.js +21 -21
- package/dist/x-toaster.d.ts +41 -0
- package/dist/x-toaster.js +8 -8
- package/dist/x-tooltip.d.ts +43 -0
- package/dist/x-tooltip.js +12 -12
- package/dist/x-typography.d.ts +16 -0
- package/dist/x-typography.js +8 -8
- package/dist/x-welcome-tour.d.ts +92 -0
- package/dist/x-welcome-tour.js +58 -58
- package/package.json +506 -392
package/dist/x-copy.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
$APP.
|
|
4
|
-
$APP.M(a);a=$APP.D(b,$APP.
|
|
2
|
+
var NE=function(a){return a==null?!0:$APP.B.i(a,"false")?!1:$APP.B.i(a,"0")?!1:!0},OE=function(a){return typeof a==="string"&&$APP.N(a,"")?(a=parseInt(a,10),$APP.r(isNaN(a))&&a>0?a:1200):1200},PE=function(a){return Math.min(1E4,Math.max(100,a))},cF=function(a){var b=$APP.M(a);a=$APP.D(b,QE);var c=$APP.D(b,RE),d=$APP.D(b,SE),e=$APP.D(b,$APP.Kh),g=$APP.D(b,$APP.xl),h=$APP.D(b,TE),l=$APP.D(b,UE),m=$APP.D(b,$APP.Ol),p=$APP.D(b,VE);b=$APP.D(b,WE);return $APP.zf([XE,$APP.wj,YE,ZE,$E,$APP.Vh,aF,$APP.X,bF,
|
|
3
|
+
$APP.Cl],[NE(b),$APP.B.i(g,"html")?"html":"text",typeof l==="string"&&$APP.N(l.trim(),"")?l.trim():null,typeof a==="string"&&$APP.N(a.trim(),"")?a.trim():null,PE(OE(c)),typeof d==="string"&&$APP.N(d.trim(),"")?d.trim():null,function(){var q;if(q=typeof h==="string")q=(q=$APP.N(h,""))?h:q;return $APP.n(q)?q:"Copy failed"}(),$APP.F(m),function(){var q;if(q=typeof p==="string")q=(q=$APP.N(p,""))?p:q;return $APP.n(q)?q:"Copied"}(),typeof e==="string"&&$APP.N(e.trim(),"")?e.trim():null])},dF=function(a){var b=
|
|
4
|
+
$APP.M(a);a=$APP.D(b,$APP.Cl);var c=$APP.D(b,$APP.Vh),d=$APP.D(b,YE);b=$APP.D(b,$APP.wj);return{text:$APP.n(a)?a:"",mode:$APP.n(b)?b:"text",from:$APP.n(c)?c:null,fromAttr:$APP.n(d)?d:null}},eF=function(a){var b=$APP.k(a,"__xCopyRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("span"),e=document.createElement("button"),g=document.createElement("slot"),h=document.createElement("span"),l=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
|
-
d.setAttribute("part","wrap");e.setAttribute("part","trigger");e.setAttribute("type","button");e.appendChild(g);h.setAttribute("part","tooltip");h.setAttribute("role","status");h.setAttribute("aria-live","polite");l.setAttribute("name","tooltip");m.setAttribute("part","tooltip-text");h.appendChild(l);h.appendChild(m);d.appendChild(e);d.appendChild(h);b.appendChild(c);b.appendChild(d);a.__xCopyRefs={root:b,wrap:d,trigger:e,tooltip:h,tooltipSlot:l,tooltipText:m};return $APP.k(a,"__xCopyRefs")},
|
|
7
|
-
$APP.Kh,$APP.
|
|
8
|
-
return typeof b==="string"&&$APP.N(b,"")&&(b=document.querySelector(b),$APP.n(b))?(a=a.getAttribute("from-attr"),a=typeof a==="string"&&$APP.N(a,"")?b.getAttribute(a):b.textContent,$APP.n(a)?a:""):""},
|
|
6
|
+
d.setAttribute("part","wrap");e.setAttribute("part","trigger");e.setAttribute("type","button");e.appendChild(g);h.setAttribute("part","tooltip");h.setAttribute("role","status");h.setAttribute("aria-live","polite");l.setAttribute("name","tooltip");m.setAttribute("part","tooltip-text");h.appendChild(l);h.appendChild(m);d.appendChild(e);d.appendChild(h);b.appendChild(c);b.appendChild(d);a.__xCopyRefs={root:b,wrap:d,trigger:e,tooltip:h,tooltipSlot:l,tooltipText:m};return $APP.k(a,"__xCopyRefs")},fF=function(a){return cF($APP.zf([SE,
|
|
7
|
+
$APP.Kh,$APP.xl,TE,UE,$APP.Ol,VE,WE,QE,RE],[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")]))},gF=function(a){var b=$APP.k(a,"__xCopyTextValue");if(typeof b==="string")return b;b=a.getAttribute("text");if(typeof b==="string"&&$APP.N(b,""))return b;b=a.getAttribute("from");
|
|
8
|
+
return typeof b==="string"&&$APP.N(b,"")&&(b=document.querySelector(b),$APP.n(b))?(a=a.getAttribute("from-attr"),a=typeof a==="string"&&$APP.N(a,"")?b.getAttribute(a):b.textContent,$APP.n(a)?a:""):""},hF=function(a){var b=gF(a),c=function(){var d=a.getAttribute("mode");return $APP.n(d)?d:"text"}();return new Promise(function(d,e){if($APP.B.i(c,"html")){if($APP.n(function(){var h=navigator.clipboard;return $APP.n(h)?window.ClipboardItem:h}()))return navigator.clipboard.write($APP.Hh(new $APP.O(null,
|
|
9
9
|
1,5,$APP.P,[new ClipboardItem({"text/html":new Blob([b],{type:"text/html"}),"text/plain":new Blob([b],{type:"text/plain"})})],null))).then(function(){return d.g?d.g(b):d.call(null,b)}).catch(function(h){return e.g?e.g(h):e.call(null,h)});try{var g=document.createElement("textarea");g.value=b;document.body.appendChild(g);g.select();document.execCommand("copy");g.remove();return d.g?d.g(b):d.call(null,b)}catch(h){if(h instanceof Error)return g=h,e.g?e.g(g):e.call(null,g);throw h;}}else{if($APP.n(navigator.clipboard))return navigator.clipboard.writeText(b).then(function(){return d.g?
|
|
10
|
-
d.g(b):d.call(null,b)}).catch(function(h){try{return document.execCommand("copy"),d.g?d.g(b):d.call(null,b)}catch(l){if(l instanceof Error)return e.g?e.g(h):e.call(null,h);throw l;}});try{return g=document.createElement("textarea"),g.value=b,g.style.position="fixed",g.style.opacity="0",document.body.appendChild(g),g.select(),document.execCommand("copy"),g.remove(),d.g?d.g(b):d.call(null,b)}catch(h){if(h instanceof Error)return g=h,e.g?e.g(g):e.call(null,g);throw h;}}})},
|
|
11
|
-
$APP.k(a,"__xCopyRefs");if($APP.n(e)){var g=$APP.k(a,"__xCopyTid");$APP.n(g)&&(clearTimeout(g),a.__xCopyTid=null);a.setAttribute("data-tooltip-open","");a.setAttribute("data-tooltip-kind",b);$APP.k(e,"tooltipText").textContent=c;$APP.ja(a,"__xCopyTid",setTimeout(function(){a.__xCopyTid=null;a.removeAttribute("data-tooltip-open");a.removeAttribute("data-tooltip-kind");var h=$APP.k(a,"__xCopyRefs");$APP.n(h)&&($APP.k(h,"tooltipText").textContent="");return null},d))}},
|
|
12
|
-
{detail:c,bubbles:!0,composed:!0,cancelable:d});a.dispatchEvent(b);return b},
|
|
13
|
-
return Promise.reject(d)})},
|
|
14
|
-
|
|
15
|
-
"click");b=$APP.k(b,"keydown");$APP.n(d)&&c.removeEventListener("click",d);$APP.n(b)&&document.removeEventListener("keydown",b)}a.__xCopyHandlers=null},
|
|
10
|
+
d.g(b):d.call(null,b)}).catch(function(h){try{return document.execCommand("copy"),d.g?d.g(b):d.call(null,b)}catch(l){if(l instanceof Error)return e.g?e.g(h):e.call(null,h);throw l;}});try{return g=document.createElement("textarea"),g.value=b,g.style.position="fixed",g.style.opacity="0",document.body.appendChild(g),g.select(),document.execCommand("copy"),g.remove(),d.g?d.g(b):d.call(null,b)}catch(h){if(h instanceof Error)return g=h,e.g?e.g(g):e.call(null,g);throw h;}}})},iF=function(a,b,c,d){var e=
|
|
11
|
+
$APP.k(a,"__xCopyRefs");if($APP.n(e)){var g=$APP.k(a,"__xCopyTid");$APP.n(g)&&(clearTimeout(g),a.__xCopyTid=null);a.setAttribute("data-tooltip-open","");a.setAttribute("data-tooltip-kind",b);$APP.k(e,"tooltipText").textContent=c;$APP.ja(a,"__xCopyTid",setTimeout(function(){a.__xCopyTid=null;a.removeAttribute("data-tooltip-open");a.removeAttribute("data-tooltip-kind");var h=$APP.k(a,"__xCopyRefs");$APP.n(h)&&($APP.k(h,"tooltipText").textContent="");return null},d))}},jF=function(a,b,c,d){b=new CustomEvent(b,
|
|
12
|
+
{detail:c,bubbles:!0,composed:!0,cancelable:d});a.dispatchEvent(b);return b},kF=function(a){if($APP.n(a.hasAttribute("disabled")))return Promise.resolve(null);var b=fF(a),c=dF(b);c=jF(a,"x-copy-request",c,!0);return $APP.n(c.defaultPrevented)?Promise.resolve(null):hF(a).then(function(d){jF(a,"x-copy-success",{text:$APP.n(d)?d:""},!1);$APP.n(XE.g(b))&&iF(a,"success",bF.g(b),$E.g(b));return d}).catch(function(d){jF(a,"x-copy-error",{error:""+$APP.T.g(d)},!1);$APP.n(XE.g(b))&&iF(a,"error",aF.g(b),$E.g(b));
|
|
13
|
+
return Promise.reject(d)})},lF=function(a,b){if(typeof b==="string"&&$APP.N(b,"")){var c=b.toLowerCase().split("+");b=$APP.xc(c);var d=$APP.F($APP.Td(function(h){return $APP.B.i(h,"ctrl")},c)),e=$APP.F($APP.Td(function(h){return $APP.B.i(h,"shift")},c)),g=$APP.F($APP.Td(function(h){return $APP.B.i(h,"alt")},c));c=$APP.F($APP.Td(function(h){return $APP.B.i(h,"meta")},c));return $APP.B.i(a.key.toLowerCase(),b)&&$APP.B.i(d,a.ctrlKey)&&$APP.B.i(e,a.shiftKey)&&$APP.B.i(g,a.altKey)&&$APP.B.i(c,a.metaKey)}return null},
|
|
14
|
+
mF=function(a){function b(e){var g=a.getAttribute("hotkey");return $APP.n(lF(e,g))?(e.preventDefault(),kF(a)):null}function c(){return kF(a)}var d=eF(a);$APP.k(d,"trigger").addEventListener("click",c);document.addEventListener("keydown",b);$APP.ja(a,"__xCopyHandlers",{click:c,keydown:b})},nF=function(a){var b=$APP.k(a,"__xCopyTid");$APP.n(b)&&(clearTimeout(b),a.__xCopyTid=null);b=$APP.k(a,"__xCopyHandlers");var c=$APP.k(a,"__xCopyRefs");if($APP.n($APP.n(b)?c:b)){c=$APP.k(c,"trigger");var d=$APP.k(b,
|
|
15
|
+
"click");b=$APP.k(b,"keydown");$APP.n(d)&&c.removeEventListener("click",d);$APP.n(b)&&document.removeEventListener("keydown",b)}a.__xCopyHandlers=null},oF=function(a){var b=eF(a),c=a.hasAttribute("disabled");$APP.k(b,"trigger").disabled=$APP.F(c);$APP.n(c)?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled")},pF=function(a){for(var b=$APP.t(new $APP.O(null,7,5,$APP.P,[new $APP.O(null,2,5,$APP.P,["text","text"],null),new $APP.O(null,2,5,$APP.P,["from","from"],null),new $APP.O(null,
|
|
16
16
|
2,5,$APP.P,["fromAttr","from-attr"],null),new $APP.O(null,2,5,$APP.P,["mode","mode"],null),new $APP.O(null,2,5,$APP.P,["successMessage","success-message"],null),new $APP.O(null,2,5,$APP.P,["errorMessage","error-message"],null),new $APP.O(null,2,5,$APP.P,["hotkey","hotkey"],null)],null)),c=null,d=0,e=0;;)if(e<d){var g=c.F(null,e),h=$APP.Ac(g,0,null),l=$APP.Ac(g,1,null);Object.defineProperty(a,h,{get:function(q,v,x,y,A,C,E){return function(){return this.getAttribute(E)}}(b,c,d,e,g,h,l),set:function(q,
|
|
17
17
|
v,x,y,A,C,E){return function(H){return H==null?this.removeAttribute(E):this.setAttribute(E,""+$APP.T.g(H))}}(b,c,d,e,g,h,l),enumerable:!0,configurable:!0});e+=1}else if(h=$APP.t(b)){g=h;if($APP.Nc(g))b=$APP.yb(g),e=$APP.zb(g),c=b,d=$APP.z(b),b=e;else{l=$APP.u(g);var m=$APP.Ac(l,0,null),p=$APP.Ac(l,1,null);Object.defineProperty(a,m,{get:function(q,v,x,y,A,C,E){return function(){return this.getAttribute(E)}}(b,c,d,e,l,m,p,g,h),set:function(q,v,x,y,A,C,E){return function(H){return H==null?this.removeAttribute(E):
|
|
18
|
-
this.setAttribute(E,""+$APP.T.g(H))}}(b,c,d,e,l,m,p,g,h),enumerable:!0,configurable:!0});b=$APP.w(g);c=null;d=0}e=0}else break;Object.defineProperty(a,"disabled",{get:function(){return this.hasAttribute("disabled")},set:function(q){return $APP.n(q)?this.setAttribute("disabled",""):this.removeAttribute("disabled")},enumerable:!0,configurable:!0});Object.defineProperty(a,"showTooltip",{get:function(){return
|
|
19
|
-
"true"):this.setAttribute("show-tooltip","false")},enumerable:!0,configurable:!0});Object.defineProperty(a,"tooltipMs",{get:function(){return
|
|
20
|
-
configurable:!0});Object.defineProperty(a,"copy",{value:function(){return
|
|
21
|
-
customElements.define("x-copy",
|
|
22
|
-
"from-attr-raw","from-attr-raw",761657416)
|
|
23
|
-
$APP.zf([new $APP.K(null,"errorMessage","errorMessage",982744869),$APP.Pj,new $APP.K(null,"textValue","textValue",-598870870),$APP.wj,
|
|
24
|
-
"note","note",1426297904),"property-only override"],null),new $APP.
|
|
25
|
-
$APP.Y,$APP.Ik,"text"],null)]);$APP.Pd(["x-copy-request",new $APP.
|
|
18
|
+
this.setAttribute(E,""+$APP.T.g(H))}}(b,c,d,e,l,m,p,g,h),enumerable:!0,configurable:!0});b=$APP.w(g);c=null;d=0}e=0}else break;Object.defineProperty(a,"disabled",{get:function(){return this.hasAttribute("disabled")},set:function(q){return $APP.n(q)?this.setAttribute("disabled",""):this.removeAttribute("disabled")},enumerable:!0,configurable:!0});Object.defineProperty(a,"showTooltip",{get:function(){return NE(this.getAttribute("show-tooltip"))},set:function(q){return $APP.n(q)?this.setAttribute("show-tooltip",
|
|
19
|
+
"true"):this.setAttribute("show-tooltip","false")},enumerable:!0,configurable:!0});Object.defineProperty(a,"tooltipMs",{get:function(){return OE(this.getAttribute("tooltip-ms"))},set:function(q){return q==null?this.removeAttribute("tooltip-ms"):this.setAttribute("tooltip-ms",""+$APP.T.g(q|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"textValue",{get:function(){return $APP.k(this,"__xCopyTextValue")},set:function(q){this.__xCopyTextValue=typeof q==="string"?q:void 0},enumerable:!0,
|
|
20
|
+
configurable:!0});Object.defineProperty(a,"copy",{value:function(){return kF(this)},enumerable:!0,configurable:!0,writable:!0})},rF=function(){var a=class extends HTMLElement{};a.observedAttributes=qF;a.prototype.connectedCallback=function(){eF(this);nF(this);mF(this);oF(this);return null};a.prototype.disconnectedCallback=function(){nF(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.N(c,d)&&oF(this);return null};pF(a.prototype);return a},sF=function(){$APP.n(customElements.get("x-copy"))||
|
|
21
|
+
customElements.define("x-copy",rF());return null},XE=new $APP.K(null,"show-tooltip?","show-tooltip?",-1214081087),RE=new $APP.K(null,"tooltip-ms-raw","tooltip-ms-raw",-1973326401),bF=new $APP.K(null,"success-message","success-message",-96541601),TE=new $APP.K(null,"error-message-raw","error-message-raw",1910536231),ZE=new $APP.K(null,"hotkey","hotkey",-329017295),aF=new $APP.K(null,"error-message","error-message",1756021561),tF=new $APP.K(null,"fromAttr","fromAttr",-1768252533),UE=new $APP.K(null,
|
|
22
|
+
"from-attr-raw","from-attr-raw",761657416),$E=new $APP.K(null,"tooltip-ms","tooltip-ms",1062450417),VE=new $APP.K(null,"success-message-raw","success-message-raw",388691116),SE=new $APP.K(null,"from-raw","from-raw",-44462428),YE=new $APP.K(null,"from-attr","from-attr",1217901743),QE=new $APP.K(null,"hotkey-raw","hotkey-raw",1972404222),WE=new $APP.K(null,"show-tooltip-raw","show-tooltip-raw",453600717);var qF="text from from-attr mode disabled show-tooltip tooltip-ms success-message error-message hotkey".split(" ");
|
|
23
|
+
$APP.zf([new $APP.K(null,"errorMessage","errorMessage",982744869),$APP.Pj,new $APP.K(null,"textValue","textValue",-598870870),$APP.wj,tF,new $APP.K(null,"tooltipMs","tooltipMs",1056463375),ZE,$APP.Vh,new $APP.K(null,"showTooltip","showTooltip",482349691),new $APP.K(null,"successMessage","successMessage",-789572803),$APP.Cl],[new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"error-message"],null),new $APP.Q(null,2,[$APP.Z,$APP.Zj,$APP.Ik,"disabled"],null),new $APP.Q(null,3,[$APP.Z,$APP.Y,$APP.Ik,null,new $APP.K(null,
|
|
24
|
+
"note","note",1426297904),"property-only override"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"mode"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"from-attr"],null),new $APP.Q(null,2,[$APP.Z,$APP.W,$APP.Ik,"tooltip-ms"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"hotkey"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"from"],null),new $APP.Q(null,2,[$APP.Z,$APP.Zj,$APP.Ik,"show-tooltip"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"success-message"],null),new $APP.Q(null,2,[$APP.Z,
|
|
25
|
+
$APP.Y,$APP.Ik,"text"],null)]);$APP.Pd(["x-copy-request",new $APP.Q(null,2,[$APP.lm,!0,$APP.V,new $APP.Q(null,4,[$APP.Cl,$APP.Y,$APP.wj,$APP.Y,$APP.Vh,$APP.Y,tF,$APP.Y],null)],null),"x-copy-success",new $APP.Q(null,2,[$APP.lm,!1,$APP.V,new $APP.Q(null,1,[$APP.Cl,$APP.Y],null)],null),"x-copy-error",new $APP.Q(null,2,[$APP.lm,!1,$APP.V,new $APP.Q(null,1,[$APP.Ei,$APP.Y],null)],null)]);$APP.ha("baredom.exports.x_copy.init",sF);export const init=sF;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// x-currency-field.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
+
|
|
3
|
+
export function init(): void;
|
|
4
|
+
|
|
5
|
+
export interface XCurrencyFieldEventMap {
|
|
6
|
+
"x-currency-field-change-request": CustomEvent<{ name: string; value: string; previousValue: string }>;
|
|
7
|
+
"x-currency-field-input": CustomEvent<{ name: string; value: string }>;
|
|
8
|
+
"x-currency-field-change": CustomEvent<{ name: string; value: string }>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface XCurrencyField extends HTMLElement {
|
|
12
|
+
min: string;
|
|
13
|
+
placeholder: string;
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
locale: string;
|
|
16
|
+
name: string;
|
|
17
|
+
value: string;
|
|
18
|
+
hint: string;
|
|
19
|
+
currency: string;
|
|
20
|
+
readOnly: boolean;
|
|
21
|
+
max: string;
|
|
22
|
+
label: string;
|
|
23
|
+
error: string;
|
|
24
|
+
required: boolean;
|
|
25
|
+
|
|
26
|
+
addEventListener<K extends keyof XCurrencyFieldEventMap>(
|
|
27
|
+
type: K,
|
|
28
|
+
listener: (this: XCurrencyField, ev: XCurrencyFieldEventMap[K]) => any,
|
|
29
|
+
options?: boolean | AddEventListenerOptions
|
|
30
|
+
): void;
|
|
31
|
+
addEventListener(
|
|
32
|
+
type: string,
|
|
33
|
+
listener: EventListenerOrEventListenerObject,
|
|
34
|
+
options?: boolean | AddEventListenerOptions
|
|
35
|
+
): void;
|
|
36
|
+
removeEventListener<K extends keyof XCurrencyFieldEventMap>(
|
|
37
|
+
type: K,
|
|
38
|
+
listener: (this: XCurrencyField, ev: XCurrencyFieldEventMap[K]) => any,
|
|
39
|
+
options?: boolean | EventListenerOptions
|
|
40
|
+
): void;
|
|
41
|
+
removeEventListener(
|
|
42
|
+
type: string,
|
|
43
|
+
listener: EventListenerOrEventListenerObject,
|
|
44
|
+
options?: boolean | EventListenerOptions
|
|
45
|
+
): void;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
declare global {
|
|
49
|
+
interface HTMLElementTagNameMap {
|
|
50
|
+
"x-currency-field": XCurrencyField;
|
|
51
|
+
}
|
|
52
|
+
}
|
package/dist/x-currency-field.js
CHANGED
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
"")?void 0:b,{minimumFractionDigits:2,maximumFractionDigits:2})).format(c)}catch(d){return a}},
|
|
2
|
+
var pQ=function(a){a=(""+$APP.T.g($APP.n(a)?a:"")).trim().toUpperCase();return $APP.B.i(a,"")?"USD":a},qQ=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},rQ=function(a,b){try{var c=(new Intl.NumberFormat($APP.B.i(b,"")?"en-US":b,{style:"currency",currency:a})).formatToParts(0),d=$APP.Td(function(e){return $APP.B.i("currency",e.type)?e.value:null},$APP.uc(c));return $APP.n(d)?d:a}catch(e){return a}},sQ=function(a,b){var c=parseFloat(a);if($APP.n(isNaN(c)))return a;try{return(new Intl.NumberFormat($APP.B.i(b,
|
|
3
|
+
"")?void 0:b,{minimumFractionDigits:2,maximumFractionDigits:2})).format(c)}catch(d){return a}},tQ=function(a){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("label"),g=document.createElement("div"),h=document.createElement("span"),l=document.createElement("input"),m=document.createElement("span"),p=document.createElement("span");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
4
|
d.setAttribute("part","field");e.setAttribute("part","label");e.setAttribute("id","label");e.setAttribute("for","input");g.setAttribute("part","input-wrapper");h.setAttribute("part","symbol");h.setAttribute("aria-hidden","true");l.setAttribute("part","input");l.setAttribute("id","input");l.setAttribute("inputmode","decimal");l.setAttribute("aria-labelledby","label");m.setAttribute("part","hint");m.setAttribute("id","hint");m.setAttribute("aria-live","polite");p.setAttribute("part","error");p.setAttribute("id",
|
|
5
|
-
"error");p.setAttribute("role","alert");p.setAttribute("aria-live","assertive");g.appendChild(h);g.appendChild(l);d.appendChild(e);d.appendChild(g);d.appendChild(m);d.appendChild(p);b.appendChild(c);b.appendChild(d);a.__xCurrencyFieldRefs={field:d,label:e,wrapper:g,symbol:h,input:l,hint:m,error:p}},
|
|
5
|
+
"error");p.setAttribute("role","alert");p.setAttribute("aria-live","assertive");g.appendChild(h);g.appendChild(l);d.appendChild(e);d.appendChild(g);d.appendChild(m);d.appendChild(p);b.appendChild(c);b.appendChild(d);a.__xCurrencyFieldRefs={field:d,label:e,wrapper:g,symbol:h,input:l,hint:m,error:p}},uQ=function(a,b,c,d){var e=a.hasAttribute("error");var g=a.getAttribute("error");g=$APP.n(g)?g:"";var h=a.hasAttribute("required"),l=a.getAttribute("min"),m=a.getAttribute("max");a=parseFloat(d);var p=
|
|
6
6
|
$APP.r(isNaN(a));l=$APP.n(l)?parseFloat(l):null;m=$APP.n(m)?parseFloat(m):null;return $APP.n(e)?b.setValidity({customError:!0},g,c):$APP.n($APP.n(h)?$APP.B.i(d,""):h)?b.setValidity({valueMissing:!0},"Please fill in this field.",c):$APP.N(d,"")&&!p?b.setValidity({badInput:!0},"Please enter a valid number.",c):$APP.n(p?$APP.n(l)?$APP.r(isNaN(l))&&a<l:l:p)?b.setValidity({rangeUnderflow:!0},"Value must be at least "+$APP.T.g(l)+".",c):$APP.n(p?$APP.n(m)?$APP.r(isNaN(m))&&a>m:m:p)?b.setValidity({rangeOverflow:!0},
|
|
7
|
-
"Value must be at most "+$APP.T.g(m)+".",c):b.setValidity({},"",c)},
|
|
8
|
-
a.hasAttribute("required"),a.getAttribute("max"),a.hasAttribute("readonly"),a.getAttribute("value"),a.getAttribute("locale"),a.getAttribute("placeholder")]);var l=$APP.M(h);h=$APP.D(l,$APP.Pi);var m=$APP.D(l,$APP.pi),p=$APP.D(l,
|
|
9
|
-
$APP.
|
|
10
|
-
"")?parseFloat(q):null,C=$APP.N(v,"")?parseFloat(v):null,p=$APP.N(p,"")&&!y?"Please enter a valid number.":$APP.n(y?$APP.n(A)?$APP.r(isNaN(A))&&x<A:A:y)?"Value must be at least "+$APP.T.g(q)+".":$APP.n(y?$APP.n(C)?$APP.r(isNaN(C))&&x>C:C:y)?"Value must be at most "+$APP.T.g(v)+".":"");q=p;p=$APP.n(m)?m:$APP.N($APP.n(q)?q:"","");m=$APP.n(m)?$APP.Ei.g(h):$APP.n(q)?q:"";q=$APP.ui.g(h);v=$APP.
|
|
11
|
-
$APP.X.g(h);e.readOnly=$APP.
|
|
12
|
-
c.classList.add("label-hidden");g.textContent=$APP.
|
|
13
|
-
$APP.k(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.k(b,"input");var c=a.getAttribute("value");return b.value=$APP.n(c)?c:""}return null}},
|
|
14
|
-
$APP.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
this.getAttribute(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
7
|
+
"Value must be at most "+$APP.T.g(m)+".",c):b.setValidity({},"",c)},zQ=function(a){var b=$APP.k(a,"__xCurrencyFieldRefs");if($APP.n(b)){var c=$APP.k(b,"label"),d=$APP.k(b,"symbol"),e=$APP.k(b,"input"),g=$APP.k(b,"hint");b=$APP.k(b,"error");var h=$APP.zf([$APP.pi,vQ,$APP.Al,$APP.Ji,$APP.$i,$APP.Ol,wQ,$APP.Nh,$APP.$k,$APP.Lj,$APP.Em,xQ,$APP.Pi],[a.getAttribute("label"),a.getAttribute("currency"),a.getAttribute("name"),a.getAttribute("error"),a.getAttribute("hint"),a.hasAttribute("disabled"),a.getAttribute("min"),
|
|
8
|
+
a.hasAttribute("required"),a.getAttribute("max"),a.hasAttribute("readonly"),a.getAttribute("value"),a.getAttribute("locale"),a.getAttribute("placeholder")]);var l=$APP.M(h);h=$APP.D(l,$APP.Pi);var m=$APP.D(l,$APP.pi),p=$APP.D(l,vQ),q=$APP.D(l,$APP.Al),v=$APP.D(l,$APP.Ji),x=$APP.D(l,$APP.$i),y=$APP.D(l,$APP.Ol),A=$APP.D(l,wQ),C=$APP.D(l,$APP.Nh),E=$APP.D(l,$APP.$k),H=$APP.D(l,$APP.Lj),G=$APP.D(l,$APP.Em);l=$APP.D(l,xQ);var J=$APP.n(v)?v:"",R=$APP.n(x)?x:"",aa=$APP.n(m)?m:"";h=$APP.zf([$APP.jk,$APP.mi,
|
|
9
|
+
$APP.dn,$APP.sm,$APP.ui,$APP.en,$APP.Aj,$APP.Yi,$APP.Dl,$APP.al,$APP.Zl,yQ,$APP.Wk,$APP.U,$APP.Ei,$APP.X],[$APP.n(A)?A:"",$APP.F(C),$APP.F(H),$APP.n(h)?h:"",typeof x==="string"&&$APP.N(x,""),$APP.n(l)?l:"",$APP.n(q)?q:"",$APP.n(G)?G:"",typeof m==="string"&&$APP.N(m,""),typeof v==="string"&&$APP.N(v,""),R,pQ(p),$APP.n(E)?E:"",aa,J,$APP.F(y)]);m=$APP.al.g(h);$APP.n(m)?p=null:(v=$APP.M(h),p=$APP.D(v,$APP.Yi),q=$APP.D(v,$APP.jk),v=$APP.D(v,$APP.Wk),x=parseFloat(p),y=$APP.N(p,"")&&$APP.r(isNaN(x)),A=$APP.N(q,
|
|
10
|
+
"")?parseFloat(q):null,C=$APP.N(v,"")?parseFloat(v):null,p=$APP.N(p,"")&&!y?"Please enter a valid number.":$APP.n(y?$APP.n(A)?$APP.r(isNaN(A))&&x<A:A:y)?"Value must be at least "+$APP.T.g(q)+".":$APP.n(y?$APP.n(C)?$APP.r(isNaN(C))&&x>C:C:y)?"Value must be at most "+$APP.T.g(v)+".":"");q=p;p=$APP.n(m)?m:$APP.N($APP.n(q)?q:"","");m=$APP.n(m)?$APP.Ei.g(h):$APP.n(q)?q:"";q=$APP.ui.g(h);v=$APP.Dl.g(h);y=yQ.g(h);x=$APP.en.g(h);d.textContent=rQ(y,x);e.name=$APP.Aj.g(h);e.placeholder=$APP.sm.g(h);e.disabled=
|
|
11
|
+
$APP.X.g(h);e.readOnly=$APP.dn.g(h);e.required=$APP.mi.g(h);d=$APP.n($APP.mi.g(h))?"true":"false";e.setAttribute("aria-required",d);e.setAttribute("aria-invalid",$APP.n(p)?"true":"false");d=$APP.n($APP.n(q)?p:q)?"hint error":$APP.n(q)?"hint":$APP.n(p)?"error":null;$APP.n(d)?e.setAttribute("aria-describedby",d):e.removeAttribute("aria-describedby");$APP.B.i(e,a.shadowRoot.activeElement)||(d=$APP.Yi.g(h),e.value=$APP.B.i(d,"")?"":sQ(d,x));c.textContent=$APP.U.g(h);$APP.n(v)?c.classList.remove("label-hidden"):
|
|
12
|
+
c.classList.add("label-hidden");g.textContent=$APP.Zl.g(h);$APP.n(q)?g.classList.remove("hint-hidden"):g.classList.add("hint-hidden");b.textContent=m;$APP.n(p)?b.classList.remove("error-hidden"):b.classList.add("error-hidden");qQ(a,"data-invalid",p);c=$APP.k(a,"__xCurrencyFieldInternals");$APP.n(c)?(g=a.getAttribute("value"),a=uQ(a,c,e,$APP.n(g)?g:"")):a=null;return a}return null},AQ=function(a,b,c){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:!1}))},BQ=function(a,
|
|
13
|
+
b){b=new CustomEvent("x-currency-field-change-request",{detail:b,bubbles:!0,composed:!0,cancelable:!0});a.dispatchEvent(b);return $APP.r(b.defaultPrevented)},CQ=function(a){return function(){var b=$APP.k(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.k(b,"input");var c=a.getAttribute("value");return b.value=$APP.n(c)?c:""}return null}},DQ=function(a){return function(){var b=$APP.k(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.k(b,"input");var c=b.value,d=function(){var g=a.getAttribute("value");
|
|
14
|
+
return $APP.n(g)?g:""}(),e=function(){var g=a.getAttribute("name");return $APP.n(g)?g:""}();return BQ(a,{name:e,value:c,previousValue:d})?(d=$APP.k(a,"__xCurrencyFieldInternals"),$APP.n(d)&&(d.setFormValue(c),uQ(a,d,b,c)),AQ(a,"x-currency-field-input",{name:e,value:c})):b.value=d}return null}},EQ=function(a){return function(){var b=$APP.k(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.k(b,"input");var c=b.value,d=parseFloat(c);c=$APP.n(isNaN(d))?c:""+$APP.T.g(d);var e=function(){var g=a.getAttribute("value");
|
|
15
|
+
return $APP.n(g)?g:""}();d=function(){var g=a.getAttribute("name");return $APP.n(g)?g:""}();return BQ(a,{name:d,value:c,previousValue:e})?(a.setAttribute("value",c),e=$APP.k(a,"__xCurrencyFieldInternals"),$APP.n(e)&&(e.setFormValue(c),uQ(a,e,b,c)),AQ(a,"x-currency-field-change",{name:d,value:c})):b.value=e}return null}},FQ=function(a){var b=$APP.k(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.k(b,"input");var c=CQ(a),d=DQ(a),e=EQ(a);b.addEventListener("focus",c);b.addEventListener("input",d);b.addEventListener("change",
|
|
16
|
+
e);a.__xCurrencyFieldHandlers={focus:c,input:d,change:e}}},GQ=function(a){var b=$APP.k(a,"__xCurrencyFieldRefs");if($APP.n(b)){var c=$APP.k(a,"__xCurrencyFieldHandlers");if($APP.n(c)){b=$APP.k(b,"input");b.removeEventListener("focus",$APP.k(c,"focus"));b.removeEventListener("input",$APP.k(c,"input"));b.removeEventListener("change",$APP.k(c,"change"));a.__xCurrencyFieldHandlers=null;return}}return null},HQ=function(a){$APP.n($APP.k(a,"__xCurrencyFieldRefs"))||(tQ(a),$APP.n(a.attachInternals)&&$APP.ja(a,
|
|
17
|
+
"__xCurrencyFieldInternals",a.attachInternals()));GQ(a);var b=$APP.k(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.k(b,"input");var c=a.getAttribute("value");pQ(a.getAttribute("currency"));var d=function(){var e=a.getAttribute("locale");return $APP.n(e)?e:""}();$APP.n(c)&&(b.value=sQ(c,d))}b=$APP.k(a,"__xCurrencyFieldInternals");$APP.n(b)&&b.setFormValue(function(){var e=a.getAttribute("value");return $APP.n(e)?e:""}());FQ(a);return zQ(a)},IQ=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,
|
|
18
|
+
enumerable:!0,get:function(){var d=this.getAttribute(c);return $APP.n(d)?d:""},set:function(d){d!=null&&$APP.N(d)?(d=""+$APP.T.g(d),d=this.setAttribute(c,d)):d=this.removeAttribute(c);return d}})},JQ=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return qQ(this,c,$APP.F(d))}})},KQ=function(a){Object.defineProperty(a,"value",{configurable:!0,enumerable:!0,get:function(){var b=this.getAttribute("value");return $APP.n(b)?
|
|
19
|
+
b:""},set:function(b){b=b!=null&&$APP.N(b)?""+$APP.T.g(b):"";this.setAttribute("value",b);var c=$APP.k(this,"__xCurrencyFieldRefs");if($APP.n(c)){c=$APP.k(c,"input");pQ(this.getAttribute("currency"));var d=this.getAttribute("locale");d=$APP.n(d)?d:"";return $APP.B.i(c,this.shadowRoot.activeElement)?null:c.value=$APP.B.i(b,"")?"":sQ(b,d)}return null}})},MQ=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=!0;a.observedAttributes=LQ;KQ(b);IQ(b,"name","name");IQ(b,"currency",
|
|
20
|
+
"currency");IQ(b,"locale","locale");IQ(b,"min","min");IQ(b,"max","max");IQ(b,"placeholder","placeholder");IQ(b,"label","label");IQ(b,"hint","hint");IQ(b,"error","error");JQ(b,"disabled","disabled");JQ(b,"readOnly","readonly");JQ(b,"required","required");b.connectedCallback=function(){return HQ(this)};b.disconnectedCallback=function(){return GQ(this)};b.attributeChangedCallback=function(c,d,e){$APP.B.i(c,"value")&&(c=$APP.k(this,"__xCurrencyFieldRefs"),$APP.n(c)&&(c=$APP.k(c,"input"),$APP.B.i(c,this.shadowRoot.activeElement)||
|
|
21
|
+
(pQ(this.getAttribute("currency")),d=this.getAttribute("locale"),d=$APP.n(d)?d:"",c.value=e==null||$APP.B.i(e,"")?"":sQ(e,d))));return zQ(this)};b.formDisabledCallback=function(c){qQ(this,"disabled",$APP.F(c));return zQ(this)};b.formResetCallback=function(){this.removeAttribute("value");var c=$APP.k(this,"__xCurrencyFieldRefs");$APP.n(c)&&($APP.k(c,"input").value="");c=$APP.k(this,"__xCurrencyFieldInternals");$APP.n(c)&&c.setFormValue("");return zQ(this)};b.checkValidity=function(){var c=$APP.k(this,
|
|
22
|
+
"__xCurrencyFieldInternals");return $APP.n(c)?c.checkValidity():!0};b.reportValidity=function(){var c=$APP.k(this,"__xCurrencyFieldInternals");return $APP.n(c)?c.reportValidity():!0};return a},NQ=function(){return $APP.n(customElements.get("x-currency-field"))?null:customElements.define("x-currency-field",MQ())},wQ=new $APP.K(null,"min-raw","min-raw",183137548),yQ=new $APP.K(null,"currency","currency",-898327568),xQ=new $APP.K(null,"locale-raw","locale-raw",385401846),vQ=new $APP.K(null,"currency-raw",
|
|
23
|
+
"currency-raw",1169887491);var LQ="name value currency locale min max placeholder label hint error disabled required readonly".split(" ");
|
|
24
|
+
$APP.zf([$APP.jk,$APP.sm,$APP.Pj,$APP.en,$APP.Aj,$APP.Yi,$APP.Zl,yQ,$APP.nm,$APP.Wk,$APP.U,$APP.Ei,$APP.Dk],[new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"min"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"placeholder"],null),new $APP.Q(null,2,[$APP.Z,$APP.Zj,$APP.Ik,"disabled"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"locale"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"name"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"value"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"hint"],
|
|
25
|
+
null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"currency"],null),new $APP.Q(null,2,[$APP.Z,$APP.Zj,$APP.Ik,"readonly"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"max"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"label"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"error"],null),new $APP.Q(null,2,[$APP.Z,$APP.Zj,$APP.Ik,"required"],null)]);
|
|
26
|
+
$APP.Pd(["x-currency-field-change-request",new $APP.Q(null,2,[$APP.lm,!0,$APP.V,new $APP.Q(null,3,[$APP.Aj,$APP.Y,$APP.Yi,$APP.Y,$APP.Tk,$APP.Y],null)],null),"x-currency-field-input",new $APP.Q(null,2,[$APP.lm,!1,$APP.V,new $APP.Q(null,2,[$APP.Aj,$APP.Y,$APP.Yi,$APP.Y],null)],null),"x-currency-field-change",new $APP.Q(null,2,[$APP.lm,!1,$APP.V,new $APP.Q(null,2,[$APP.Aj,$APP.Y,$APP.Yi,$APP.Y],null)],null)]);$APP.ha("baredom.exports.x_currency_field.init",NQ);export const init=NQ;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// x-date-picker.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
+
|
|
3
|
+
export function init(): void;
|
|
4
|
+
|
|
5
|
+
export interface XDatePicker extends HTMLElement {
|
|
6
|
+
mode: string;
|
|
7
|
+
value: string;
|
|
8
|
+
start: string;
|
|
9
|
+
end: string;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
readOnly: boolean;
|
|
12
|
+
required: boolean;
|
|
13
|
+
open: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare global {
|
|
17
|
+
interface HTMLElementTagNameMap {
|
|
18
|
+
"x-date-picker": XDatePicker;
|
|
19
|
+
}
|
|
20
|
+
}
|
package/dist/x-date-picker.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
if(a==null)return-1;if(b==null)return 1;a=a.getTime();b=b.getTime();return a<b?-1:a>b?1:0}
|
|
4
|
-
|
|
5
|
-
2,[
|
|
6
|
-
$APP.
|
|
7
|
-
return new $APP.
|
|
8
|
-
b,a.getAttribute("start"),a.getAttribute("max"),$APP.Kg(a.getAttribute("auto-swap")),a.getAttribute("end"),a.getAttribute("separator")]));var c=new $APP.
|
|
9
|
-
|
|
10
|
-
l}(),
|
|
11
|
-
$APP.n(c)&&c.setAttribute("tabindex","-1");b=a.querySelector('[data-iso\x3d"'+$APP.T.g(b)+'"]');if($APP.n(b))return b.setAttribute("tabindex","0"),b.focus()}return null},
|
|
12
|
-
g:"default",{year:"numeric",month:"long",timeZone:"UTC"})).format(h),c.textContent=h);if(!$APP.n($APP.k(a,"__xDatePickerWeekdaysDone")))for(a.__xDatePickerWeekdaysDone=!0,c="Su Mo Tu We Th Fr Sa".split(" "),h=0;;)if(h<7)g=
|
|
13
|
-
g){e=h.F(null,l);e=$APP.M(e);var m=$APP.D(e,
|
|
14
|
-
$APP.n(A)?"true":"false");p.setAttribute("data-range-edge",$APP.n(y)?"true":"false");p.setAttribute("aria-selected",$APP.n(m)?"true":"false");p.setAttribute("aria-disabled",$APP.n(x)?"true":"false");p.setAttribute("tabindex","-1");p.textContent=""+$APP.T.g(v);d.appendChild(p);l+=1}else if(e=$APP.t(c))c=e,$APP.Nc(c)?(h=$APP.yb(c),c=$APP.zb(c),e=h,g=$APP.z(h),h=e):(e=$APP.u(c),e=$APP.M(e),m=$APP.D(e,
|
|
15
|
-
$APP.cj),q=$APP.D(v,
|
|
16
|
-
h.setAttribute("aria-disabled",$APP.n(p)?"true":"false"),h.setAttribute("tabindex","-1"),h.textContent=""+$APP.T.g(l),d.appendChild(h),c=$APP.w(c),h=null,g=0),l=0;else break;d=$APP.k(a,"__xDatePickerGridFocus");a=$APP.k(a,"__xDatePickerRefs");a=$APP.n(a)?$APP.k(a,"grid"):null;$APP.n($APP.n(a)?d:a)?(a=a.querySelector('[data-iso\x3d"'+$APP.T.g(d)+'"]'),a=$APP.n(a)?a.setAttribute("tabindex","0"):null):a=null;return a}}return null},
|
|
17
|
-
"input"):null;var c=$APP.k(a,"__xDatePickerState");c=$APP.n(c)?$APP.k(c,"disp"):null;a=$APP.k(a,"__xDatePickerFocused");return $APP.n($APP.n(b)?$APP.r(a):b)?b.value=$APP.n(c)?c:"":null},
|
|
2
|
+
var VV=function(a){return typeof a==="string"?(a=a.trim(),$APP.N(a,"")?a:null):null},WV=function(a){return a<10?"0"+$APP.T.g(a):""+$APP.T.g(a)},XV=function(a){return $APP.n(a)?""+$APP.T.g(a.getUTCFullYear())+"-"+$APP.T.g(WV(a.getUTCMonth()+1))+"-"+$APP.T.g(WV(a.getUTCDate())):null},YV=function(a){var b=(b=typeof a==="string")?$APP.eg(/\d{4}-\d{2}-\d{2}/,a):b;return $APP.n(b)?(a=new Date(""+$APP.T.g(a)+"T00:00:00.000Z"),$APP.n(isNaN(a.getTime()))?null:a):null},ZV=function(a,b){if(a==null&&b==null)return 0;
|
|
3
|
+
if(a==null)return-1;if(b==null)return 1;a=a.getTime();b=b.getTime();return a<b?-1:a>b?1:0},$V=function(a,b){return $APP.n(a)?new Date(a.getTime()+b*864E5):null},aW=function(a){return $APP.n(a)?new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1)):null},bW=function(a,b){if($APP.n(a)){var c=a.getUTCFullYear(),d=a.getUTCDate();a=a.getUTCMonth()+b;b=(new Date(Date.UTC(c,a+1,0))).getUTCDate();return new Date(Date.UTC(c,a,$APP.ph.i(d,b)))}return null},cW=function(a,b,c){a=$APP.n($APP.n(b)?$APP.n(a)?
|
|
4
|
+
ZV(a,b)<0:a:b)?b:a;return $APP.n($APP.n(c)?$APP.n(a)?ZV(a,c)>0:a:c)?c:a},dW=function(a,b,c){if($APP.n($APP.n(a)?$APP.n(b)?c:b:a)){var d=ZV(b,c)<0?c:b;return!(ZV(a,ZV(b,c)<0?b:c)<0)&&!(ZV(a,d)>0)}return null},gW=function(a,b){var c=$APP.M(b);b=$APP.D(c,eW);c=$APP.D(c,$APP.en);return $APP.n(a)?$APP.B.i(b,fW)?(new Intl.DateTimeFormat($APP.n(c)?c:"default",{year:"numeric",month:"long",day:"numeric",timeZone:"UTC"})).format(a):XV(a):null},jW=function(a){a=VV(a);a=$APP.n(a)?YV(a):null;return new $APP.Q(null,
|
|
5
|
+
2,[hW,a!=null,iW,a],null)},yW=function(a){var b=$APP.M(a),c=$APP.D(b,$APP.Li),d=$APP.D(b,$APP.el),e=$APP.D(b,$APP.jk);a=$APP.D(b,eW);var g=$APP.D(b,$APP.en),h=$APP.D(b,kW),l=$APP.D(b,$APP.Yi),m=$APP.D(b,$APP.wj),p=$APP.D(b,$APP.mm),q=$APP.D(b,$APP.Wk),v=$APP.D(b,lW);b=$APP.B.i(m,"range")?mW:nW;a=$APP.B.i(a,"localized")?fW:oW;g=VV(g);m=function(){var A=VV(d);return $APP.n(A)?A:" - "}();e=YV(e);q=YV(q);v=$APP.F(v);h=$APP.F(h);if($APP.B.i(b,nW))return b=YV(l),$APP.zf([eW,pW,$APP.en,qW,$APP.wj,rW,lW,
|
|
6
|
+
$APP.ll,$APP.el,sW,tW],[a,b,g,h,nW,q,v,b!=null,m,e,function(){var A=VV(l);return $APP.n(A)?A:""}()]);var x=YV(p),y=YV(c);b=x!=null&&y!=null;return $APP.zf([uW,eW,vW,$APP.en,qW,$APP.wj,rW,wW,xW,lW,$APP.ll,$APP.el,sW],[function(){var A=VV(c);return $APP.n(A)?A:""}(),a,x,g,h,mW,q,function(){var A=VV(p);return $APP.n(A)?A:""}(),y,v,b,m,e])},AW=function(a){if($APP.n(a)){var b=aW(a),c=$V(b,-($APP.n(b)?b.getUTCDay():0));return $APP.ge(function(d){d=$V(c,d);var e=$APP.B.i(d.getUTCMonth(),a.getUTCMonth());
|
|
7
|
+
return new $APP.Q(null,2,[iW,d,zW,e],null)},$APP.dg(0,42))}return null},BW=function(a){return document.createElement(a)},CW=function(a,b,c,d){b=new CustomEvent(b,{detail:d,bubbles:!0,composed:!0,cancelable:$APP.F(c)});a.dispatchEvent(b);return b},DW=function(a){var b=a.getAttribute("mode");b=yW($APP.zf([$APP.jk,eW,$APP.en,kW,$APP.Yi,$APP.wj,$APP.mm,$APP.Wk,lW,$APP.Li,$APP.el],[a.getAttribute("min"),a.getAttribute("format"),a.getAttribute("locale"),$APP.Kg(a.getAttribute("range-allow-same-day")),a.getAttribute("value"),
|
|
8
|
+
b,a.getAttribute("start"),a.getAttribute("max"),$APP.Kg(a.getAttribute("auto-swap")),a.getAttribute("end"),a.getAttribute("separator")]));var c=new $APP.Q(null,2,[eW,eW.g(b),$APP.en,$APP.en.g(b)],null);var d=$APP.M(c);var e=$APP.D(d,eW);d=$APP.D(d,$APP.en);e=new $APP.Q(null,2,[eW,e,$APP.en,d],null);if($APP.B.i($APP.wj.g(b),nW))e=$APP.n(pW.g(b))?gW(pW.g(b),e):"";else{d=$APP.el.g(b);var g=vW.g(b);g=$APP.n(g)?xW.g(b):g;e=$APP.n(g)?""+$APP.T.g(gW(vW.g(b),e))+$APP.T.g(d)+$APP.T.g(gW(xW.g(b),e)):$APP.n(vW.g(b))?
|
|
9
|
+
gW(vW.g(b),e):""}d=$APP.k(a,"__xDatePickerState");d=$APP.n(d)?$APP.k(d,"month"):null;g=pW.g(b);$APP.n(g)||(g=vW.g(b),g=$APP.n(g)?g:new Date(Date.now()));d=$APP.n(d)?d:aW(g);a.__xDatePickerState={canon:b,cfg:c,disp:e,month:d}},EW=function(a,b){var c=sW.g(b);c=$APP.n(c)?ZV(a,sW.g(b))<0:c;if($APP.n(c))return c;c=rW.g(b);return $APP.n(c)?ZV(a,rW.g(b))>0:c},HW=function(a,b){if($APP.B.i($APP.wj.g(b),nW))return new $APP.Q(null,3,[$APP.cj,function(){var l=pW.g(b);return $APP.n(l)?$APP.B.i(0,ZV(a,pW.g(b))):
|
|
10
|
+
l}(),FW,!1,GW,!1],null);var c=vW.g(b),d=xW.g(b),e=function(){var l=$APP.n(c)?$APP.B.i(0,ZV(a,c)):c;return $APP.n(l)?l:$APP.n(d)?$APP.B.i(0,ZV(a,d)):d}(),g=$APP.n(c)?$APP.n(d)?dW(a,c,d):d:c,h=function(){var l=$APP.n(c)?$APP.B.i(0,ZV(a,c)):c;return $APP.n(l)?l:$APP.n(d)?$APP.B.i(0,ZV(a,d)):d}();return new $APP.Q(null,3,[$APP.cj,e,FW,g,GW,h],null)},IW=function(a,b){a.__xDatePickerGridFocus=b;a=$APP.k(a,"__xDatePickerRefs");a=$APP.n(a)?$APP.k(a,"grid"):null;if($APP.n(a)){var c=a.querySelector('[tabindex\x3d"0"]');
|
|
11
|
+
$APP.n(c)&&c.setAttribute("tabindex","-1");b=a.querySelector('[data-iso\x3d"'+$APP.T.g(b)+'"]');if($APP.n(b))return b.setAttribute("tabindex","0"),b.focus()}return null},JW=function(a){var b=$APP.k(a,"__xDatePickerRefs");if($APP.n(b)){var c=$APP.k(b,"month-label"),d=$APP.k(b,"grid"),e=$APP.k(b,"weekdays"),g=$APP.k(a,"__xDatePickerState");b=$APP.n(g)?$APP.k(g,"canon"):null;var h=$APP.n(g)?$APP.k(g,"month"):null;g=$APP.n(g)?$APP.k(g,"cfg"):null;g=$APP.n(g)?$APP.en.g(g):null;$APP.n(c)&&(h=(new Intl.DateTimeFormat($APP.n(g)?
|
|
12
|
+
g:"default",{year:"numeric",month:"long",timeZone:"UTC"})).format(h),c.textContent=h);if(!$APP.n($APP.k(a,"__xDatePickerWeekdaysDone")))for(a.__xDatePickerWeekdaysDone=!0,c="Su Mo Tu We Th Fr Sa".split(" "),h=0;;)if(h<7)g=BW("div"),g.setAttribute("part","weekday"),g.setAttribute("aria-hidden","true"),g.textContent=c[h],e.appendChild(g),h+=1;else break;if($APP.n($APP.n(d)?b:d)){d.textContent="";e=$APP.k(a,"__xDatePickerState");e=AW($APP.n(e)?$APP.k(e,"month"):null);c=$APP.t(e);h=null;for(var l=g=0;;)if(l<
|
|
13
|
+
g){e=h.F(null,l);e=$APP.M(e);var m=$APP.D(e,iW);e=$APP.D(e,zW);var p=BW("button"),q=XV(m),v=m.getUTCDate(),x=EW(m,b);m=HW(m,b);var y=$APP.M(m);m=$APP.D(y,$APP.cj);var A=$APP.D(y,FW);y=$APP.D(y,GW);p.setAttribute("part","day");p.setAttribute("type","button");p.setAttribute("role","gridcell");p.setAttribute("data-iso",q);p.setAttribute("data-outside",$APP.n(e)?"false":"true");p.setAttribute("data-disabled",$APP.n(x)?"true":"false");p.setAttribute("data-selected",$APP.n(m)?"true":"false");p.setAttribute("data-in-range",
|
|
14
|
+
$APP.n(A)?"true":"false");p.setAttribute("data-range-edge",$APP.n(y)?"true":"false");p.setAttribute("aria-selected",$APP.n(m)?"true":"false");p.setAttribute("aria-disabled",$APP.n(x)?"true":"false");p.setAttribute("tabindex","-1");p.textContent=""+$APP.T.g(v);d.appendChild(p);l+=1}else if(e=$APP.t(c))c=e,$APP.Nc(c)?(h=$APP.yb(c),c=$APP.zb(c),e=h,g=$APP.z(h),h=e):(e=$APP.u(c),e=$APP.M(e),m=$APP.D(e,iW),e=$APP.D(e,zW),h=BW("button"),g=XV(m),l=m.getUTCDate(),p=EW(m,b),m=HW(m,b),v=$APP.M(m),m=$APP.D(v,
|
|
15
|
+
$APP.cj),q=$APP.D(v,FW),v=$APP.D(v,GW),h.setAttribute("part","day"),h.setAttribute("type","button"),h.setAttribute("role","gridcell"),h.setAttribute("data-iso",g),h.setAttribute("data-outside",$APP.n(e)?"false":"true"),h.setAttribute("data-disabled",$APP.n(p)?"true":"false"),h.setAttribute("data-selected",$APP.n(m)?"true":"false"),h.setAttribute("data-in-range",$APP.n(q)?"true":"false"),h.setAttribute("data-range-edge",$APP.n(v)?"true":"false"),h.setAttribute("aria-selected",$APP.n(m)?"true":"false"),
|
|
16
|
+
h.setAttribute("aria-disabled",$APP.n(p)?"true":"false"),h.setAttribute("tabindex","-1"),h.textContent=""+$APP.T.g(l),d.appendChild(h),c=$APP.w(c),h=null,g=0),l=0;else break;d=$APP.k(a,"__xDatePickerGridFocus");a=$APP.k(a,"__xDatePickerRefs");a=$APP.n(a)?$APP.k(a,"grid"):null;$APP.n($APP.n(a)?d:a)?(a=a.querySelector('[data-iso\x3d"'+$APP.T.g(d)+'"]'),a=$APP.n(a)?a.setAttribute("tabindex","0"):null):a=null;return a}}return null},KW=function(a){var b=$APP.k(a,"__xDatePickerRefs");b=$APP.n(b)?$APP.k(b,
|
|
17
|
+
"input"):null;var c=$APP.k(a,"__xDatePickerState");c=$APP.n(c)?$APP.k(c,"disp"):null;a=$APP.k(a,"__xDatePickerFocused");return $APP.n($APP.n(b)?$APP.r(a):b)?b.value=$APP.n(c)?c:"":null},LW=function(a){var b=$APP.k(a,"__xDatePickerRefs");if($APP.n(b)){var c=$APP.k(b,"input");b=$APP.k(b,"btn");var d=a.hasAttribute("disabled"),e=a.hasAttribute("readonly"),g=a.getAttribute("placeholder"),h=a.getAttribute("aria-label"),l=a.getAttribute("aria-describedby"),m=a.hasAttribute("open");$APP.n(b)&&($APP.n(d)?
|
|
18
18
|
b.setAttribute("disabled",""):b.removeAttribute("disabled"));$APP.n($APP.n(d)?m:d)&&a.removeAttribute("open");$APP.n(c)&&(c.setAttribute("aria-expanded",$APP.n(m)?"true":"false"),$APP.n(d)?(c.setAttribute("disabled",""),c.setAttribute("aria-disabled","true")):(c.removeAttribute("disabled"),c.removeAttribute("aria-disabled")),$APP.n(e)&&c.setAttribute("readonly",""),$APP.n(e)||c.removeAttribute("readonly"),$APP.n(g)&&c.setAttribute("placeholder",g),$APP.n(h)&&c.setAttribute("aria-label",h),$APP.n(l)&&
|
|
19
|
-
c.setAttribute("aria-describedby",l));
|
|
20
|
-
if($APP.B.i(e,
|
|
21
|
-
|
|
22
|
-
null;var v=$APP.n(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
g);a.__xDatePickerRangeStep=0;
|
|
26
|
-
b=b.currentTarget.getAttribute("data-nav");return $APP.B.i(b,"prev")?
|
|
27
|
-
7);case "PageUp":return
|
|
28
|
-
e:m}())?(b.preventDefault(),$APP.n(
|
|
29
|
-
G=null:(G=G.target.closest("button[data-iso]"),$APP.n($APP.n(G)?$APP.N("true",G.getAttribute("data-disabled")):G)?(G=G.getAttribute("data-iso"),G=
|
|
30
|
-
"canon"):null;var J=
|
|
31
|
-
"input"):null;var J=$APP.k(a,"__xDatePickerState");J=$APP.B.i($APP.wj.g($APP.n(J)?$APP.k(J,"canon"):null),
|
|
32
|
-
y.addEventListener("blur",m);A.addEventListener("click",l);C.addEventListener("click",h);E.addEventListener("click",g);H.addEventListener("click",e);H.addEventListener("keydown",d);x.addEventListener("pointerdown",c);document.addEventListener("pointerdown",b,!0);$APP.ja(a,"__xDatePickerHandlers",{"pop-md":c,keydown:q,grid:e,"grid-kd":d,next:g,blur:m,prev:h,focus:p,input:v,btn:l,"doc-click":b})},
|
|
19
|
+
c.setAttribute("aria-describedby",l));KW(a);return JW(a)}return null},MW=function(a,b){$APP.n(b)?a.setAttribute("value",XV(b)):a.removeAttribute("value")},NW=function(a,b,c){if($APP.n(a.hasAttribute("readonly")))return null;var d=$APP.k(a,"__xDatePickerState");d=$APP.n(d)?$APP.k(d,"canon"):null;var e=$APP.n(d)?$APP.wj.g(d):null,g=$APP.B.i(e,mW)?"range":"single",h=$APP.B.i(e,nW)?{value:XV(b),mode:g,reason:c}:{date:XV(b),mode:g,reason:c};h=CW(a,"x-date-picker-change-request",!0,h);if($APP.n(h.defaultPrevented))return null;
|
|
20
|
+
if($APP.B.i(e,nW))return d=XV(b),MW(a,b),DW(a),LW(a),CW(a,"x-date-picker-change",!1,{value:d,mode:g,reason:c}),$APP.n(a.hasAttribute("close-on-select"))?(a.removeAttribute("open"),LW(a)):null;e=function(){var y=$APP.k(a,"__xDatePickerRangeStep");return $APP.n(y)?y:0}();h=vW.g(d);if($APP.B.i(e,0))a.setAttribute("start",XV(b)),a.removeAttribute("end"),a.__xDatePickerRangeStep=1;else if($APP.B.i(e,1)){var l=qW.g(d),m=ZV(b,h);if($APP.n(function(){var y=m>0;return y?y:$APP.n(l)?m===0:l}())){var p=$APP.n(lW.g(d))?
|
|
21
|
+
ZV(h,b)<0?h:b:h,q=$APP.n(lW.g(d))?ZV(h,b)>0?h:b:b;a.setAttribute("start",XV(p));a.setAttribute("end",XV(q));a.__xDatePickerRangeStep=0;$APP.n(function(){var y=a.hasAttribute("close-on-select");return $APP.n(y)?p!=null&&q!=null:y}())&&a.removeAttribute("open")}else a.setAttribute("start",XV(b)),a.removeAttribute("end"),a.__xDatePickerRangeStep=1}else a.setAttribute("start",XV(b)),a.removeAttribute("end"),a.__xDatePickerRangeStep=1;DW(a);LW(a);b=$APP.k(a,"__xDatePickerState");b=$APP.n(b)?$APP.k(b,"canon"):
|
|
22
|
+
null;var v=$APP.n(vW.g(b))?XV(vW.g(b)):null,x=$APP.n(xW.g(b))?XV(xW.g(b)):null;b=function(){var y={mode:g,reason:c};$APP.n(v)&&(y.start=v);$APP.n(x)&&(y.end=x);return y}();return CW(a,"x-date-picker-change",!1,b)},OW=function(a,b){var c=$APP.k(a,"__xDatePickerRefs");c=$APP.n(c)?$APP.k(c,"input"):null;var d=$APP.n(c)?c.value:null;c=$APP.k(a,"__xDatePickerState");var e=$APP.n(c)?$APP.k(c,"canon"):null,g=$APP.wj.g(e);c=$APP.B.i(g,mW)?"range":"single";CW(a,"x-date-picker-input",!1,{value:d,mode:c});if($APP.B.i(g,
|
|
23
|
+
nW)){if(d=jW(d),e=$APP.M(d),d=$APP.D(e,hW),e=$APP.D(e,iW),$APP.n(d)){g=XV(e);d=CW(a,"x-date-picker-change-request",!0,{value:g,mode:c,reason:b});if($APP.n(d.defaultPrevented))return null;MW(a,e);DW(a);LW(a);return CW(a,"x-date-picker-change",!1,{value:g,mode:c,reason:b})}}else if(e=new $APP.Q(null,1,[$APP.el,$APP.el.g(e)],null),e=$APP.M(e),e=$APP.D(e,$APP.el),e=typeof e==="string"&&e.length>0?e:" - ",d=VV(d),d==null?d=new $APP.Q(null,3,[hW,!1,$APP.mm,null,$APP.Li,null],null):(g=d.indexOf(e),g<0?(d=
|
|
24
|
+
jW(d),e=$APP.M(d),d=$APP.D(e,hW),e=$APP.D(e,iW),d=new $APP.Q(null,3,[hW,d,$APP.mm,e,$APP.Li,null],null)):(e=d.substring(g+e.length).trim(),d=YV(d.substring(0,g).trim()),e=YV(e),d=new $APP.Q(null,3,[hW,d!=null&&e!=null,$APP.mm,d,$APP.Li,e],null))),g=$APP.M(d),d=$APP.D(g,hW),e=$APP.D(g,$APP.mm),g=$APP.D(g,$APP.Li),$APP.n(d)){e=XV(e);g=XV(g);d=CW(a,"x-date-picker-change-request",!0,{start:e,end:g,mode:c,reason:b});if($APP.n(d.defaultPrevented))return null;a.setAttribute("start",e);a.setAttribute("end",
|
|
25
|
+
g);a.__xDatePickerRangeStep=0;DW(a);LW(a);return CW(a,"x-date-picker-change",!1,{start:e,end:g,mode:c,reason:b})}return null},PW=function(a,b){var c=$APP.k(a,"__xDatePickerState"),d=$APP.n(c)?$APP.k(c,"month"):null;if($APP.n(d)){var e=d.getUTCFullYear();d=d.getUTCMonth();b=$APP.B.i(b,$APP.Tj)?new Date(Date.UTC(e,d+1,1)):new Date(Date.UTC(e,d-1,1));c.month=b;return JW(a)}return null},QW=function(a){return $APP.n(a.hasAttribute("open"))?a.removeAttribute("open"):null},RW=function(a,b){if($APP.n(a.hasAttribute("disabled")))return null;
|
|
26
|
+
b=b.currentTarget.getAttribute("data-nav");return $APP.B.i(b,"prev")?PW(a,$APP.Nj):PW(a,$APP.Tj)},SW=function(a,b){if($APP.n(a.hasAttribute("disabled")))return null;var c=b.key,d=$APP.k(a,"__xDatePickerGridFocus"),e=$APP.n(d)?YV(d):null;d=$APP.k(a,"__xDatePickerState");var g=$APP.n(d)?$APP.k(d,"canon"):null,h=$APP.n(d)?$APP.k(d,"month"):null,l=$APP.n(e)?function(){switch(c){case "ArrowLeft":return $V(e,-1);case "ArrowRight":return $V(e,1);case "ArrowUp":return $V(e,-7);case "ArrowDown":return $V(e,
|
|
27
|
+
7);case "PageUp":return bW(e,-1);case "PageDown":return bW(e,1);case "Home":return $APP.n(e)?$V(e,-($APP.n(e)?e.getUTCDay():0)):null;case "End":return $APP.n(e)?$V(e,6-($APP.n(e)?e.getUTCDay():0)):null;default:return null}}():null;return l!=null?(b.preventDefault(),b=cW(l,sW.g(g),rW.g(g)),g=XV(b),$APP.n($APP.n(h)?$APP.N(b.getUTCMonth(),h.getUTCMonth()):h)&&($APP.ja(d,"month",aW(b)),JW(a)),IW(a,g)):$APP.n(function(){var m=$APP.B.i(c,"Enter")||$APP.B.i(c," ");return m?$APP.n(e)?$APP.r(a.hasAttribute("readonly")):
|
|
28
|
+
e:m}())?(b.preventDefault(),$APP.n(EW(e,g))?null:NW(a,e,"keyboard")):$APP.B.i(c,"Escape")?(b.preventDefault(),QW(a),d=$APP.k(a,"__xDatePickerRefs"),d=$APP.n(d)?$APP.k(d,"input"):null,$APP.n(d)?d.focus():null):null},TW=function(a){function b(G){return $APP.n(a.hasAttribute("open"))?$APP.n(G.composedPath().some(function(J){return J===a}))?null:QW(a):null}function c(G){return G.preventDefault()}function d(G){return SW(a,G)}function e(G){var J=a.hasAttribute("disabled");$APP.n($APP.n(J)?J:a.hasAttribute("readonly"))?
|
|
29
|
+
G=null:(G=G.target.closest("button[data-iso]"),$APP.n($APP.n(G)?$APP.N("true",G.getAttribute("data-disabled")):G)?(G=G.getAttribute("data-iso"),G=YV(G),G=$APP.n(G)?NW(a,G,"click"):null):G=null);return G}function g(G){return RW(a,G)}function h(G){return RW(a,G)}function l(){if($APP.n(a.hasAttribute("disabled")))var G=null;else if($APP.n(a.hasAttribute("open")))G=QW(a);else if($APP.n(a.hasAttribute("open")))G=null;else{a.setAttribute("open","");G=$APP.k(a,"__xDatePickerState");G=$APP.n(G)?$APP.k(G,
|
|
30
|
+
"canon"):null;var J=pW.g(G);$APP.n(J)?G=J:(G=vW.g(G),G=$APP.n(G)?G:new Date(Date.now()));G=XV(G);G=IW(a,G)}return G}function m(){a.__xDatePickerFocused=!1;$APP.n(a.hasAttribute("disabled"))||OW(a,"blur");return KW(a)}function p(){a.__xDatePickerFocused=!0}function q(G){if($APP.n(a.hasAttribute("disabled")))G=null;else{var J=G.key;$APP.B.i(J,"Enter")?(G.preventDefault(),G=OW(a,"keyboard")):G=$APP.B.i(J,"Escape")?QW(a):null}return G}function v(){var G=$APP.k(a,"__xDatePickerRefs");G=$APP.n(G)?$APP.k(G,
|
|
31
|
+
"input"):null;var J=$APP.k(a,"__xDatePickerState");J=$APP.B.i($APP.wj.g($APP.n(J)?$APP.k(J,"canon"):null),mW)?"range":"single";a.__xDatePickerDisplay=$APP.n(G)?G.value:null;return CW(a,"x-date-picker-input",!1,{value:$APP.n(G)?G.value:null,mode:J})}var x=$APP.k(a,"__xDatePickerRefs"),y=$APP.k(x,"input"),A=$APP.k(x,"btn"),C=$APP.k(x,"nav-prev"),E=$APP.k(x,"nav-next"),H=$APP.k(x,"grid");x=$APP.k(x,"popover");y.addEventListener("input",v);y.addEventListener("keydown",q);y.addEventListener("focus",p);
|
|
32
|
+
y.addEventListener("blur",m);A.addEventListener("click",l);C.addEventListener("click",h);E.addEventListener("click",g);H.addEventListener("click",e);H.addEventListener("keydown",d);x.addEventListener("pointerdown",c);document.addEventListener("pointerdown",b,!0);$APP.ja(a,"__xDatePickerHandlers",{"pop-md":c,keydown:q,grid:e,"grid-kd":d,next:g,blur:m,prev:h,focus:p,input:v,btn:l,"doc-click":b})},UW=function(a){var b=$APP.k(a,"__xDatePickerRefs");a=$APP.k(a,"__xDatePickerHandlers");if($APP.n($APP.n(b)?
|
|
33
33
|
a:b)){var c=$APP.k(b,"input"),d=$APP.k(b,"btn"),e=$APP.k(b,"nav-prev"),g=$APP.k(b,"nav-next"),h=$APP.k(b,"grid");b=$APP.k(b,"popover");c.removeEventListener("input",$APP.k(a,"input"));c.removeEventListener("keydown",$APP.k(a,"keydown"));c.removeEventListener("focus",$APP.k(a,"focus"));c.removeEventListener("blur",$APP.k(a,"blur"));d.removeEventListener("click",$APP.k(a,"btn"));e.removeEventListener("click",$APP.k(a,"prev"));g.removeEventListener("click",$APP.k(a,"next"));h.removeEventListener("click",
|
|
34
|
-
$APP.k(a,"grid"));h.removeEventListener("keydown",$APP.k(a,"grid-kd"));b.removeEventListener("pointerdown",$APP.k(a,"pop-md"));return document.removeEventListener("pointerdown",$APP.k(a,"doc-click"),!0)}return null},
|
|
35
|
-
b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return $APP.n(d)?this.setAttribute(c,""):this.removeAttribute(c)}})},
|
|
36
|
-
(this.removeAttribute("start"),this.removeAttribute("end"));
|
|
34
|
+
$APP.k(a,"grid"));h.removeEventListener("keydown",$APP.k(a,"grid-kd"));b.removeEventListener("pointerdown",$APP.k(a,"pop-md"));return document.removeEventListener("pointerdown",$APP.k(a,"doc-click"),!0)}return null},VW=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){var d=this.getAttribute(c);return $APP.n(d)?d:null},set:function(d){return typeof d==="string"&&$APP.N(d,"")?this.setAttribute(c,d):this.removeAttribute(c)}})},WW=function(a,b,c){Object.defineProperty(a,
|
|
35
|
+
b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return $APP.n(d)?this.setAttribute(c,""):this.removeAttribute(c)}})},XW=function(a){a.focus=function(){var b=$APP.k(this,"__xDatePickerRefs");b=$APP.n(b)?$APP.k(b,"input"):null;return $APP.n(b)?b.focus():null};a.commit=function(){return OW(this,"programmatic")};a.clear=function(){var b=$APP.k(this,"__xDatePickerState");$APP.B.i($APP.wj.g($APP.n(b)?$APP.k(b,"canon"):null),nW)?this.removeAttribute("value"):
|
|
36
|
+
(this.removeAttribute("start"),this.removeAttribute("end"));DW(this);return LW(this)}},ZW=function(){var a=class extends HTMLElement{},b=a.prototype;a.observedAttributes=YW;b.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xDatePickerRefs"))){var c=this.attachShadow({mode:"open"}),d=BW("style"),e=BW("div"),g=BW("input"),h=BW("button"),l=BW("div"),m=BW("div"),p=BW("button"),q=BW("div"),v=BW("button"),x=BW("div"),y=BW("div"),A=BW("div");d.textContent=":host{display:block;color-scheme:light dark;--x-date-picker-border:var(--x-color-border,#cbd5e1);--x-date-picker-radius:var(--x-radius-md,8px);--x-date-picker-input-bg:var(--x-color-surface,#fff);--x-date-picker-text:inherit;--x-date-picker-focus:var(--x-color-focus-ring,#60a5fa);--x-date-picker-placeholder:var(--x-color-text-muted,#94a3b8);--x-date-picker-btn-bg:var(--x-color-surface-hover,#f8fafc);--x-date-picker-btn-hover:var(--x-color-surface-active,#f1f5f9);--x-date-picker-popover-bg:var(--x-color-bg,#fff);--x-date-picker-popover-radius:var(--x-radius-lg,12px);--x-date-picker-nav-hover:var(--x-color-surface-active,#f1f5f9);--x-date-picker-weekday:var(--x-color-text-muted,#94a3b8);--x-date-picker-day-text:inherit;--x-date-picker-day-hover:var(--x-color-surface-active,#f1f5f9);--x-date-picker-selected-bg:var(--x-color-primary,#2563eb);--x-date-picker-selected-text:#fff;--x-date-picker-range-bg:var(--x-color-surface-active,#dbeafe);--x-date-picker-range-text:var(--x-color-primary-active,#1e40af);}[part\x3dcontainer]{position:relative;display:flex;align-items:stretch;gap:8px;width:100%;}[part\x3dinput]{flex:1;min-width:0;appearance:none;box-sizing:border-box;border:1px solid var(--x-date-picker-border,#cbd5e1);border-radius:var(--x-date-picker-radius,8px);padding:8px 12px;font-size:0.9375rem;background:var(--x-date-picker-input-bg,#fff);color:var(--x-date-picker-text,inherit);outline:none;}[part\x3dinput]:focus{border-color:var(--x-date-picker-focus,#60a5fa);box-shadow:0 0 0 3px rgba(96,165,250,0.25);}[part\x3dinput][disabled]{opacity:0.5;cursor:default;}[part\x3dbtn][disabled]{opacity:0.5;cursor:default;pointer-events:none;}[part\x3dinput]::placeholder{color:var(--x-date-picker-placeholder,#94a3b8);}[part\x3dbtn]{all:unset;cursor:pointer;flex:0 0 auto;width:42px;height:42px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--x-date-picker-border,#cbd5e1);border-radius:var(--x-date-picker-radius,8px);background:var(--x-date-picker-btn-bg,#f8fafc);color:var(--x-date-picker-text,inherit);box-sizing:border-box;}[part\x3dbtn]:hover{background:var(--x-date-picker-btn-hover,#f1f5f9);}[part\x3dbtn]:focus-visible{outline:2px solid var(--x-date-picker-focus,#60a5fa);}[part\x3dpopover]{display:none;position:absolute;z-index:1000;top:calc(100% + 8px);left:0;background:var(--x-date-picker-popover-bg,#fff);border:1px solid var(--x-date-picker-border,#e2e8f0);border-radius:var(--x-date-picker-popover-radius,12px);box-shadow:0 8px 32px rgba(0,0,0,0.12),0 2px 8px rgba(0,0,0,0.06);padding:16px;width:var(--x-date-picker-popover-width,304px);max-width:calc(100vw - 1rem);box-sizing:border-box;}:host([open]) [part\x3dpopover]{display:block;}[part\x3dnav]{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;}[part\x3dnavbtn]{all:unset;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:6px;color:var(--x-date-picker-text,inherit);}[part\x3dnavbtn]:hover{background:var(--x-date-picker-nav-hover,#f1f5f9);}[part\x3dnavbtn]:focus-visible{outline:2px solid var(--x-date-picker-focus,#60a5fa);}[part\x3dmonthlabel]{font-weight:600;font-size:0.9375rem;}[part\x3dweekdays]{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;margin-bottom:4px;}[part\x3dweekday]{text-align:center;font-size:0.75rem;font-weight:600;color:var(--x-date-picker-weekday,#94a3b8);padding:4px 0;}[part\x3dgrid]{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;}[part\x3dday]{all:unset;cursor:pointer;box-sizing:border-box;display:flex;align-items:center;justify-content:center;height:36px;border-radius:6px;font-size:0.875rem;color:var(--x-date-picker-day-text,inherit);}[part\x3dday]:hover:not([disabled]){background:var(--x-date-picker-day-hover,#f1f5f9);}[part\x3dday]:focus-visible{outline:2px solid var(--x-date-picker-focus,#60a5fa);}[part\x3dday][data-outside\x3dtrue]{opacity:0.4;}[part\x3dday][data-disabled\x3dtrue]{opacity:0.3;cursor:default;pointer-events:none;}[part\x3dday][data-selected\x3dtrue]{background:var(--x-date-picker-selected-bg,#2563eb);color:var(--x-date-picker-selected-text,#fff);font-weight:600;}[part\x3dday][data-in-range\x3dtrue]:not([data-range-edge\x3dtrue]){background:var(--x-date-picker-range-bg,#dbeafe);color:var(--x-date-picker-range-text,#1e40af);border-radius:0;}[part\x3dday][data-range-edge\x3dtrue]{background:var(--x-date-picker-selected-bg,#2563eb);color:var(--x-date-picker-selected-text,#fff);font-weight:600;}[part\x3dsr-status]{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;}@media (prefers-color-scheme:dark){:host{--x-date-picker-border:var(--x-color-border,#334155);--x-date-picker-input-bg:var(--x-color-surface,#0f172a);--x-date-picker-btn-bg:var(--x-color-surface-hover,#1e293b);--x-date-picker-btn-hover:var(--x-color-surface-active,#334155);--x-date-picker-popover-bg:var(--x-color-bg,#1e293b);--x-date-picker-day-hover:var(--x-color-surface-active,#334155);--x-date-picker-selected-bg:var(--x-color-primary,#3b82f6);--x-date-picker-range-bg:var(--x-color-surface-active,#1e3a8a);--x-date-picker-range-text:var(--x-color-focus-ring,#93c5fd);--x-date-picker-nav-hover:var(--x-color-surface-active,#334155);}}@media (prefers-reduced-motion:reduce){[part\x3dpopover]{transition:none;}}";
|
|
37
37
|
e.setAttribute("part","container");g.setAttribute("part","input");g.setAttribute("type","text");g.setAttribute("inputmode","none");g.setAttribute("autocomplete","off");g.setAttribute("role","combobox");g.setAttribute("aria-haspopup","dialog");g.setAttribute("aria-expanded","false");h.setAttribute("part","btn");h.setAttribute("type","button");h.setAttribute("aria-label","Open calendar");h.textContent="\ud83d\udcc5";l.setAttribute("part","popover");l.setAttribute("role","dialog");l.setAttribute("aria-modal",
|
|
38
38
|
"true");l.setAttribute("aria-label","Calendar");m.setAttribute("part","nav");p.setAttribute("part","navbtn");p.setAttribute("data-nav","prev");p.setAttribute("type","button");p.setAttribute("aria-label","Previous month");p.textContent="‹";q.setAttribute("part","monthlabel");q.setAttribute("aria-live","polite");v.setAttribute("part","navbtn");v.setAttribute("data-nav","next");v.setAttribute("type","button");v.setAttribute("aria-label","Next month");v.textContent="›";x.setAttribute("part","weekdays");
|
|
39
39
|
x.setAttribute("aria-hidden","true");y.setAttribute("part","grid");y.setAttribute("role","grid");y.setAttribute("aria-label","Calendar grid");A.setAttribute("part","sr-status");A.setAttribute("aria-live","polite");A.setAttribute("aria-atomic","true");m.appendChild(p);m.appendChild(q);m.appendChild(v);l.appendChild(m);l.appendChild(x);l.appendChild(y);l.appendChild(A);e.appendChild(g);e.appendChild(h);e.appendChild(l);c.appendChild(d);c.appendChild(e);this.__xDatePickerRefs={weekdays:x,grid:y,popover:l,
|
|
40
|
-
"nav-next":v,"month-label":q,input:g,btn:h,sr:A,"nav-prev":p}}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"end-d",-1316370898),
|
|
40
|
+
"nav-next":v,"month-label":q,input:g,btn:h,sr:A,"nav-prev":p}}UW(this);TW(this);DW(this);return LW(this)};b.disconnectedCallback=function(){return UW(this)};b.attributeChangedCallback=function(){DW(this);return LW(this)};VW(b,"mode","mode");VW(b,"value","value");VW(b,"start","start");VW(b,"end","end");WW(b,"open","open");WW(b,"disabled","disabled");WW(b,"readOnly","readonly");WW(b,"required","required");XW(b);return a},$W=function(){return $APP.n(customElements.get("x-date-picker"))?null:customElements.define("x-date-picker",
|
|
41
|
+
ZW())},vW=new $APP.K(null,"start-d","start-d",-1546785820),iW=new $APP.K(null,"date","date",-1463434462),lW=new $APP.K(null,"auto-swap?","auto-swap?",-1675454411),GW=new $APP.K(null,"edge?","edge?",203916303),rW=new $APP.K(null,"max-d","max-d",-814680979),nW=new $APP.K(null,"single","single",1551466437),wW=new $APP.K(null,"start-str","start-str",1077409677),mW=new $APP.K(null,"range","range",1639692286),oW=new $APP.K(null,"iso","iso",-1366207543),zW=new $APP.K(null,"in-month?","in-month?",-1630426251),
|
|
42
|
+
sW=new $APP.K(null,"min-d","min-d",-1118792932),qW=new $APP.K(null,"allow-same-day?","allow-same-day?",-1971558934),hW=new $APP.K(null,"ok?","ok?",447310304),uW=new $APP.K(null,"end-str","end-str",-558112319),fW=new $APP.K(null,"localized","localized",1722109655),tW=new $APP.K(null,"value-str","value-str",989198845),eW=new $APP.K(null,"format","format",-1306924766),pW=new $APP.K(null,"value-d","value-d",-1768534876),FW=new $APP.K(null,"in-range?","in-range?",-291779262),xW=new $APP.K(null,"end-d",
|
|
43
|
+
"end-d",-1316370898),kW=new $APP.K(null,"range-allow-same-day?","range-allow-same-day?",-714516856);var YW="mode value start end min max format locale separator auto-swap range-allow-same-day close-on-select placeholder disabled readonly required name autocomplete aria-label aria-describedby open".split(" ");$APP.ha("baredom.exports.x_date_picker.init",$W);export const init=$W;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// x-divider.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
+
|
|
3
|
+
export function init(): void;
|
|
4
|
+
|
|
5
|
+
export interface XDivider extends HTMLElement {
|
|
6
|
+
orientation: string;
|
|
7
|
+
variant: string;
|
|
8
|
+
align: string;
|
|
9
|
+
label: string;
|
|
10
|
+
thickness: string;
|
|
11
|
+
color: string;
|
|
12
|
+
inset: string;
|
|
13
|
+
length: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare global {
|
|
17
|
+
interface HTMLElementTagNameMap {
|
|
18
|
+
"x-divider": XDivider;
|
|
19
|
+
}
|
|
20
|
+
}
|