@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-divider.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
a.getAttribute("role")]),c=$APP.M(b);b=$APP.D(c,$APP.Uj);var d=$APP.D(c,
|
|
4
|
-
e=$APP.D(c,$APP.
|
|
5
|
-
new $APP.
|
|
2
|
+
var oV=function(a,b,c){c=typeof c==="string"?c.trim().toLowerCase():null;return $APP.I(a,c)?c:b},pV=function(a){for(;;){var b=a.firstChild;if($APP.n(b))a.removeChild(b);else break}},AV=function(a){var b=$APP.zf([$APP.ul,$APP.pi,$APP.Xi,qV,rV,$APP.gn,sV,$APP.Yl,$APP.Uj,tV],[a.getAttribute("variant"),a.getAttribute("label"),a.getAttribute("align"),a.getAttribute("length"),a.getAttribute("thickness"),a.getAttribute("color"),a.getAttribute("inset"),a.getAttribute("orientation"),a.getAttribute("aria-label"),
|
|
3
|
+
a.getAttribute("role")]),c=$APP.M(b);b=$APP.D(c,$APP.Uj);var d=$APP.D(c,tV),e=$APP.D(c,$APP.pi);var g=$APP.D(c,$APP.ul);var h=$APP.D(c,$APP.Xi),l=$APP.D(c,qV),m=$APP.D(c,rV),p=$APP.D(c,$APP.gn),q=$APP.D(c,sV);c=$APP.D(c,$APP.Yl);g=$APP.zf([$APP.di,$APP.vj,uV,vV,$APP.Oj,$APP.Vg,$APP.rl,$APP.U,wV,$APP.Ql],[d,oV(xV,"center",h),m,q,p,oV(yV,"solid",g),oV(zV,"horizontal",c),e,l,b]);c=$APP.M(g);d=$APP.D(c,$APP.Ql);h=$APP.D(c,$APP.vj);l=$APP.D(c,uV);m=$APP.D(c,vV);p=$APP.D(c,$APP.Oj);q=$APP.D(c,$APP.Vg);
|
|
4
|
+
e=$APP.D(c,$APP.rl);b=$APP.D(c,$APP.U);var v=$APP.D(c,wV);c=typeof b==="string"&&b.trim().length>0;var x=a.style;a.setAttribute("data-orientation",e);a.setAttribute("data-variant",q);a.setAttribute("data-align",h);x.setProperty("--x-divider-thickness",$APP.n(l)?l:"1px");x.setProperty("--x-divider-inset",$APP.n(m)?m:"0px");x.setProperty("--x-divider-length",$APP.n(v)?v:"auto");$APP.n(p)?x.setProperty("--x-divider-color",p):x.removeProperty("--x-divider-color");g=$APP.di.g(g);$APP.I(new $APP.S(null,
|
|
5
|
+
new $APP.Q(null,2,["none",null,"presentation",null],null),null),g)?a.setAttribute("role","presentation"):a.setAttribute("role","separator");$APP.B.i(e,"vertical")?a.setAttribute("aria-orientation","vertical"):a.removeAttribute("aria-orientation");$APP.n($APP.n(d)?d.length>0:d)?a.setAttribute("aria-label",d):a.removeAttribute("aria-label");c?(d=$APP.k(a,"__xDividerRefs"),$APP.B.i($APP.k(d,"mode"),"no-label")&&(e=$APP.k(d,"container"),pV(e),g=document.createElement("div"),h=document.createElement("span"),
|
|
6
6
|
l=document.createElement("slot"),m=document.createElement("span"),p=document.createElement("div"),g.setAttribute("part","line-left"),h.setAttribute("part","label"),l.setAttribute("name","label"),m.setAttribute("part","label-text"),p.setAttribute("part","line-right"),h.appendChild(l),h.appendChild(m),e.appendChild(g),e.appendChild(h),e.appendChild(p),d["line-left"]=g,d["label-wrap"]=h,d["label-text"]=m,d["line-right"]=p,d.mode="label"),a=$APP.k($APP.k(a,"__xDividerRefs"),"label-text"),$APP.n(a)&&(a.textContent=
|
|
7
|
-
b)):(a=$APP.k(a,"__xDividerRefs"),$APP.B.i($APP.k(a,"mode"),"label")&&(b=$APP.k(a,"container"),
|
|
8
|
-
|
|
7
|
+
b)):(a=$APP.k(a,"__xDividerRefs"),$APP.B.i($APP.k(a,"mode"),"label")&&(b=$APP.k(a,"container"),pV(b),d=document.createElement("div"),d.setAttribute("part","line"),b.appendChild(d),a["line-left"]=null,a["label-wrap"]=null,a["label-text"]=null,a["line-right"]=null,a.mode="no-label"));return null},BV=function(a,b){Object.defineProperty(a,b,{get:function(){return this.getAttribute(b)},set:function(c){return c!=null?this.setAttribute(b,""+$APP.T.g(c)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},
|
|
8
|
+
CV=function(a,b,c){Object.defineProperty(a,b,{get:function(){var d=this.getAttribute(b);return $APP.n(d)?d:c},set:function(d){return d!=null?this.setAttribute(b,""+$APP.T.g(d)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},DV=function(a){CV(a,"orientation","horizontal");CV(a,"variant","solid");CV(a,"align","center");BV(a,"label");BV(a,"thickness");BV(a,"color");BV(a,"inset");BV(a,"length")},FV=function(){var a=class extends HTMLElement{};a.observedAttributes=EV;a.prototype.connectedCallback=
|
|
9
9
|
function(){if(!$APP.n($APP.k(this,"__xDividerRefs"))){var b=this.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div");c.textContent=":host{display:block;color-scheme:light dark;--x-divider-color:rgba(0,0,0,0.12);--x-divider-thickness:1px;--x-divider-inset:0px;--x-divider-length:auto;}@media (prefers-color-scheme:dark){:host{--x-divider-color:rgba(255,255,255,0.15);}}[part\x3dcontainer]{display:flex;align-items:center;width:var(--x-divider-length,auto);box-sizing:border-box;}:host([data-orientation\x3d'vertical']) [part\x3dcontainer]{flex-direction:column;height:var(--x-divider-length,auto);width:auto;}[part\x3dline],[part\x3dline-left],[part\x3dline-right]{flex:1;border:none;background:var(--x-divider-color,rgba(0,0,0,0.12));height:var(--x-divider-thickness,1px);margin:var(--x-divider-inset,0px) 0;}:host([data-orientation\x3d'vertical']) [part\x3dline],:host([data-orientation\x3d'vertical']) [part\x3dline-left],:host([data-orientation\x3d'vertical']) [part\x3dline-right]{width:var(--x-divider-thickness,1px);height:auto;margin:0 var(--x-divider-inset,0px);}:host([data-variant\x3d'dashed']) [part\x3dline],:host([data-variant\x3d'dashed']) [part\x3dline-left],:host([data-variant\x3d'dashed']) [part\x3dline-right]{background:none;height:0;border-top:var(--x-divider-thickness,1px) dashed var(--x-divider-color,rgba(0,0,0,0.12));}:host([data-orientation\x3d'vertical'][data-variant\x3d'dashed']) [part\x3dline],:host([data-orientation\x3d'vertical'][data-variant\x3d'dashed']) [part\x3dline-left],:host([data-orientation\x3d'vertical'][data-variant\x3d'dashed']) [part\x3dline-right]{border-top:none;border-left:var(--x-divider-thickness,1px) dashed var(--x-divider-color,rgba(0,0,0,0.12));width:0;height:auto;}:host([data-variant\x3d'dotted']) [part\x3dline],:host([data-variant\x3d'dotted']) [part\x3dline-left],:host([data-variant\x3d'dotted']) [part\x3dline-right]{background:none;height:0;border-top:var(--x-divider-thickness,1px) dotted var(--x-divider-color,rgba(0,0,0,0.12));}:host([data-orientation\x3d'vertical'][data-variant\x3d'dotted']) [part\x3dline],:host([data-orientation\x3d'vertical'][data-variant\x3d'dotted']) [part\x3dline-left],:host([data-orientation\x3d'vertical'][data-variant\x3d'dotted']) [part\x3dline-right]{border-top:none;border-left:var(--x-divider-thickness,1px) dotted var(--x-divider-color,rgba(0,0,0,0.12));width:0;height:auto;}[part\x3dlabel]{display:flex;align-items:center;flex-shrink:0;padding:0 0.75em;font-size:0.75rem;font-weight:500;color:var(--x-divider-color);white-space:nowrap;}:host([data-orientation\x3d'vertical']) [part\x3dlabel]{padding:0.75em 0;writing-mode:horizontal-tb;}[part\x3dlabel-text]{display:inline;}:host([data-align\x3d'start']) [part\x3dline-left]{flex:0 0 1rem;}:host([data-align\x3d'end']) [part\x3dline-right]{flex:0 0 1rem;}@media (prefers-reduced-motion:reduce){*{transition:none !important;animation:none !important;}}";
|
|
10
|
-
d.setAttribute("part","container");var e=document.createElement("div");e.setAttribute("part","line");d.appendChild(e);b.appendChild(c);b.appendChild(d);this.__xDividerRefs={root:b,container:d,mode:"no-label"}}return
|
|
11
|
-
|
|
10
|
+
d.setAttribute("part","container");var e=document.createElement("div");e.setAttribute("part","line");d.appendChild(e);b.appendChild(c);b.appendChild(d);this.__xDividerRefs={root:b,container:d,mode:"no-label"}}return AV(this)};a.prototype.disconnectedCallback=function(){return null};a.prototype.attributeChangedCallback=function(b,c,d){return $APP.N(c,d)?$APP.n($APP.k(this,"__xDividerRefs"))?AV(this):null:null};DV(a.prototype);return a},GV=function(){$APP.n(customElements.get("x-divider"))||customElements.define("x-divider",
|
|
11
|
+
FV());return null},sV=new $APP.K(null,"inset-raw","inset-raw",89351124),vV=new $APP.K(null,"inset","inset",-396367740),tV=new $APP.K(null,"role-raw","role-raw",777951354),wV=new $APP.K(null,"length","length",588987862),qV=new $APP.K(null,"length-raw","length-raw",-1832244116),uV=new $APP.K(null,"thickness","thickness",-940175454),rV=new $APP.K(null,"thickness-raw","thickness-raw",1843812655);var EV="orientation variant thickness color inset length label align role aria-label".split(" "),zV=new $APP.S(null,new $APP.Q(null,2,["vertical",null,"horizontal",null],null),null),yV=new $APP.S(null,new $APP.Q(null,3,["dashed",null,"dotted",null,"solid",null],null),null),xV=new $APP.S(null,new $APP.Q(null,3,["center",null,"start",null,"end",null],null),null);$APP.ha("baredom.exports.x_divider.init",GV);export const init=GV;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// x-drawer.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
+
|
|
3
|
+
export function init(): void;
|
|
4
|
+
|
|
5
|
+
export interface XDrawerEventMap {
|
|
6
|
+
"x-drawer-toggle": CustomEvent<{ open: boolean }>;
|
|
7
|
+
"x-drawer-dismiss": CustomEvent<{ reason: string }>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface XDrawer extends HTMLElement {
|
|
11
|
+
open: boolean;
|
|
12
|
+
placement: string;
|
|
13
|
+
label: string;
|
|
14
|
+
show(): void;
|
|
15
|
+
hide(): void;
|
|
16
|
+
toggle(): void;
|
|
17
|
+
|
|
18
|
+
addEventListener<K extends keyof XDrawerEventMap>(
|
|
19
|
+
type: K,
|
|
20
|
+
listener: (this: XDrawer, ev: XDrawerEventMap[K]) => any,
|
|
21
|
+
options?: boolean | AddEventListenerOptions
|
|
22
|
+
): void;
|
|
23
|
+
addEventListener(
|
|
24
|
+
type: string,
|
|
25
|
+
listener: EventListenerOrEventListenerObject,
|
|
26
|
+
options?: boolean | AddEventListenerOptions
|
|
27
|
+
): void;
|
|
28
|
+
removeEventListener<K extends keyof XDrawerEventMap>(
|
|
29
|
+
type: K,
|
|
30
|
+
listener: (this: XDrawer, ev: XDrawerEventMap[K]) => any,
|
|
31
|
+
options?: boolean | EventListenerOptions
|
|
32
|
+
): void;
|
|
33
|
+
removeEventListener(
|
|
34
|
+
type: string,
|
|
35
|
+
listener: EventListenerOrEventListenerObject,
|
|
36
|
+
options?: boolean | EventListenerOptions
|
|
37
|
+
): void;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
declare global {
|
|
41
|
+
interface HTMLElementTagNameMap {
|
|
42
|
+
"x-drawer": XDrawer;
|
|
43
|
+
}
|
|
44
|
+
}
|
package/dist/x-drawer.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
2
|
+
var LJ=function(a){var b=$APP.k(a,"__xDrawerRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("div"),g=document.createElement("div"),h=document.createElement("slot"),l=document.createElement("div"),m=document.createElement("slot"),p=document.createElement("div"),q=document.createElement("slot");c.textContent=":host{display:contents;color-scheme:light dark;--x-drawer-size:20rem;--x-drawer-bg:var(--x-color-bg,Canvas);--x-drawer-fg:var(--x-color-text,CanvasText);--x-drawer-backdrop:rgb(0 0 0/0.4);--x-drawer-shadow:var(--x-shadow-lg,0 8px 24px rgb(0 0 0/0.18));--x-drawer-duration:var(--x-transition-duration,200ms);--x-drawer-easing:ease;--x-drawer-z:1000;--x-drawer-header-padding:1rem 1.25rem;--x-drawer-body-padding:1rem 1.25rem;--x-drawer-footer-padding:0.75rem 1.25rem;--x-drawer-border:var(--x-color-border,color-mix(in srgb,currentColor 12%,transparent));}[part\x3dbackdrop]{display:none;position:fixed;inset:0;background:var(--x-drawer-backdrop);z-index:var(--x-drawer-z);}:host([data-open\x3dtrue]) [part\x3dbackdrop]{display:block;}[part\x3dpanel]{position:fixed;background:var(--x-drawer-bg);color:var(--x-drawer-fg);box-shadow:var(--x-drawer-shadow);display:flex;flex-direction:column;overflow:hidden;z-index:calc(var(--x-drawer-z) + 1);transition:transform var(--x-drawer-duration) var(--x-drawer-easing);}:host([data-placement\x3dleft]) [part\x3dpanel],:host([data-placement\x3dright]) [part\x3dpanel]{top:0;bottom:0;width:var(--x-drawer-size);max-width:100%;}:host([data-placement\x3dleft]) [part\x3dpanel]{left:0;transform:translateX(-100%);}:host([data-placement\x3dright]) [part\x3dpanel]{right:0;transform:translateX(100%);}:host([data-placement\x3dtop]) [part\x3dpanel],:host([data-placement\x3dbottom]) [part\x3dpanel]{left:0;right:0;height:var(--x-drawer-size);max-height:100dvh;}:host([data-placement\x3dtop]) [part\x3dpanel]{top:0;transform:translateY(-100%);}:host([data-placement\x3dbottom]) [part\x3dpanel]{bottom:0;transform:translateY(100%);}:host([data-open\x3dtrue]) [part\x3dpanel]{transform:none;}[part\x3dpanel]:focus{outline:none;}[part\x3dheader]{padding:var(--x-drawer-header-padding);border-bottom:1px solid var(--x-drawer-border);flex-shrink:0;}[part\x3dbody]{padding:var(--x-drawer-body-padding);overflow-y:auto;flex:1;}[part\x3dfooter]{padding:var(--x-drawer-footer-padding);border-top:1px solid var(--x-drawer-border);flex-shrink:0;}@media (prefers-reduced-motion:reduce){[part\x3dpanel]{transition:none;}}@media (prefers-color-scheme:dark){:host{--x-drawer-bg:var(--x-color-bg,#1c1d24);--x-drawer-fg:var(--x-color-text,#e2e4ef);--x-drawer-border:var(--x-color-border,rgb(255 255 255/0.08));--x-drawer-shadow:var(--x-shadow-lg,0 8px 40px rgb(0 0 0/0.55));--x-drawer-backdrop:rgb(0 0 0/0.55);}}";
|
|
3
3
|
d.setAttribute("part","backdrop");e.setAttribute("part","panel");e.setAttribute("role","dialog");e.setAttribute("aria-modal","true");g.setAttribute("part","header");h.setAttribute("name","header");l.setAttribute("part","body");p.setAttribute("part","footer");q.setAttribute("name","footer");g.appendChild(h);l.appendChild(m);p.appendChild(q);e.appendChild(g);e.appendChild(l);e.appendChild(p);b.appendChild(c);b.appendChild(d);b.appendChild(e);a.__xDrawerRefs={root:b,backdrop:d,panel:e,header:g,body:l,
|
|
4
|
-
footer:p};return $APP.k(a,"__xDrawerRefs")},
|
|
5
|
-
composed:!0,cancelable:!1}))},
|
|
6
|
-
$APP.k(a,"__xDrawerPanelTab")===!0;a.__xDrawerTabbables=null;a.__xDrawerRestore=null;$APP.n($APP.n(b)?d:b)&&(b.removeAttribute("tabindex"),a.__xDrawerPanelTab=!1);$APP.n($APP.n(c)?c.isConnected:c)&&c.focus()},
|
|
7
|
-
$APP.
|
|
8
|
-
$APP.Hh(h):null;a.__xDrawerTabbables=l;$APP.t(h)?$APP.u(h).focus():$APP.n(g)&&($APP.n(g.hasAttribute("tabindex"))||(g.setAttribute("tabindex","-1"),a.__xDrawerPanelTab=!0),g.focus());return null},0):
|
|
9
|
-
$APP.n(l)&&l.focus();else{l=document.activeElement;var m=$APP.u(h);h=$APP.xc(h);var p=g.shiftKey;$APP.n($APP.n(p)?$APP.B.i(l,m):p)?(g.preventDefault(),h.focus()):$APP.r(p)&&$APP.B.i(l,h)&&(g.preventDefault(),m.focus())}}return null}function c(){return
|
|
10
|
-
if($APP.n($APP.n(b)?c:b)){var d=$APP.k(c,"backdrop");c=$APP.k(c,"panel");var e=$APP.k(b,"backdrop");b=$APP.k(b,"keydown");$APP.n(e)&&d.removeEventListener("click",e);$APP.n(b)&&c.removeEventListener("keydown",b)}a.__xDrawerHandlers=null},
|
|
11
|
-
return $APP.n(b)?b:"right"},set:function(b){return b==null?this.removeAttribute("placement"):this.setAttribute("placement",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"label",{get:function(){var b=this.getAttribute("label");return $APP.n(b)?b:"Drawer"},set:function(b){return b==null?this.removeAttribute("label"):this.setAttribute("label",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"show",{value:function(){return
|
|
12
|
-
writable:!0});Object.defineProperty(a,"hide",{value:function(){return
|
|
13
|
-
function(){
|
|
4
|
+
footer:p};return $APP.k(a,"__xDrawerRefs")},NJ=function(a){a=new $APP.Q(null,3,[$APP.Gi,a.hasAttribute("open"),$APP.jn,a.getAttribute("placement"),$APP.pi,a.getAttribute("label")],null);var b=$APP.M(a),c=$APP.D(b,$APP.Gi);a=$APP.D(b,$APP.jn);b=$APP.D(b,$APP.pi);c=$APP.F(c);a=typeof a==="string"&&$APP.I(MJ,a)?a:"right";b=typeof b==="string"&&$APP.N(b,"")?b:"Drawer";return new $APP.Q(null,3,[$APP.Om,c,$APP.Qj,a,$APP.U,b],null)},OJ=function(a,b,c){a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,
|
|
5
|
+
composed:!0,cancelable:!1}))},PJ=function(a){return $APP.xe($APP.de(function(b){var c=window.getComputedStyle(b);return $APP.N("none",c.display)&&$APP.N("hidden",c.visibility)&&b.offsetWidth>0&&b.offsetHeight>0},$APP.uc(a.querySelectorAll("a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex\x3d'-1'])"))))},QJ=function(a){var b=$APP.k(a,"__xDrawerRefs");b=$APP.n(b)?$APP.k(b,"panel"):null;var c=$APP.k(a,"__xDrawerRestore"),d=
|
|
6
|
+
$APP.k(a,"__xDrawerPanelTab")===!0;a.__xDrawerTabbables=null;a.__xDrawerRestore=null;$APP.n($APP.n(b)?d:b)&&(b.removeAttribute("tabindex"),a.__xDrawerPanelTab=!1);$APP.n($APP.n(c)?c.isConnected:c)&&c.focus()},RJ=function(a,b){OJ(a,"x-drawer-dismiss",{reason:b});a.removeAttribute("open");return null},SJ=function(a){$APP.n(a.hasAttribute("open"))||a.setAttribute("open","");return null},TJ=function(a){a.removeAttribute("open");return null},UJ=function(a){var b=LJ(a);b=$APP.k(b,"panel");var c=NJ(a),d=
|
|
7
|
+
$APP.Om.g(c),e=$APP.k(a,"__xDrawerPrevOpen");a.setAttribute("data-open",$APP.n(d)?"true":"false");a.setAttribute("data-placement",$APP.Qj.g(c));b.setAttribute("aria-label",$APP.U.g(c));$APP.n(d)?b.removeAttribute("aria-hidden"):b.setAttribute("aria-hidden","true");$APP.N(e,d)&&(a.__xDrawerPrevOpen=d,OJ(a,"x-drawer-toggle",{open:d}),$APP.n(d)?setTimeout(function(){var g=$APP.k(a,"__xDrawerRefs");g=$APP.n(g)?$APP.k(g,"panel"):null;var h=PJ(a);a.__xDrawerRestore=document.activeElement;var l=$APP.n(h)?
|
|
8
|
+
$APP.Hh(h):null;a.__xDrawerTabbables=l;$APP.t(h)?$APP.u(h).focus():$APP.n(g)&&($APP.n(g.hasAttribute("tabindex"))||(g.setAttribute("tabindex","-1"),a.__xDrawerPanelTab=!0),g.focus());return null},0):QJ(a))},VJ=function(a){function b(g){var h=g.key;if($APP.B.i(h,"Escape"))g.preventDefault(),RJ(a,"escape");else if($APP.B.i(h,"Tab")){h=$APP.k(a,"__xDrawerTabbables");h=$APP.n(h)?$APP.xe($APP.uc(h)):$APP.fe;var l=$APP.k(a,"__xDrawerRefs");l=$APP.n(l)?$APP.k(l,"panel"):null;if($APP.Hc(h))g.preventDefault(),
|
|
9
|
+
$APP.n(l)&&l.focus();else{l=document.activeElement;var m=$APP.u(h);h=$APP.xc(h);var p=g.shiftKey;$APP.n($APP.n(p)?$APP.B.i(l,m):p)?(g.preventDefault(),h.focus()):$APP.r(p)&&$APP.B.i(l,h)&&(g.preventDefault(),m.focus())}}return null}function c(){return RJ(a,"backdrop")}var d=LJ(a),e=$APP.k(d,"panel");$APP.k(d,"backdrop").addEventListener("click",c);e.addEventListener("keydown",b);$APP.ja(a,"__xDrawerHandlers",{backdrop:c,keydown:b})},WJ=function(a){var b=$APP.k(a,"__xDrawerHandlers"),c=$APP.k(a,"__xDrawerRefs");
|
|
10
|
+
if($APP.n($APP.n(b)?c:b)){var d=$APP.k(c,"backdrop");c=$APP.k(c,"panel");var e=$APP.k(b,"backdrop");b=$APP.k(b,"keydown");$APP.n(e)&&d.removeEventListener("click",e);$APP.n(b)&&c.removeEventListener("keydown",b)}a.__xDrawerHandlers=null},XJ=function(a){Object.defineProperty(a,"open",{get:function(){return this.hasAttribute("open")},set:function(b){return $APP.n(b)?SJ(this):TJ(this)},enumerable:!0,configurable:!0});Object.defineProperty(a,"placement",{get:function(){var b=this.getAttribute("placement");
|
|
11
|
+
return $APP.n(b)?b:"right"},set:function(b){return b==null?this.removeAttribute("placement"):this.setAttribute("placement",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"label",{get:function(){var b=this.getAttribute("label");return $APP.n(b)?b:"Drawer"},set:function(b){return b==null?this.removeAttribute("label"):this.setAttribute("label",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"show",{value:function(){return SJ(this)},enumerable:!0,configurable:!0,
|
|
12
|
+
writable:!0});Object.defineProperty(a,"hide",{value:function(){return TJ(this)},enumerable:!0,configurable:!0,writable:!0});Object.defineProperty(a,"toggle",{value:function(){$APP.n(this.hasAttribute("open"))?TJ(this):SJ(this);return null},enumerable:!0,configurable:!0,writable:!0})},ZJ=function(){if(!$APP.n(customElements.get("x-drawer"))){var a=class extends HTMLElement{};a.observedAttributes=YJ;a.prototype.connectedCallback=function(){LJ(this);WJ(this);VJ(this);UJ(this);return null};a.prototype.disconnectedCallback=
|
|
13
|
+
function(){WJ(this);QJ(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.N(c,d)&&UJ(this);return null};XJ(a.prototype);customElements.define("x-drawer",a)}return null},$J=function(){return ZJ()};var MJ=new $APP.S(null,new $APP.Q(null,4,["right",null,"top",null,"bottom",null,"left",null],null),null),YJ=["open","placement","label"];$APP.Pd(["x-drawer-toggle",new $APP.Q(null,2,[$APP.lm,!1,$APP.V,new $APP.Q(null,1,[$APP.im,$APP.Zj],null)],null),"x-drawer-dismiss",new $APP.Q(null,2,[$APP.lm,!1,$APP.V,new $APP.Q(null,1,[$APP.Qi,$APP.Y],null)],null)]);$APP.ha("baredom.exports.x_drawer.init",$J);export const init=$J;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// x-dropdown.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
+
|
|
3
|
+
export function init(): void;
|
|
4
|
+
|
|
5
|
+
export interface XDropdownEventMap {
|
|
6
|
+
"x-dropdown-toggle": CustomEvent<{ open: boolean; source: string }>;
|
|
7
|
+
"x-dropdown-change": CustomEvent<{ open: boolean }>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface XDropdown extends HTMLElement {
|
|
11
|
+
open: boolean;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
label: string;
|
|
14
|
+
placement: string;
|
|
15
|
+
|
|
16
|
+
addEventListener<K extends keyof XDropdownEventMap>(
|
|
17
|
+
type: K,
|
|
18
|
+
listener: (this: XDropdown, ev: XDropdownEventMap[K]) => any,
|
|
19
|
+
options?: boolean | AddEventListenerOptions
|
|
20
|
+
): void;
|
|
21
|
+
addEventListener(
|
|
22
|
+
type: string,
|
|
23
|
+
listener: EventListenerOrEventListenerObject,
|
|
24
|
+
options?: boolean | AddEventListenerOptions
|
|
25
|
+
): void;
|
|
26
|
+
removeEventListener<K extends keyof XDropdownEventMap>(
|
|
27
|
+
type: K,
|
|
28
|
+
listener: (this: XDropdown, ev: XDropdownEventMap[K]) => any,
|
|
29
|
+
options?: boolean | EventListenerOptions
|
|
30
|
+
): void;
|
|
31
|
+
removeEventListener(
|
|
32
|
+
type: string,
|
|
33
|
+
listener: EventListenerOrEventListenerObject,
|
|
34
|
+
options?: boolean | EventListenerOptions
|
|
35
|
+
): void;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare global {
|
|
39
|
+
interface HTMLElementTagNameMap {
|
|
40
|
+
"x-dropdown": XDropdown;
|
|
41
|
+
}
|
|
42
|
+
}
|
package/dist/x-dropdown.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
a)}return null},
|
|
4
|
-
$APP.k(b,"docClick"),d=$APP.k(b,"docKeydown");return setTimeout(function(){return $APP.n(a.hasAttribute("open"))?(document.addEventListener("click",c),document.addEventListener("keydown",d)):null},0)}return null},
|
|
5
|
-
b.key;return $APP.B.i(c," ")||$APP.B.i(c,"Enter")?(b.preventDefault(),
|
|
6
|
-
"escape"):null}}},
|
|
7
|
-
function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){var d=this.getAttribute(c);return $APP.n(d)?d:""},set:function(d){d!=null&&$APP.N(d)?(d=""+$APP.T.g(d),d=this.setAttribute(c,d)):d=this.removeAttribute(c);return d}})},
|
|
8
|
-
null:
|
|
2
|
+
var nr=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},pr=function(a){var b=$APP.k(a,"__xDropdownRefs");if($APP.n(b)){var c=$APP.k(b,"trigger"),d=$APP.k(b,"label");b=$APP.k(b,"panel");var e=a.hasAttribute("open"),g=a.hasAttribute("disabled");var h=a.getAttribute("label");h=$APP.n(h)?h:"";a=a.getAttribute("placement");a=$APP.I(or,a)?a:"bottom-start";d.textContent=h;c.setAttribute("aria-expanded",$APP.n(e)?"true":"false");nr(c,"disabled",g);return b.setAttribute("data-placement",
|
|
3
|
+
a)}return null},qr=function(a,b){if($APP.n(a.hasAttribute("disabled")))return null;var c=$APP.r(a.hasAttribute("open"));b=new CustomEvent("x-dropdown-toggle",{detail:{open:c,source:b},bubbles:!0,composed:!0,cancelable:!0});a.dispatchEvent(b);return $APP.r(b.defaultPrevented)?(c?a.setAttribute("open",""):a.removeAttribute("open"),a.dispatchEvent(new CustomEvent("x-dropdown-change",{detail:{open:c},bubbles:!0,composed:!0,cancelable:!1}))):null},rr=function(a){var b=$APP.k(a,"__xDropdownHandlers");if($APP.n(b)){var c=
|
|
4
|
+
$APP.k(b,"docClick"),d=$APP.k(b,"docKeydown");return setTimeout(function(){return $APP.n(a.hasAttribute("open"))?(document.addEventListener("click",c),document.addEventListener("keydown",d)):null},0)}return null},sr=function(a){a=$APP.k(a,"__xDropdownHandlers");if($APP.n(a)){var b=$APP.k(a,"docKeydown");document.removeEventListener("click",$APP.k(a,"docClick"));return document.removeEventListener("keydown",b)}return null},tr=function(a){return{triggerClick:function(){return qr(a,"pointer")},triggerKeydown:function(b){var c=
|
|
5
|
+
b.key;return $APP.B.i(c," ")||$APP.B.i(c,"Enter")?(b.preventDefault(),qr(a,"keyboard")):null},hostFocusout:function(b){return $APP.n(a.hasAttribute("open"))?(b=b.relatedTarget,b==null||$APP.r(a.contains(b))?qr(a,"focusout"):null):null},docClick:function(b){return $APP.n(a.hasAttribute("open"))?(b=$APP.vc(b.composedPath()),b=$APP.Td(function(c){return c===a},b),$APP.n(b)?null:qr(a,"outside-click")):null},docKeydown:function(b){b=$APP.B.i(b.key,"Escape");return $APP.n(b?a.hasAttribute("open"):b)?qr(a,
|
|
6
|
+
"escape"):null}}},ur=function(a){var b=$APP.k(a,"__xDropdownRefs");if($APP.n(b)){var c=$APP.k(a,"__xDropdownHandlers");$APP.n(c)&&(b=$APP.k(b,"trigger"),b.removeEventListener("click",$APP.k(c,"triggerClick")),b.removeEventListener("keydown",$APP.k(c,"triggerKeydown")),a.removeEventListener("focusout",$APP.k(c,"hostFocusout")))}},vr=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return nr(this,c,$APP.F(d))}})},wr=
|
|
7
|
+
function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){var d=this.getAttribute(c);return $APP.n(d)?d:""},set:function(d){d!=null&&$APP.N(d)?(d=""+$APP.T.g(d),d=this.setAttribute(c,d)):d=this.removeAttribute(c);return d}})},yr=function(){var a=class extends HTMLElement{},b=a.prototype;Object.defineProperty(a,"observedAttributes",{get:function(){return xr}});vr(b,"open","open");vr(b,"disabled","disabled");wr(b,"label","label");wr(b,"placement","placement");b.show=function(){return $APP.n(this.hasAttribute("open"))?
|
|
8
|
+
null:qr(this,"programmatic")};b.hide=function(){return $APP.n(this.hasAttribute("open"))?qr(this,"programmatic"):null};b.toggle=function(){return qr(this,"programmatic")};b.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xDropdownRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("button"),g=document.createElement("span"),h=document.createElement("span"),l=document.createElement("div"),m=document.createElement("div"),p=document.createElement("slot");
|
|
9
9
|
d.textContent=":host{display:inline-block;position:relative;color-scheme:light dark;--x-dropdown-trigger-bg:var(--x-color-surface-hover,#f8fafc);--x-dropdown-trigger-bg-hover:var(--x-color-surface-active,#f1f5f9);--x-dropdown-trigger-bg-active:var(--x-color-surface-active,#e2e8f0);--x-dropdown-trigger-color:var(--x-color-text,#0f172a);--x-dropdown-trigger-border:1px solid var(--x-color-border,#e2e8f0);--x-dropdown-trigger-radius:var(--x-radius-md,6px);--x-dropdown-trigger-padding:0 0.75rem;--x-dropdown-trigger-height:2.25rem;--x-dropdown-trigger-font-size:var(--x-font-size-sm,0.9375rem);--x-dropdown-trigger-font-weight:500;--x-dropdown-chevron-color:var(--x-color-text-muted,#64748b);--x-dropdown-focus-ring:var(--x-color-focus-ring,#60a5fa);--x-dropdown-panel-bg:var(--x-color-bg,#ffffff);--x-dropdown-panel-border:1px solid var(--x-color-border,#e2e8f0);--x-dropdown-panel-radius:var(--x-radius-md,8px);--x-dropdown-panel-shadow:var(--x-shadow-md,0 4px 16px rgba(0,0,0,0.12));--x-dropdown-panel-padding:0.25rem;--x-dropdown-panel-min-width:10rem;--x-dropdown-panel-max-height:20rem;--x-dropdown-panel-offset:4px;--x-dropdown-transition-duration:var(--x-transition-duration,150ms);--x-dropdown-transition-easing:var(--x-transition-easing,ease);}@media (prefers-color-scheme:dark){:host{--x-dropdown-trigger-bg:var(--x-color-surface-hover,#1e293b);--x-dropdown-trigger-bg-hover:var(--x-color-surface-active,#334155);--x-dropdown-trigger-bg-active:var(--x-color-surface-active,#475569);--x-dropdown-trigger-color:var(--x-color-text,#e2e8f0);--x-dropdown-trigger-border:1px solid var(--x-color-border,#334155);--x-dropdown-chevron-color:var(--x-color-text-muted,#94a3b8);--x-dropdown-focus-ring:var(--x-color-focus-ring,#93c5fd);--x-dropdown-panel-bg:var(--x-color-bg,#1e293b);--x-dropdown-panel-border:1px solid var(--x-color-border,#334155);--x-dropdown-panel-shadow:var(--x-shadow-md,0 4px 24px rgba(0,0,0,0.4));}}[part\x3dtrigger]{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;gap:0.375rem;height:var(--x-dropdown-trigger-height);padding:var(--x-dropdown-trigger-padding);background:var(--x-dropdown-trigger-bg);color:var(--x-dropdown-trigger-color);border:var(--x-dropdown-trigger-border);border-radius:var(--x-dropdown-trigger-radius);font-size:var(--x-dropdown-trigger-font-size);font-weight:var(--x-dropdown-trigger-font-weight);font-family:inherit;cursor:pointer;user-select:none;white-space:nowrap;}[part\x3dtrigger]:hover:not(:disabled){background:var(--x-dropdown-trigger-bg-hover);}[part\x3dtrigger]:active:not(:disabled){background:var(--x-dropdown-trigger-bg-active);}[part\x3dtrigger]:disabled{cursor:default;opacity:0.55;}[part\x3dtrigger]:focus-visible{outline:none;box-shadow:0 0 0 2px var(--x-dropdown-focus-ring);}[part\x3dtrigger-label]{flex:1;}[part\x3dchevron]{display:inline-block;color:var(--x-dropdown-chevron-color);font-style:normal;flex-shrink:0;transition:transform 200ms ease;}:host([open]) [part\x3dchevron]{transform:rotate(180deg);}[part\x3dpanel]{position:absolute;z-index:1000;box-sizing:border-box;background:var(--x-dropdown-panel-bg);border:var(--x-dropdown-panel-border);border-radius:var(--x-dropdown-panel-radius);box-shadow:var(--x-dropdown-panel-shadow);padding:var(--x-dropdown-panel-padding);min-width:var(--x-dropdown-panel-min-width);max-width:calc(100vw - 1rem);max-height:var(--x-dropdown-panel-max-height);overflow-y:auto;visibility:hidden;pointer-events:none;opacity:0;transform:scaleY(0.95);transition:opacity var(--x-dropdown-transition-duration) var(--x-dropdown-transition-easing),transform var(--x-dropdown-transition-duration) var(--x-dropdown-transition-easing),visibility 0s var(--x-dropdown-transition-duration);}:host([open]) [part\x3dpanel]{visibility:visible;pointer-events:auto;opacity:1;transform:scaleY(1);transition:opacity var(--x-dropdown-transition-duration) var(--x-dropdown-transition-easing),transform var(--x-dropdown-transition-duration) var(--x-dropdown-transition-easing),visibility 0s 0s;}[part\x3dpanel][data-placement\x3dbottom-start]{top:calc(100% + var(--x-dropdown-panel-offset));left:0;transform-origin:top left;}[part\x3dpanel][data-placement\x3dbottom-end]{top:calc(100% + var(--x-dropdown-panel-offset));right:0;transform-origin:top right;}[part\x3dpanel][data-placement\x3dtop-start]{bottom:calc(100% + var(--x-dropdown-panel-offset));left:0;transform-origin:bottom left;}[part\x3dpanel][data-placement\x3dtop-end]{bottom:calc(100% + var(--x-dropdown-panel-offset));right:0;transform-origin:bottom right;}[part\x3dpanel-inner]{display:contents;}@media (prefers-reduced-motion:reduce){[part\x3dpanel]{transition:none !important;}[part\x3dchevron]{transition:none !important;}}";
|
|
10
10
|
e.setAttribute("part","trigger");e.setAttribute("type","button");e.setAttribute("aria-haspopup","true");e.setAttribute("aria-expanded","false");e.setAttribute("aria-controls","panel");g.setAttribute("part","trigger-label");h.setAttribute("part","chevron");h.setAttribute("aria-hidden","true");h.textContent="▾";l.setAttribute("part","panel");l.setAttribute("id","panel");l.setAttribute("data-placement","bottom-start");m.setAttribute("part","panel-inner");e.appendChild(g);e.appendChild(h);m.appendChild(p);
|
|
11
|
-
l.appendChild(m);c.appendChild(d);c.appendChild(e);c.appendChild(l);this.__xDropdownRefs={trigger:e,label:g,chevron:h,panel:l}}
|
|
12
|
-
|
|
11
|
+
l.appendChild(m);c.appendChild(d);c.appendChild(e);c.appendChild(l);this.__xDropdownRefs={trigger:e,label:g,chevron:h,panel:l}}ur(this);sr(this);this.__xDropdownHandlers=tr(this);d=$APP.k(this,"__xDropdownRefs");$APP.n(d)&&(c=$APP.k(this,"__xDropdownHandlers"),$APP.n(c)&&(d=$APP.k(d,"trigger"),d.addEventListener("click",$APP.k(c,"triggerClick")),d.addEventListener("keydown",$APP.k(c,"triggerKeydown")),this.addEventListener("focusout",$APP.k(c,"hostFocusout"))));$APP.n(this.hasAttribute("open"))&&
|
|
12
|
+
rr(this);return pr(this)};b.disconnectedCallback=function(){ur(this);return sr(this)};b.attributeChangedCallback=function(c){$APP.n($APP.k(this,"__xDropdownRefs"))?(pr(this),c=$APP.B.i(c,"open")?$APP.n(this.hasAttribute("open"))?rr(this):sr(this):null):c=null;return c};return a},zr=function(){return $APP.n(customElements.get("x-dropdown"))?null:customElements.define("x-dropdown",yr())};var or=new $APP.S(null,new $APP.Q(null,4,["bottom-start",null,"bottom-end",null,"top-end",null,"top-start",null],null),null),xr=["open","disabled","label","placement"];$APP.Pd(["x-dropdown-toggle",new $APP.Q(null,2,[$APP.lm,!0,$APP.V,new $APP.Q(null,2,[$APP.im,$APP.Zj,$APP.sl,$APP.Y],null)],null),"x-dropdown-change",new $APP.Q(null,2,[$APP.lm,!1,$APP.V,new $APP.Q(null,1,[$APP.im,$APP.Zj],null)],null)]);$APP.ha("baredom.exports.x_dropdown.init",zr);export const init=zr;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// x-fieldset.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
+
|
|
3
|
+
export function init(): void;
|
|
4
|
+
|
|
5
|
+
export interface XFieldset extends HTMLElement {
|
|
6
|
+
legend: string;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
declare global {
|
|
11
|
+
interface HTMLElementTagNameMap {
|
|
12
|
+
"x-fieldset": XFieldset;
|
|
13
|
+
}
|
|
14
|
+
}
|
package/dist/x-fieldset.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
h:"";l=$APP.F(l);l=new $APP.
|
|
4
|
-
c.removeAttribute("aria-describedby");
|
|
5
|
-
b)):b=this.removeAttribute("legend");return b}})},
|
|
2
|
+
var tH=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},xH=function(a){var b=$APP.k(a,"__xFieldsetRefs");if($APP.n(b)){var c=$APP.k(b,"root-el"),d=$APP.k(b,"legend-el");b=$APP.k(b,"content-el");var e=a.getAttribute("legend");e=new $APP.Q(null,4,[uH,e,$APP.Ol,a.hasAttribute("disabled"),$APP.Uj,a.getAttribute("aria-label"),$APP.Cj,a.getAttribute("aria-describedby")],null);var g=$APP.M(e),h=$APP.D(g,uH);var l=$APP.D(g,$APP.Ol);e=$APP.D(g,$APP.Uj);g=$APP.D(g,$APP.Cj);h=$APP.n(h)?
|
|
3
|
+
h:"";l=$APP.F(l);l=new $APP.Q(null,5,[vH,h,wH,$APP.N(h,""),$APP.X,l,$APP.Ql,e,$APP.$m,g],null);h=vH.g(l);g=wH.g(l);e=$APP.X.g(l);d.textContent=h;$APP.n(g)?d.removeAttribute("hidden"):d.setAttribute("hidden","");d=$APP.Ql.g(l);$APP.n(d)?(c.setAttribute("aria-label",d),c.removeAttribute("aria-labelledby")):(c.removeAttribute("aria-label"),$APP.n(g)?c.setAttribute("aria-labelledby","x-fieldset-legend"):c.removeAttribute("aria-labelledby"));d=$APP.$m.g(l);$APP.n(d)?c.setAttribute("aria-describedby",d):
|
|
4
|
+
c.removeAttribute("aria-describedby");tH(a,"data-disabled",e);return tH(b,"inert",e)}return null},yH=function(a){Object.defineProperty(a,"disabled",{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute("disabled")},set:function(b){return tH(this,"disabled",$APP.F(b))}})},zH=function(a){Object.defineProperty(a,"legend",{configurable:!0,enumerable:!0,get:function(){return this.getAttribute("legend")},set:function(b){b!=null&&$APP.N(b)?(b=""+$APP.T.g(b),b=this.setAttribute("legend",
|
|
5
|
+
b)):b=this.removeAttribute("legend");return b}})},BH=function(){var a=class extends HTMLElement{},b=a.prototype;a.observedAttributes=AH;zH(b);yH(b);b.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xFieldsetRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("div"),g=document.createElement("div"),h=document.createElement("div"),l=document.createElement("slot");d.textContent=":host{display:block;color-scheme:light dark;--x-fieldset-border-color:var(--x-color-border, #d1d5db);--x-fieldset-border-width:1px;--x-fieldset-border-radius:var(--x-radius-md, 8px);--x-fieldset-padding:1rem;--x-fieldset-gap:0.75rem;--x-fieldset-bg:var(--x-color-surface,transparent);--x-fieldset-legend-color:var(--x-color-text-muted,#374151);--x-fieldset-legend-font-size:var(--x-font-size-sm, 0.875rem);--x-fieldset-legend-font-weight:600;--x-fieldset-legend-padding:0 0.375rem;--x-fieldset-disabled-opacity:0.45;--x-fieldset-input-bg:var(--x-color-surface,#ffffff);--x-fieldset-input-color:var(--x-color-text,#0f172a);--x-fieldset-input-border:var(--x-color-border,#d1d5db);--x-fieldset-input-radius:var(--x-radius-sm,0.375rem);--x-fieldset-input-focus:var(--x-color-focus-ring,#60a5fa);}@media (prefers-color-scheme:dark){:host{--x-fieldset-border-color:var(--x-color-border, #374151);--x-fieldset-legend-color:var(--x-color-text-muted,#d1d5db);--x-fieldset-input-bg:var(--x-color-surface,#1f2937);--x-fieldset-input-color:var(--x-color-text,#e5e7eb);--x-fieldset-input-border:var(--x-color-border,#374151);--x-fieldset-input-focus:var(--x-color-focus-ring,#93c5fd);}}[part\x3droot]{display:block;border:var(--x-fieldset-border-width) solid var(--x-fieldset-border-color);border-radius:var(--x-fieldset-border-radius);padding:var(--x-fieldset-padding);background:var(--x-fieldset-bg);position:relative;}:host([data-disabled]) [part\x3droot]{opacity:var(--x-fieldset-disabled-opacity);}[part\x3dlegend]{display:block;position:absolute;top:calc(-0.5em);left:calc(var(--x-fieldset-border-radius) - 0.375rem);padding:var(--x-fieldset-legend-padding);color:var(--x-fieldset-legend-color);font-size:var(--x-fieldset-legend-font-size);font-weight:var(--x-fieldset-legend-font-weight);background:inherit;line-height:1;white-space:nowrap;}[part\x3dlegend][hidden]{display:none;}[part\x3dcontent]{display:flex;flex-direction:column;gap:var(--x-fieldset-gap);}";
|
|
6
6
|
e.setAttribute("part","root");e.setAttribute("role","group");g.setAttribute("part","legend");g.setAttribute("id","x-fieldset-legend");h.setAttribute("part","content");h.appendChild(l);e.appendChild(g);e.appendChild(h);c.appendChild(d);c.appendChild(e);$APP.n(document.getElementById("x-fieldset-input-styles"))||(d=document.createElement("style"),d.setAttribute("id","x-fieldset-input-styles"),d.textContent="x-fieldset input,x-fieldset select,x-fieldset textarea{background:var(--x-fieldset-input-bg);color:var(--x-fieldset-input-color);border:1px solid var(--x-fieldset-input-border);border-radius:var(--x-fieldset-input-radius);padding:0.5rem 0.75rem;font:inherit;outline:none;box-sizing:border-box;}x-fieldset input:focus,x-fieldset select:focus,x-fieldset textarea:focus{border-color:var(--x-fieldset-input-focus);box-shadow:0 0 0 2px var(--x-fieldset-input-focus);}",
|
|
7
|
-
document.head.appendChild(d));this.__xFieldsetRefs={root:c,"root-el":e,"legend-el":g,"content-el":h}}return
|
|
7
|
+
document.head.appendChild(d));this.__xFieldsetRefs={root:c,"root-el":e,"legend-el":g,"content-el":h}}return xH(this)};b.disconnectedCallback=function(){return null};b.attributeChangedCallback=function(){return xH(this)};return a},CH=function(){return $APP.n(customElements.get("x-fieldset"))?null:customElements.define("x-fieldset",BH())},wH=new $APP.K(null,"legend-visible?","legend-visible?",-281107501),uH=new $APP.K(null,"legend-raw","legend-raw",907427195),vH=new $APP.K(null,"legend","legend",-1027192245);var AH=["legend","disabled","aria-label","aria-describedby"];$APP.ha("baredom.exports.x_fieldset.init",CH);export const init=CH;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// x-file-download.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
+
|
|
3
|
+
export function init(): void;
|
|
4
|
+
|
|
5
|
+
export interface XFileDownloadEventMap {
|
|
6
|
+
"x-file-download-click": CustomEvent<{ href: string; filename: string }>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface XFileDownload extends HTMLElement {
|
|
10
|
+
href: string;
|
|
11
|
+
filename: string;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
|
|
14
|
+
addEventListener<K extends keyof XFileDownloadEventMap>(
|
|
15
|
+
type: K,
|
|
16
|
+
listener: (this: XFileDownload, ev: XFileDownloadEventMap[K]) => any,
|
|
17
|
+
options?: boolean | AddEventListenerOptions
|
|
18
|
+
): void;
|
|
19
|
+
addEventListener(
|
|
20
|
+
type: string,
|
|
21
|
+
listener: EventListenerOrEventListenerObject,
|
|
22
|
+
options?: boolean | AddEventListenerOptions
|
|
23
|
+
): void;
|
|
24
|
+
removeEventListener<K extends keyof XFileDownloadEventMap>(
|
|
25
|
+
type: K,
|
|
26
|
+
listener: (this: XFileDownload, ev: XFileDownloadEventMap[K]) => any,
|
|
27
|
+
options?: boolean | EventListenerOptions
|
|
28
|
+
): void;
|
|
29
|
+
removeEventListener(
|
|
30
|
+
type: string,
|
|
31
|
+
listener: EventListenerOrEventListenerObject,
|
|
32
|
+
options?: boolean | EventListenerOptions
|
|
33
|
+
): void;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
declare global {
|
|
37
|
+
interface HTMLElementTagNameMap {
|
|
38
|
+
"x-file-download": XFileDownload;
|
|
39
|
+
}
|
|
40
|
+
}
|
package/dist/x-file-download.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
$APP.k(b,"anchor-el");var c=
|
|
4
|
-
var c=
|
|
5
|
-
b,{configurable:!0,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}})},
|
|
6
|
-
{get:function(){return
|
|
2
|
+
var Lz=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},Pz=function(a){a=new $APP.Q(null,4,[Mz,a.getAttribute("href"),Nz,a.getAttribute("filename"),$APP.Ol,a.hasAttribute("disabled"),$APP.Uj,a.getAttribute("aria-label")],null);var b=$APP.M(a);a=$APP.D(b,Mz);var c=$APP.D(b,Nz),d=$APP.D(b,$APP.Ol);b=$APP.D(b,$APP.Uj);return new $APP.Q(null,4,[$APP.an,$APP.Og(a),Oz,$APP.n(c)?c:"",$APP.X,$APP.F(d),$APP.Ql,b],null)},Qz=function(a){var b=$APP.k(a,"__xFileDownloadRefs");if($APP.n(b)){b=
|
|
3
|
+
$APP.k(b,"anchor-el");var c=Pz(a),d=$APP.an.g(c),e=Oz.g(c),g=$APP.X.g(c);c=$APP.Ql.g(c);b.href=d;typeof e==="string"&&$APP.N(e,"")?b.setAttribute("download",e):(e=typeof d==="string",$APP.n(e?d.startsWith("data:"):e)?b.setAttribute("download",""):b.removeAttribute("download"));$APP.n(g)?b.setAttribute("aria-disabled","true"):b.removeAttribute("aria-disabled");$APP.n(c)?b.setAttribute("aria-label",c):b.removeAttribute("aria-label");return Lz(a,"data-disabled",g)}return null},Rz=function(a){return function(b){if($APP.n(a.hasAttribute("disabled")))return b.preventDefault();
|
|
4
|
+
var c=Pz(a);c={href:$APP.an.g(c),filename:Oz.g(c)};c=new CustomEvent("x-file-download-click",{detail:c,bubbles:!0,composed:!0,cancelable:!0});a.dispatchEvent(c);return $APP.n(c.defaultPrevented)?b.preventDefault():null}},Sz=function(a){var b=$APP.k(a,"__xFileDownloadHandlers"),c=$APP.k(a,"__xFileDownloadRefs");$APP.n($APP.n(b)?c:b)&&(c=$APP.k(c,"anchor-el"),b=$APP.k(b,"click"),$APP.n(b)&&c.removeEventListener("click",b));return a.__xFileDownloadHandlers=null},Tz=function(a,b,c){Object.defineProperty(a,
|
|
5
|
+
b,{configurable:!0,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}})},Uz=function(a){Object.defineProperty(a,"disabled",{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute("disabled")},set:function(b){return Lz(this,"disabled",$APP.F(b))}})},Wz=function(){var a=class extends HTMLElement{},b=a.prototype;Object.defineProperty(a,"observedAttributes",
|
|
6
|
+
{get:function(){return Vz}});Tz(b,"href","href");Tz(b,"filename","filename");Uz(b);b.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xFileDownloadRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("a"),g=document.createElement("span"),h=document.createElement("span"),l=document.createElement("slot");d.textContent=":host{display:inline-block;color-scheme:light dark;--x-file-download-bg:var(--x-color-primary,#2563eb);--x-file-download-color:var(--x-color-surface,#ffffff);--x-file-download-hover-bg:var(--x-color-primary-hover,#1d4ed8);--x-file-download-active-bg:var(--x-color-primary-active,#1e40af);--x-file-download-border-radius:var(--x-radius-md,6px);--x-file-download-padding:0.5rem 1rem;--x-file-download-font-size:var(--x-font-size-sm,0.875rem);--x-file-download-font-weight:500;--x-file-download-gap:0.375rem;--x-file-download-icon-size:1em;--x-file-download-focus-ring:var(--x-color-focus-ring,#60a5fa);--x-file-download-disabled-opacity:0.45;--x-file-download-transition:background var(--x-transition-duration,120ms) ease;}@media (prefers-color-scheme:dark){:host{--x-file-download-bg:var(--x-color-primary,#3b82f6);--x-file-download-hover-bg:var(--x-color-primary-hover,#2563eb);--x-file-download-active-bg:var(--x-color-primary-active,#1d4ed8);--x-file-download-focus-ring:var(--x-color-focus-ring,#93c5fd);}}[part\x3danchor]{display:inline-flex;align-items:center;gap:var(--x-file-download-gap);padding:var(--x-file-download-padding);background:var(--x-file-download-bg);color:var(--x-file-download-color);border-radius:var(--x-file-download-border-radius);font-size:var(--x-file-download-font-size);font-weight:var(--x-file-download-font-weight);text-decoration:none;cursor:pointer;box-sizing:border-box;transition:var(--x-file-download-transition);outline:none;user-select:none;-webkit-user-select:none;}[part\x3danchor]:hover{background:var(--x-file-download-hover-bg);}[part\x3danchor]:active{background:var(--x-file-download-active-bg);}[part\x3danchor]:focus-visible{outline:2px solid var(--x-file-download-focus-ring);outline-offset:2px;}[part\x3dicon]{display:inline-flex;align-items:center;justify-content:center;width:var(--x-file-download-icon-size);height:var(--x-file-download-icon-size);flex-shrink:0;}[part\x3dcontent]{display:inline;}:host([data-disabled]) [part\x3danchor]{opacity:var(--x-file-download-disabled-opacity);pointer-events:none;cursor:default;}@media (prefers-reduced-motion:reduce){[part\x3danchor]{transition:none;}}";
|
|
7
7
|
e.setAttribute("part","anchor");g.setAttribute("part","icon");h.setAttribute("part","content");g.innerHTML='\x3csvg xmlns\x3d"http://www.w3.org/2000/svg" viewBox\x3d"0 0 16 16" fill\x3d"currentColor" width\x3d"1em" height\x3d"1em" aria-hidden\x3d"true"\x3e\x3cpath d\x3d"M8 1a.75.75 0 0 1 .75.75v6.19l1.97-1.97a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.03a.75.75 0 0 1 1.06-1.06L7.25 7.94V1.75A.75.75 0 0 1 8 1ZM2.5 13.25a.75.75 0 0 1 .75-.75h9.5a.75.75 0 0 1 0 1.5h-9.5a.75.75 0 0 1-.75-.75Z"/\x3e\x3c/svg\x3e';
|
|
8
|
-
h.appendChild(l);e.appendChild(g);e.appendChild(h);c.appendChild(d);c.appendChild(e);this.__xFileDownloadRefs={"anchor-el":e,"icon-el":g,"content-el":h}}
|
|
9
|
-
|
|
8
|
+
h.appendChild(l);e.appendChild(g);e.appendChild(h);c.appendChild(d);c.appendChild(e);this.__xFileDownloadRefs={"anchor-el":e,"icon-el":g,"content-el":h}}Sz(this);c=Rz(this);$APP.k($APP.k(this,"__xFileDownloadRefs"),"anchor-el").addEventListener("click",c);this.__xFileDownloadHandlers={click:c};return Qz(this)};b.disconnectedCallback=function(){return Sz(this)};b.attributeChangedCallback=function(){return Qz(this)};return a},Xz=function(){return $APP.n(customElements.get("x-file-download"))?null:customElements.define("x-file-download",
|
|
9
|
+
Wz())},Nz=new $APP.K(null,"filename-raw","filename-raw",-706184256),Mz=new $APP.K(null,"href-raw","href-raw",-1680949453),Oz=new $APP.K(null,"filename","filename",-1428840783);var Vz=["href","filename","disabled","aria-label"];$APP.Pd(["x-file-download-click",new $APP.Q(null,2,[$APP.lm,!0,$APP.V,new $APP.Q(null,2,[$APP.an,$APP.Y,Oz,$APP.Y],null)],null)]);$APP.ha("baredom.exports.x_file_download.init",Xz);export const init=Xz;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// x-file-upload.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
+
|
|
3
|
+
export function init(): void;
|
|
4
|
+
|
|
5
|
+
export interface XFileUploadEventMap {
|
|
6
|
+
"x-file-upload-select": CustomEvent<{ files: any; rejected: any }>;
|
|
7
|
+
"x-file-upload-remove": CustomEvent<{ file: Record<string, any>; remaining: any }>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface XFileUpload extends HTMLElement {
|
|
11
|
+
accept: string;
|
|
12
|
+
multiple: boolean;
|
|
13
|
+
maxSize: number;
|
|
14
|
+
maxFiles: number;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
required: boolean;
|
|
17
|
+
name: string;
|
|
18
|
+
readonly files: any;
|
|
19
|
+
|
|
20
|
+
addEventListener<K extends keyof XFileUploadEventMap>(
|
|
21
|
+
type: K,
|
|
22
|
+
listener: (this: XFileUpload, ev: XFileUploadEventMap[K]) => any,
|
|
23
|
+
options?: boolean | AddEventListenerOptions
|
|
24
|
+
): void;
|
|
25
|
+
addEventListener(
|
|
26
|
+
type: string,
|
|
27
|
+
listener: EventListenerOrEventListenerObject,
|
|
28
|
+
options?: boolean | AddEventListenerOptions
|
|
29
|
+
): void;
|
|
30
|
+
removeEventListener<K extends keyof XFileUploadEventMap>(
|
|
31
|
+
type: K,
|
|
32
|
+
listener: (this: XFileUpload, ev: XFileUploadEventMap[K]) => any,
|
|
33
|
+
options?: boolean | EventListenerOptions
|
|
34
|
+
): void;
|
|
35
|
+
removeEventListener(
|
|
36
|
+
type: string,
|
|
37
|
+
listener: EventListenerOrEventListenerObject,
|
|
38
|
+
options?: boolean | EventListenerOptions
|
|
39
|
+
): void;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare global {
|
|
43
|
+
interface HTMLElementTagNameMap {
|
|
44
|
+
"x-file-upload": XFileUpload;
|
|
45
|
+
}
|
|
46
|
+
}
|
package/dist/x-file-upload.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
c.startsWith(""+$APP.T.g(e)+"/")):$APP.B.i(e,c)},b))}
|
|
4
|
-
[
|
|
5
|
-
a=$APP.D(b,
|
|
6
|
-
e.setAttribute("accept",a);$APP.n(d)?e.setAttribute("multiple",""):e.removeAttribute("multiple");b.setAttribute("tabindex",$APP.n(c)?"-1":"0");a=""+$APP.T.g(c);return b.setAttribute("aria-disabled",a)}return null},
|
|
7
|
-
$APP.w(b),b=null,c=0),d=0;else return null},
|
|
2
|
+
var Iv=function(a){return a!=null?(a=parseInt(a,10),$APP.r(isNaN(a))&&a>0?a:null):null},Jv=function(a){var b=a.lastIndexOf(".");return b>0?a.substring(b).toLowerCase():null},Kv=function(a,b){if(b==null||$APP.B.i(b,""))return!0;var c=function(){var e=a.type;return $APP.n(e)?e:""}().toLowerCase(),d=Jv(a.name);b=$APP.ae.i($APP.Jg,$APP.Hg(b,/,/));return $APP.F($APP.Td(function(e){e=e.toLowerCase();return $APP.n(e.startsWith("."))?$APP.B.i(e,d):$APP.n(e.endsWith("/*"))?(e=e.substring(0,e.indexOf("/")),
|
|
3
|
+
c.startsWith(""+$APP.T.g(e)+"/")):$APP.B.i(e,c)},b))},bw=function(a,b,c,d,e){a=$APP.t(a);for(var g=$APP.fe,h=$APP.fe;;){if($APP.r(a))return new $APP.Q(null,2,[Zv,g,$v,h],null);var l=$APP.u(a);var m=l;var p=b,q=c;m=$APP.Lg(p)&&!Kv(m,p)?new $APP.Q(null,2,[$APP.Th,!1,$APP.Qi,"File type not accepted"],null):q!=null&&m.size>q?new $APP.Q(null,2,[$APP.Th,!1,$APP.Qi,"File too large"],null):new $APP.Q(null,2,[$APP.Th,!0,$APP.Qi,null],null);$APP.r($APP.Th.g(m))?(a=$APP.w(a),h=$APP.ld.i(h,new $APP.Q(null,2,
|
|
4
|
+
[aw,l,$APP.Qi,$APP.Qi.g(m)],null))):d!=null&&e>=d?(a=$APP.w(a),h=$APP.ld.i(h,new $APP.Q(null,2,[aw,l,$APP.Qi,"Maximum files reached"],null))):(a=$APP.w(a),g=$APP.ld.i(g,l),e+=1)}},cw=function(a){return document.createElement(a)},lw=function(a){a=new $APP.Q(null,7,[dw,a.getAttribute("accept"),ew,a.hasAttribute("multiple"),fw,a.getAttribute("max-size"),gw,a.getAttribute("max-files"),$APP.Ol,a.hasAttribute("disabled"),$APP.Nh,a.hasAttribute("required"),$APP.Al,a.getAttribute("name")],null);var b=$APP.M(a);
|
|
5
|
+
a=$APP.D(b,dw);var c=$APP.D(b,ew),d=$APP.D(b,fw),e=$APP.D(b,gw),g=$APP.D(b,$APP.Ol),h=$APP.D(b,$APP.Nh);b=$APP.D(b,$APP.Al);return new $APP.Q(null,7,[hw,$APP.n(a)?a:"",iw,$APP.F(c),jw,Iv(d),kw,Iv(e),$APP.X,$APP.F(g),$APP.mi,$APP.F(h),$APP.Aj,$APP.n(b)?b:""],null)},mw=function(a){var b=$APP.k(a,"__xFileUploadRefs");if($APP.n(b)){a=lw(a);var c=$APP.M(a);a=$APP.D(c,hw);var d=$APP.D(c,iw);c=$APP.D(c,$APP.X);var e=$APP.k(b,"fileInput");b=$APP.k(b,"dropZone");$APP.B.i(a,"")?e.removeAttribute("accept"):
|
|
6
|
+
e.setAttribute("accept",a);$APP.n(d)?e.setAttribute("multiple",""):e.removeAttribute("multiple");b.setAttribute("tabindex",$APP.n(c)?"-1":"0");a=""+$APP.T.g(c);return b.setAttribute("aria-disabled",a)}return null},nw=function(a){a=$APP.t($APP.uc(a.querySelectorAll("[part\x3dthumbnail]")));for(var b=null,c=0,d=0;;)if(d<c){var e=b.F(null,d);URL.revokeObjectURL(e.src);d+=1}else if(a=$APP.t(a))b=a,$APP.Nc(b)?(a=$APP.yb(b),c=$APP.zb(b),b=a,e=$APP.z(a),a=c,c=e):(e=$APP.u(b),URL.revokeObjectURL(e.src),a=
|
|
7
|
+
$APP.w(b),b=null,c=0),d=0;else return null},ow=function(a){var b=$APP.k(a,"__xFileUploadRefs");if($APP.n(b)){var c=$APP.k(b,"fileList");b=$APP.k(b,"liveRegion");a=$APP.k(a,"__xFileUploadFiles");var d=a.length;nw(c);c.textContent="";for(var e=0;;)if(e<d){var g=a[e],h=cw("div"),l=cw("span"),m=cw("span"),p=cw("button"),q=g.name;h.setAttribute("part","file-item");h.setAttribute("role","listitem");var v=g.type,x=typeof v==="string";$APP.n(x?v.startsWith("image/"):x)&&(v=cw("img"),v.setAttribute("part",
|
|
8
8
|
"thumbnail"),v.src=URL.createObjectURL(g),v.setAttribute("alt",q),h.appendChild(v));l.setAttribute("part","file-name");l.textContent=q;m.setAttribute("part","file-size");v=m;g=g.size;g=g<1024?""+$APP.T.g(g)+" B":g<1048576?""+$APP.T.g((g/1024).toFixed(1))+" KB":g<1073741824?""+$APP.T.g((g/1048576).toFixed(1))+" MB":""+$APP.T.g((g/1073741824).toFixed(1))+" GB";v.textContent=g;p.setAttribute("part","remove");p.setAttribute("type","button");g=p;q="Remove "+$APP.T.g(q);g.setAttribute("aria-label",q);q=
|
|
9
|
-
p;g=""+$APP.T.g(e);q.setAttribute("data-index",g);p.textContent="×";h.appendChild(l);h.appendChild(m);h.appendChild(p);c.appendChild(h);e+=1}else break;b.textContent=d===0?"":""+$APP.T.g(d)+" file"+$APP.T.g($APP.N(d,1)?"s":null)+" selected"}},
|
|
10
|
-
g+=1;else break;b.setFormValue(d)}}},
|
|
11
|
-
b){var c=
|
|
12
|
-
"x-file-upload-select",{files:$APP.zd(b),rejected:$APP.zd($APP.ae.i(function(p){var q=$APP.M(p);p=$APP.D(q,
|
|
13
|
-
$APP.n(b)?$APP.k(b,"fileInput").click():null):null},fileChange:function(b){b=b.target;var c=b.files;c.length>0&&
|
|
14
|
-
b;return b<=0?(a.__xFileUploadDragCtr=0,a.removeAttribute("data-drag-over")):null},drop:function(b){b.preventDefault();a.__xFileUploadDragCtr=0;a.removeAttribute("data-drag-over");if($APP.n(a.hasAttribute("disabled")))return null;b=b.dataTransfer.files;return b.length>0?
|
|
15
|
-
d=c[b];c.splice(b,1);
|
|
16
|
-
$APP.k(a,"dragover"));c.removeEventListener("dragleave",$APP.k(a,"dragleave"));c.removeEventListener("drop",$APP.k(a,"drop"));d.removeEventListener("change",$APP.k(a,"fileChange"));b.removeEventListener("click",$APP.k(a,"fileListClick"))}},
|
|
17
|
-
this.getAttribute(c);return $APP.n(d)?d:""},set:function(d){return d!=null&&$APP.N(d)?this.setAttribute(c,""+$APP.T.g(d)):this.removeAttribute(c)}})},
|
|
18
|
-
!0;Object.defineProperty(a,"observedAttributes",{get:function(){return
|
|
19
|
-
c.checkValidity():null};b.reportValidity=function(){var c=$APP.k(this,"__xFileUploadInternals");return $APP.n(c)?c.reportValidity():null};b.formDisabledCallback=function(c){$APP.Eg(this,"disabled",c);return
|
|
20
|
-
d=
|
|
9
|
+
p;g=""+$APP.T.g(e);q.setAttribute("data-index",g);p.textContent="×";h.appendChild(l);h.appendChild(m);h.appendChild(p);c.appendChild(h);e+=1}else break;b.textContent=d===0?"":""+$APP.T.g(d)+" file"+$APP.T.g($APP.N(d,1)?"s":null)+" selected"}},pw=function(a){var b=$APP.k(a,"__xFileUploadInternals");if($APP.n(b)){var c=$APP.k(a,"__xFileUploadFiles");a=a.getAttribute("name");a=$APP.n(a)?a:"file";if(c.length===0)b.setFormValue(null);else{for(var d=new FormData,e=c.length,g=0;;)if(g<e)d.append(a,c[g]),
|
|
10
|
+
g+=1;else break;b.setFormValue(d)}}},qw=function(a){var b=$APP.k(a,"__xFileUploadInternals");if($APP.n(b)){var c=$APP.k(a,"__xFileUploadRefs");if($APP.n(c)){var d=a.hasAttribute("required");a=$APP.k(a,"__xFileUploadFiles");c=$APP.k(c,"dropZone");return $APP.n($APP.n(d)?a.length===0:d)?b.setValidity({valueMissing:!0},"Please select a file.",c):b.setValidity({},"")}}return null},rw=function(a,b,c){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:!1}))},sw=function(a,
|
|
11
|
+
b){var c=lw(a);c=$APP.M(c);var d=$APP.D(c,hw),e=$APP.D(c,iw),g=$APP.D(c,jw),h=$APP.D(c,kw);c=$APP.k(a,"__xFileUploadFiles");b=bw($APP.uc(b),d,g,h,c.length);d=$APP.M(b);b=$APP.D(d,Zv);d=$APP.D(d,$v);if($APP.n(e)){e=$APP.t(b);g=null;for(var l=h=0;;)if(l<h){var m=g.F(null,l);c.push(m);l+=1}else if(e=$APP.t(e))g=e,$APP.Nc(g)?(e=$APP.yb(g),l=$APP.zb(g),g=e,h=$APP.z(e),e=l):(e=$APP.u(g),c.push(e),e=$APP.w(g),g=null,h=0),l=0;else break}else c.length=0,$APP.t(b)&&c.push($APP.u(b));ow(a);pw(a);qw(a);return rw(a,
|
|
12
|
+
"x-file-upload-select",{files:$APP.zd(b),rejected:$APP.zd($APP.ae.i(function(p){var q=$APP.M(p);p=$APP.D(q,aw);q=$APP.D(q,$APP.Qi);return{file:p,reason:q}},d))})},tw=function(a){return{zoneClick:function(){if($APP.n(a.hasAttribute("disabled")))return null;var b=$APP.k(a,"__xFileUploadRefs");return $APP.n(b)?$APP.k(b,"fileInput").click():null},zoneKeydown:function(b){return($APP.B.i(b.key,"Enter")||$APP.B.i(b.key," "))&&$APP.r(a.hasAttribute("disabled"))?(b.preventDefault(),b=$APP.k(a,"__xFileUploadRefs"),
|
|
13
|
+
$APP.n(b)?$APP.k(b,"fileInput").click():null):null},fileChange:function(b){b=b.target;var c=b.files;c.length>0&&sw(a,c);return b.value=""},dragenter:function(b){b.preventDefault();if($APP.n(a.hasAttribute("disabled")))return null;b=$APP.k(a,"__xFileUploadDragCtr")+1;a.__xFileUploadDragCtr=b;return $APP.B.i(b,1)?a.setAttribute("data-drag-over",""):null},dragover:function(b){b.preventDefault();return b.dataTransfer.dropEffect="copy"},dragleave:function(){var b=$APP.k(a,"__xFileUploadDragCtr")-1;a.__xFileUploadDragCtr=
|
|
14
|
+
b;return b<=0?(a.__xFileUploadDragCtr=0,a.removeAttribute("data-drag-over")):null},drop:function(b){b.preventDefault();a.__xFileUploadDragCtr=0;a.removeAttribute("data-drag-over");if($APP.n(a.hasAttribute("disabled")))return null;b=b.dataTransfer.files;return b.length>0?sw(a,b):null},fileListClick:function(b){b=b.target;b=$APP.n(b.hasAttribute("data-index"))?b:b.closest("[data-index]");if($APP.n(b)){b=parseInt(b.getAttribute("data-index"),10);if($APP.n(isNaN(b)))b=null;else{var c=$APP.k(a,"__xFileUploadFiles"),
|
|
15
|
+
d=c[b];c.splice(b,1);ow(a);pw(a);qw(a);b=rw(a,"x-file-upload-remove",{file:d,remaining:c.slice()})}return b}return null}}},uw=function(a){var b=$APP.k(a,"__xFileUploadRefs");if($APP.n(b)&&(a=$APP.k(a,"__xFileUploadHandlers"),$APP.n(a))){var c=$APP.k(b,"dropZone"),d=$APP.k(b,"fileInput");b=$APP.k(b,"fileList");c.removeEventListener("click",$APP.k(a,"zoneClick"));c.removeEventListener("keydown",$APP.k(a,"zoneKeydown"));c.removeEventListener("dragenter",$APP.k(a,"dragenter"));c.removeEventListener("dragover",
|
|
16
|
+
$APP.k(a,"dragover"));c.removeEventListener("dragleave",$APP.k(a,"dragleave"));c.removeEventListener("drop",$APP.k(a,"drop"));d.removeEventListener("change",$APP.k(a,"fileChange"));b.removeEventListener("click",$APP.k(a,"fileListClick"))}},vw=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return $APP.Eg(this,c,$APP.F(d))}})},ww=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){var d=
|
|
17
|
+
this.getAttribute(c);return $APP.n(d)?d:""},set:function(d){return d!=null&&$APP.N(d)?this.setAttribute(c,""+$APP.T.g(d)):this.removeAttribute(c)}})},xw=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){var d=this.getAttribute(c);return d!=null?(d=parseInt(d,10),$APP.n(isNaN(d))?null:d):null},set:function(d){return d!=null&&$APP.N(d)?this.setAttribute(c,""+$APP.T.g(d)):this.removeAttribute(c)}})},zw=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=
|
|
18
|
+
!0;Object.defineProperty(a,"observedAttributes",{get:function(){return yw}});ww(b,"accept","accept");ww(b,"name","name");vw(b,"multiple","multiple");vw(b,"disabled","disabled");vw(b,"required","required");xw(b,"maxSize","max-size");xw(b,"maxFiles","max-files");Object.defineProperty(b,"files",{configurable:!0,enumerable:!0,get:function(){var c=$APP.k(this,"__xFileUploadFiles");return($APP.n(c)?c:[]).slice()}});b.checkValidity=function(){var c=$APP.k(this,"__xFileUploadInternals");return $APP.n(c)?
|
|
19
|
+
c.checkValidity():null};b.reportValidity=function(){var c=$APP.k(this,"__xFileUploadInternals");return $APP.n(c)?c.reportValidity():null};b.formDisabledCallback=function(c){$APP.Eg(this,"disabled",c);return mw(this)};b.formResetCallback=function(){$APP.k(this,"__xFileUploadFiles").length=0;var c=$APP.k(this,"__xFileUploadRefs");$APP.n(c)&&nw($APP.k(c,"fileList"));ow(this);pw(this);return qw(this)};b.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xFileUploadRefs"))){var c=this.attachShadow({mode:"open"}),
|
|
20
|
+
d=cw("style"),e=cw("div"),g=cw("input"),h=cw("div"),l=cw("slot"),m=cw("div"),p=cw("div"),q=cw("div");d.textContent=":host{display:block;box-sizing:border-box;color-scheme:light dark;--x-file-upload-bg:var(--x-color-surface,#ffffff);--x-file-upload-fg:var(--x-color-text,#0f172a);--x-file-upload-muted:var(--x-color-text-muted,#64748b);--x-file-upload-border:2px dashed var(--x-color-border,#cbd5e1);--x-file-upload-border-hover:2px dashed var(--x-color-primary,#3b82f6);--x-file-upload-drag-bg:var(--x-color-primary,rgba(59,130,246,0.05));--x-file-upload-radius:var(--x-radius-md,8px);--x-file-upload-padding:var(--x-space-lg,24px);--x-file-upload-font-size:var(--x-font-size-sm,0.9375rem);--x-file-upload-focus-ring:var(--x-color-focus-ring,#60a5fa);--x-file-upload-disabled-opacity:var(--x-opacity-disabled,0.55);--x-file-upload-transition-duration:var(--x-transition-duration,150ms);--x-file-upload-item-bg:var(--x-color-surface,#f8fafc);--x-file-upload-item-border:1px solid var(--x-color-border,#e2e8f0);--x-file-upload-thumb-size:48px;--x-file-upload-remove-color:var(--x-color-text-muted,#64748b);--x-file-upload-remove-hover:var(--x-color-danger,#ef4444);}@media (prefers-color-scheme:dark){:host{--x-file-upload-bg:var(--x-color-surface,#1e293b);--x-file-upload-fg:var(--x-color-text,#e2e8f0);--x-file-upload-muted:var(--x-color-text-muted,#94a3b8);--x-file-upload-border:2px dashed var(--x-color-border,#334155);--x-file-upload-border-hover:2px dashed var(--x-color-primary,#60a5fa);--x-file-upload-drag-bg:rgba(96,165,250,0.08);--x-file-upload-focus-ring:var(--x-color-focus-ring,#93c5fd);--x-file-upload-item-bg:var(--x-color-surface,#1e293b);--x-file-upload-item-border:1px solid var(--x-color-border,#334155);--x-file-upload-remove-color:var(--x-color-text-muted,#94a3b8);}}[part\x3ddrop-zone]{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:120px;padding:var(--x-file-upload-padding);background:var(--x-file-upload-bg);border:var(--x-file-upload-border);border-radius:var(--x-file-upload-radius);cursor:pointer;text-align:center;color:var(--x-file-upload-muted);font-size:var(--x-file-upload-font-size);font-family:inherit;transition:border-color var(--x-file-upload-transition-duration) ease,background var(--x-file-upload-transition-duration) ease;}[part\x3ddrop-zone]:hover{border:var(--x-file-upload-border-hover);}[part\x3ddrop-zone]:focus-visible{outline:none;box-shadow:0 0 0 2px var(--x-file-upload-focus-ring);}:host([data-drag-over]) [part\x3ddrop-zone]{border:var(--x-file-upload-border-hover);background:var(--x-file-upload-drag-bg);}:host([data-drag-over]) [part\x3dcontent]{visibility:hidden;}:host([data-drag-over]) [part\x3ddrag-overlay]{display:flex;}[part\x3ddrag-overlay]{display:none;position:absolute;inset:0;align-items:center;justify-content:center;border-radius:var(--x-file-upload-radius);font-weight:600;color:var(--x-color-primary,#3b82f6);pointer-events:none;}:host([disabled]){pointer-events:none;cursor:default;}:host([disabled]) [part\x3ddrop-zone]{opacity:var(--x-file-upload-disabled-opacity);}[part\x3dfile-list]{display:flex;flex-direction:column;gap:8px;margin-top:12px;}[part\x3dfile-list]:empty{display:none;}[part\x3dfile-item]{display:flex;align-items:center;gap:12px;padding:8px 12px;background:var(--x-file-upload-item-bg);border:var(--x-file-upload-item-border);border-radius:6px;font-size:var(--x-file-upload-font-size);font-family:inherit;color:var(--x-file-upload-fg);}[part\x3dthumbnail]{width:var(--x-file-upload-thumb-size);height:var(--x-file-upload-thumb-size);object-fit:cover;border-radius:4px;flex-shrink:0;}[part\x3dfile-name]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}[part\x3dfile-size]{color:var(--x-file-upload-muted);font-size:0.8125rem;flex-shrink:0;}[part\x3dremove]{all:unset;display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;font-size:1rem;color:var(--x-file-upload-remove-color);cursor:pointer;border-radius:4px;flex-shrink:0;}[part\x3dremove]:hover{color:var(--x-file-upload-remove-hover);}[part\x3dremove]:focus-visible{outline:none;box-shadow:0 0 0 2px var(--x-file-upload-focus-ring);}[part\x3dlive-region]{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);}input[type\x3dfile]{display:none;}@media (prefers-reduced-motion:reduce){[part\x3ddrop-zone]{transition:none !important;}}@media (pointer:coarse){[part\x3ddrop-zone]{min-height:140px;}[part\x3dremove]{width:2.75rem;height:2.75rem;}}";
|
|
21
21
|
e.setAttribute("part","drop-zone");e.setAttribute("role","button");e.setAttribute("tabindex","0");g.setAttribute("type","file");g.setAttribute("aria-hidden","true");g.setAttribute("tabindex","-1");h.setAttribute("part","content");h.appendChild(l);m.setAttribute("part","drag-overlay");m.setAttribute("hidden","");m.textContent="Drop files here";p.setAttribute("part","file-list");p.setAttribute("role","list");q.setAttribute("part","live-region");q.setAttribute("aria-live","polite");q.setAttribute("aria-atomic",
|
|
22
|
-
"true");e.appendChild(g);e.appendChild(h);e.appendChild(m);c.appendChild(d);c.appendChild(e);c.appendChild(p);c.appendChild(q);this.__xFileUploadFiles=[];this.__xFileUploadDragCtr=0;this.__xFileUploadRefs={dropZone:e,fileInput:g,content:h,dragOverlay:m,fileList:p,liveRegion:q}}c=this.attachInternals;$APP.n($APP.n(c)?$APP.r($APP.k(this,"__xFileUploadInternals")):c)&&(this.__xFileUploadInternals=this.attachInternals());
|
|
22
|
+
"true");e.appendChild(g);e.appendChild(h);e.appendChild(m);c.appendChild(d);c.appendChild(e);c.appendChild(p);c.appendChild(q);this.__xFileUploadFiles=[];this.__xFileUploadDragCtr=0;this.__xFileUploadRefs={dropZone:e,fileInput:g,content:h,dragOverlay:m,fileList:p,liveRegion:q}}c=this.attachInternals;$APP.n($APP.n(c)?$APP.r($APP.k(this,"__xFileUploadInternals")):c)&&(this.__xFileUploadInternals=this.attachInternals());uw(this);this.__xFileUploadHandlers=tw(this);g=$APP.k(this,"__xFileUploadRefs");
|
|
23
23
|
$APP.n(g)&&(c=$APP.k(this,"__xFileUploadHandlers"),$APP.n(c)&&(d=$APP.k(g,"dropZone"),e=$APP.k(g,"fileInput"),g=$APP.k(g,"fileList"),d.addEventListener("click",$APP.k(c,"zoneClick")),d.addEventListener("keydown",$APP.k(c,"zoneKeydown")),d.addEventListener("dragenter",$APP.k(c,"dragenter")),d.addEventListener("dragover",$APP.k(c,"dragover")),d.addEventListener("dragleave",$APP.k(c,"dragleave")),d.addEventListener("drop",$APP.k(c,"drop")),e.addEventListener("change",$APP.k(c,"fileChange")),g.addEventListener("click",
|
|
24
|
-
$APP.k(c,"fileListClick"))));
|
|
25
|
-
231052999),
|
|
26
|
-
-244409320);var
|
|
24
|
+
$APP.k(c,"fileListClick"))));mw(this);return qw(this)};b.disconnectedCallback=function(){uw(this);var c=$APP.k(this,"__xFileUploadRefs");return $APP.n(c)?nw($APP.k(c,"fileList")):null};b.attributeChangedCallback=function(){return $APP.n($APP.k(this,"__xFileUploadRefs"))?mw(this):null};return a},Aw=function(){return $APP.n(customElements.get("x-file-upload"))?null:customElements.define("x-file-upload",zw())},hw=new $APP.K(null,"accept","accept",1874130431),$v=new $APP.K(null,"rejected","rejected",
|
|
25
|
+
231052999),Zv=new $APP.K(null,"accepted","accepted",-1953464374),fw=new $APP.K(null,"max-size-raw","max-size-raw",1536077032),jw=new $APP.K(null,"max-size","max-size",-874966132),iw=new $APP.K(null,"multiple?","multiple?",-490002283),dw=new $APP.K(null,"accept-raw","accept-raw",1407413888),kw=new $APP.K(null,"max-files","max-files",534742526),ew=new $APP.K(null,"multiple-present?","multiple-present?",-1754894397),aw=new $APP.K(null,"file","file",-1269645878),gw=new $APP.K(null,"max-files-raw","max-files-raw",
|
|
26
|
+
-244409320);var yw="accept multiple max-size max-files disabled required name".split(" ");$APP.Pd(["x-file-upload-select",new $APP.Q(null,2,[$APP.lm,!1,$APP.V,new $APP.Q(null,2,[new $APP.K(null,"files","files",-472457450),$APP.Si,$v,$APP.Si],null)],null),"x-file-upload-remove",new $APP.Q(null,2,[$APP.lm,!1,$APP.V,new $APP.Q(null,2,[aw,$APP.jl,new $APP.K(null,"remaining","remaining",-138926777),$APP.Si],null)],null)]);$APP.ha("baredom.exports.x_file_upload.init",Aw);export const init=Aw;
|