@mhmo91/schmancy 0.2.43 → 0.2.45

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/dist/card.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";require("./teleport.component-B_fXeDDQ.cjs");
1
+ "use strict";require("./teleport.component-D8OSIPGk.cjs");
2
2
  //# sourceMappingURL=card.cjs.map
package/dist/card.js CHANGED
@@ -1,2 +1,2 @@
1
- import "./teleport.component-CoGQ6xi-.js";
1
+ import "./teleport.component-BwflD2xY.js";
2
2
  //# sourceMappingURL=card.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./teleport.component-B_fXeDDQ.cjs");Object.defineProperty(exports,"SchmancyContentDrawer",{enumerable:!0,get:()=>e.SchmancyContentDrawer}),exports.SchmancyContentDrawerID=e.SchmancyContentDrawerID,Object.defineProperty(exports,"SchmancyContentDrawerMain",{enumerable:!0,get:()=>e.SchmancyContentDrawerMain}),exports.SchmancyContentDrawerMaxHeight=e.SchmancyContentDrawerMaxHeight,exports.SchmancyContentDrawerMinWidth=e.SchmancyContentDrawerMinWidth,Object.defineProperty(exports,"SchmancyContentDrawerSheet",{enumerable:!0,get:()=>e.SchmancyContentDrawerSheet}),exports.SchmancyContentDrawerSheetMode=e.SchmancyContentDrawerSheetMode,exports.SchmancyContentDrawerSheetState=e.SchmancyContentDrawerSheetState,exports.schmancyContentDrawer=e.schmancyContentDrawer;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./teleport.component-D8OSIPGk.cjs");Object.defineProperty(exports,"SchmancyContentDrawer",{enumerable:!0,get:()=>e.SchmancyContentDrawer}),exports.SchmancyContentDrawerID=e.SchmancyContentDrawerID,Object.defineProperty(exports,"SchmancyContentDrawerMain",{enumerable:!0,get:()=>e.SchmancyContentDrawerMain}),exports.SchmancyContentDrawerMaxHeight=e.SchmancyContentDrawerMaxHeight,exports.SchmancyContentDrawerMinWidth=e.SchmancyContentDrawerMinWidth,Object.defineProperty(exports,"SchmancyContentDrawerSheet",{enumerable:!0,get:()=>e.SchmancyContentDrawerSheet}),exports.SchmancyContentDrawerSheetMode=e.SchmancyContentDrawerSheetMode,exports.SchmancyContentDrawerSheetState=e.SchmancyContentDrawerSheetState,exports.schmancyContentDrawer=e.schmancyContentDrawer;
2
2
  //# sourceMappingURL=content-drawer.cjs.map
@@ -1,4 +1,4 @@
1
- import { e as n, b as t, f as r, c, d as h, g as S, S as o, a as s, s as m } from "./teleport.component-CoGQ6xi-.js";
1
+ import { e as n, b as t, f as r, c, d as h, g as S, S as o, a as s, s as m } from "./teleport.component-BwflD2xY.js";
2
2
  export {
3
3
  n as SchmancyContentDrawer,
4
4
  t as SchmancyContentDrawerID,
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("./animated-text-CHKjskbo.cjs");const r=require("./area.component-PjmcLIgT.cjs");require("./autocomplete-sjP09kRE.cjs"),require("./spinner-BQV8GutW.cjs");const o=require("./icon-button-C3lDDtmo.cjs"),e=require("./teleport.component-B_fXeDDQ.cjs"),S=require("./checkbox-BlyeBJaT.cjs");require("./chips-B5s6nFCv.cjs");const u=require("./payment-card-form-BC-KTuAM.cjs");require("./date-range-DdwMl-RM.cjs");const y=require("./delay-C7mn_Xn7.cjs"),n=require("./ripple-C2BHbhcS.cjs");require("./divider-BCpoxMEa.cjs"),require("./form-2b-1v-m1.cjs"),require("./icon-C-Un0Yey.cjs"),require("./input-1mohwkxJ.cjs");const c=require("./scroll-DJQVW4VV.cjs"),m=require("./list-DM_Y-zwH.cjs");require("./menu-1oIiQdXk.cjs");const a=require("./outlet-grvppFfL.cjs");require("./option-P1eP1gPa.cjs");const b=require("./radio-group-DJ15xUxA.cjs"),l=require("./rxjs-utils.cjs");require("rxjs"),require("./index-DyJ0oDpR.cjs");const d=require("./select-CV5sua6X.cjs"),t=require("./sheet-DEi77u64.cjs"),h=require("./slider-BVqs9NxT.cjs"),p=require("./surface-DI0zgakM.cjs");require("./table-Dupu_sw5.cjs"),require("./tabs-group-C3A9t09Q.cjs"),require("./textarea-08CHLJIt.cjs");const i=require("./theme.component-CQZlNAYr.cjs"),g=require("./theme.interface-Xg5Zi46a.cjs");require("./theme-button-DIq9Bwd6.cjs");const f=require("./tree-BeLMM0l5.cjs"),q=require("./types.cjs"),O=require("./typewriter-DPSbDZLc.cjs"),w=require("./typography-BbLaRssU.cjs");exports.FINDING_MORTIES=r.FINDING_MORTIES,exports.HERE_RICKY=r.HERE_RICKY,exports.HISTORY_STRATEGY=r.HISTORY_STRATEGY,Object.defineProperty(exports,"SchmancyArea",{enumerable:!0,get:()=>r.SchmancyArea}),exports.area=r.area,exports.routerHistory=r.routerHistory,Object.defineProperty(exports,"SchmancyButton",{enumerable:!0,get:()=>o.SchmancyButton}),Object.defineProperty(exports,"SchmnacyIconButton",{enumerable:!0,get:()=>o.SchmnacyIconButton}),exports.$drawer=e.$drawer,exports.HereMorty=e.HereMorty,Object.defineProperty(exports,"SchmancyContentDrawer",{enumerable:!0,get:()=>e.SchmancyContentDrawer}),exports.SchmancyContentDrawerID=e.SchmancyContentDrawerID,Object.defineProperty(exports,"SchmancyContentDrawerMain",{enumerable:!0,get:()=>e.SchmancyContentDrawerMain}),exports.SchmancyContentDrawerMaxHeight=e.SchmancyContentDrawerMaxHeight,exports.SchmancyContentDrawerMinWidth=e.SchmancyContentDrawerMinWidth,Object.defineProperty(exports,"SchmancyContentDrawerSheet",{enumerable:!0,get:()=>e.SchmancyContentDrawerSheet}),exports.SchmancyContentDrawerSheetMode=e.SchmancyContentDrawerSheetMode,exports.SchmancyContentDrawerSheetState=e.SchmancyContentDrawerSheetState,Object.defineProperty(exports,"SchmancyDrawerAppbar",{enumerable:!0,get:()=>e.SchmancyDrawerAppbar}),exports.SchmancyDrawerNavbarMode=e.SchmancyDrawerNavbarMode,exports.SchmancyDrawerNavbarState=e.SchmancyDrawerNavbarState,Object.defineProperty(exports,"SchmancyNavigationDrawer",{enumerable:!0,get:()=>e.SchmancyNavigationDrawer}),Object.defineProperty(exports,"SchmancyNavigationDrawerContent",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerContent}),Object.defineProperty(exports,"SchmancyNavigationDrawerSidebar",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerSidebar}),Object.defineProperty(exports,"SchmancyTeleportation",{enumerable:!0,get:()=>e.SchmancyTeleportation}),exports.WhereAreYouRicky=e.WhereAreYouRicky,exports.schmancyContentDrawer=e.schmancyContentDrawer,exports.schmancyNavDrawer=e.schmancyNavDrawer,exports.teleport=e.teleport,Object.defineProperty(exports,"SchmancyCheckbox",{enumerable:!0,get:()=>S.SchmancyCheckbox}),Object.defineProperty(exports,"SchmancyPaymentCardForm",{enumerable:!0,get:()=>u.SchmancyPaymentCardForm}),Object.defineProperty(exports,"SchmancyDelay",{enumerable:!0,get:()=>y.SchmancyDelay}),exports.delayContext=y.delayContext,exports.color=n.color,exports.fullHeight=n.fullHeight,exports.ripple=n.ripple,Object.defineProperty(exports,"SchmancyFlex",{enumerable:!0,get:()=>c.SchmancyFlex}),Object.defineProperty(exports,"SchmancyGrid",{enumerable:!0,get:()=>c.SchmancyGrid}),Object.defineProperty(exports,"SchmancyScroll",{enumerable:!0,get:()=>c.SchmancyScroll}),Object.defineProperty(exports,"List",{enumerable:!0,get:()=>m.List}),Object.defineProperty(exports,"SchmancyListItem",{enumerable:!0,get:()=>m.SchmancyListItem}),exports.$notify=a.$notify,Object.defineProperty(exports,"SchmancyNotification",{enumerable:!0,get:()=>a.SchmancyNotification}),Object.defineProperty(exports,"SchmancyNotificationOutlet",{enumerable:!0,get:()=>a.SchmancyNotificationOutlet}),Object.defineProperty(exports,"RadioGroup",{enumerable:!0,get:()=>b.RadioGroup}),exports.mutationObserver=l.mutationObserver,Object.defineProperty(exports,"SchmancySelect",{enumerable:!0,get:()=>d.SchmancySelect}),exports.SchmancySheetPosition=t.SchmancySheetPosition,exports.SheetHereMorty=t.SheetHereMorty,exports.SheetWhereAreYouRicky=t.SheetWhereAreYouRicky,exports.sheet=t.sheet,Object.defineProperty(exports,"SchmancySlide",{enumerable:!0,get:()=>h.SchmancySlide}),Object.defineProperty(exports,"SchmancySlider",{enumerable:!0,get:()=>h.SchmancySlider}),Object.defineProperty(exports,"SchmancySurface",{enumerable:!0,get:()=>p.SchmancySurface}),Object.defineProperty(exports,"SchmancyThemeComponent",{enumerable:!0,get:()=>i.SchmancyThemeComponent}),exports.formateTheme=i.formateTheme,exports.tailwindStyles=i.tailwindStyles,exports.SchmancyTheme=g.SchmancyTheme,Object.defineProperty(exports,"SchmancyTree",{enumerable:!0,get:()=>f.SchmancyTree}),exports.SchmancyEvents=q.SchmancyEvents,Object.defineProperty(exports,"TypewriterElement",{enumerable:!0,get:()=>O.TypewriterElement}),Object.defineProperty(exports,"SchmancyTypography",{enumerable:!0,get:()=>w.SchmancyTypography});
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("./animated-text-CHKjskbo.cjs");const r=require("./area.component-PjmcLIgT.cjs");require("./autocomplete-sjP09kRE.cjs"),require("./spinner-BQV8GutW.cjs");const o=require("./icon-button-C3lDDtmo.cjs"),e=require("./teleport.component-D8OSIPGk.cjs"),S=require("./checkbox-BlyeBJaT.cjs");require("./chips-B5s6nFCv.cjs");const u=require("./payment-card-form-BC-KTuAM.cjs");require("./date-range-DdwMl-RM.cjs");const y=require("./delay-C7mn_Xn7.cjs"),n=require("./ripple-C2BHbhcS.cjs");require("./divider-BCpoxMEa.cjs"),require("./form-2b-1v-m1.cjs"),require("./icon-C-Un0Yey.cjs"),require("./input-Robi05py.cjs");const c=require("./scroll-DJQVW4VV.cjs"),m=require("./list-DM_Y-zwH.cjs");require("./menu-1oIiQdXk.cjs");const a=require("./outlet-grvppFfL.cjs");require("./option-P1eP1gPa.cjs");const b=require("./radio-group-DJ15xUxA.cjs"),l=require("./rxjs-utils.cjs");require("rxjs"),require("./index-DyJ0oDpR.cjs");const d=require("./select-CV5sua6X.cjs"),t=require("./sheet-DEi77u64.cjs"),h=require("./slider-BVqs9NxT.cjs"),p=require("./surface-DI0zgakM.cjs");require("./table-Dupu_sw5.cjs"),require("./tabs-group-C3A9t09Q.cjs"),require("./textarea-08CHLJIt.cjs");const i=require("./theme.component-CQZlNAYr.cjs"),g=require("./theme.interface-Xg5Zi46a.cjs");require("./theme-button-DIq9Bwd6.cjs");const f=require("./tree-BeLMM0l5.cjs"),q=require("./types.cjs"),O=require("./typewriter-DPSbDZLc.cjs"),w=require("./typography-BbLaRssU.cjs");exports.FINDING_MORTIES=r.FINDING_MORTIES,exports.HERE_RICKY=r.HERE_RICKY,exports.HISTORY_STRATEGY=r.HISTORY_STRATEGY,Object.defineProperty(exports,"SchmancyArea",{enumerable:!0,get:()=>r.SchmancyArea}),exports.area=r.area,exports.routerHistory=r.routerHistory,Object.defineProperty(exports,"SchmancyButton",{enumerable:!0,get:()=>o.SchmancyButton}),Object.defineProperty(exports,"SchmnacyIconButton",{enumerable:!0,get:()=>o.SchmnacyIconButton}),exports.$drawer=e.$drawer,exports.HereMorty=e.HereMorty,Object.defineProperty(exports,"SchmancyContentDrawer",{enumerable:!0,get:()=>e.SchmancyContentDrawer}),exports.SchmancyContentDrawerID=e.SchmancyContentDrawerID,Object.defineProperty(exports,"SchmancyContentDrawerMain",{enumerable:!0,get:()=>e.SchmancyContentDrawerMain}),exports.SchmancyContentDrawerMaxHeight=e.SchmancyContentDrawerMaxHeight,exports.SchmancyContentDrawerMinWidth=e.SchmancyContentDrawerMinWidth,Object.defineProperty(exports,"SchmancyContentDrawerSheet",{enumerable:!0,get:()=>e.SchmancyContentDrawerSheet}),exports.SchmancyContentDrawerSheetMode=e.SchmancyContentDrawerSheetMode,exports.SchmancyContentDrawerSheetState=e.SchmancyContentDrawerSheetState,Object.defineProperty(exports,"SchmancyDrawerAppbar",{enumerable:!0,get:()=>e.SchmancyDrawerAppbar}),exports.SchmancyDrawerNavbarMode=e.SchmancyDrawerNavbarMode,exports.SchmancyDrawerNavbarState=e.SchmancyDrawerNavbarState,Object.defineProperty(exports,"SchmancyNavigationDrawer",{enumerable:!0,get:()=>e.SchmancyNavigationDrawer}),Object.defineProperty(exports,"SchmancyNavigationDrawerContent",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerContent}),Object.defineProperty(exports,"SchmancyNavigationDrawerSidebar",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerSidebar}),Object.defineProperty(exports,"SchmancyTeleportation",{enumerable:!0,get:()=>e.SchmancyTeleportation}),exports.WhereAreYouRicky=e.WhereAreYouRicky,exports.schmancyContentDrawer=e.schmancyContentDrawer,exports.schmancyNavDrawer=e.schmancyNavDrawer,exports.teleport=e.teleport,Object.defineProperty(exports,"SchmancyCheckbox",{enumerable:!0,get:()=>S.SchmancyCheckbox}),Object.defineProperty(exports,"SchmancyPaymentCardForm",{enumerable:!0,get:()=>u.SchmancyPaymentCardForm}),Object.defineProperty(exports,"SchmancyDelay",{enumerable:!0,get:()=>y.SchmancyDelay}),exports.delayContext=y.delayContext,exports.color=n.color,exports.fullHeight=n.fullHeight,exports.ripple=n.ripple,Object.defineProperty(exports,"SchmancyFlex",{enumerable:!0,get:()=>c.SchmancyFlex}),Object.defineProperty(exports,"SchmancyGrid",{enumerable:!0,get:()=>c.SchmancyGrid}),Object.defineProperty(exports,"SchmancyScroll",{enumerable:!0,get:()=>c.SchmancyScroll}),Object.defineProperty(exports,"List",{enumerable:!0,get:()=>m.List}),Object.defineProperty(exports,"SchmancyListItem",{enumerable:!0,get:()=>m.SchmancyListItem}),exports.$notify=a.$notify,Object.defineProperty(exports,"SchmancyNotification",{enumerable:!0,get:()=>a.SchmancyNotification}),Object.defineProperty(exports,"SchmancyNotificationOutlet",{enumerable:!0,get:()=>a.SchmancyNotificationOutlet}),Object.defineProperty(exports,"RadioGroup",{enumerable:!0,get:()=>b.RadioGroup}),exports.mutationObserver=l.mutationObserver,Object.defineProperty(exports,"SchmancySelect",{enumerable:!0,get:()=>d.SchmancySelect}),exports.SchmancySheetPosition=t.SchmancySheetPosition,exports.SheetHereMorty=t.SheetHereMorty,exports.SheetWhereAreYouRicky=t.SheetWhereAreYouRicky,exports.sheet=t.sheet,Object.defineProperty(exports,"SchmancySlide",{enumerable:!0,get:()=>h.SchmancySlide}),Object.defineProperty(exports,"SchmancySlider",{enumerable:!0,get:()=>h.SchmancySlider}),Object.defineProperty(exports,"SchmancySurface",{enumerable:!0,get:()=>p.SchmancySurface}),Object.defineProperty(exports,"SchmancyThemeComponent",{enumerable:!0,get:()=>i.SchmancyThemeComponent}),exports.formateTheme=i.formateTheme,exports.tailwindStyles=i.tailwindStyles,exports.SchmancyTheme=g.SchmancyTheme,Object.defineProperty(exports,"SchmancyTree",{enumerable:!0,get:()=>f.SchmancyTree}),exports.SchmancyEvents=q.SchmancyEvents,Object.defineProperty(exports,"TypewriterElement",{enumerable:!0,get:()=>O.TypewriterElement}),Object.defineProperty(exports,"SchmancyTypography",{enumerable:!0,get:()=>w.SchmancyTypography});
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { F as C, H as d, b as T, S as b, a as u, r as N } from "./area.component
3
3
  import "./autocomplete-DlA7Zj8y.js";
4
4
  import "./spinner-CjCEXMhX.js";
5
5
  import { S as R, a as v } from "./icon-button-mX6k_EOF.js";
6
- import { $ as M, H as g, e as E, b as A, f as Y, c as k, d as F, g as G, S as O, a as W, i as $, k as L, l as _, m as B, j as P, n as j, o as K, W as q, s as z, h as J, t as Q } from "./teleport.component-CoGQ6xi-.js";
6
+ import { $ as M, H as g, e as E, b as A, f as Y, c as k, d as F, g as G, S as O, a as W, i as $, k as L, l as _, m as B, j as P, n as j, o as K, W as q, s as z, h as J, t as Q } from "./teleport.component-BwflD2xY.js";
7
7
  import { S as V } from "./checkbox-BUckVPbf.js";
8
8
  import "./chips-B_MkXiVt.js";
9
9
  import { S as Z } from "./payment-card-form-CkuozUmp.js";
@@ -13,7 +13,7 @@ import { c as oa, f as ca, r as ma } from "./ripple-BumgqsDT.js";
13
13
  import "./divider-3bWzZ4Rm.js";
14
14
  import "./form-DqhBSlIk.js";
15
15
  import "./icon-yJxSVMJB.js";
16
- import "./input-RBly67_Q.js";
16
+ import "./input-DYyIyfZh.js";
17
17
  import { S as sa, a as Sa, b as ha } from "./scroll-DFMvmm21.js";
18
18
  import { L as ya, S as pa } from "./list-Dyy-SpiA.js";
19
19
  import "./menu-BPvSwS8i.js";
@@ -1,17 +1,17 @@
1
- import { html as y, nothing as f, LitElement as E } from "lit";
2
- import { property as r, query as k, customElement as w } from "lit/decorators.js";
1
+ import { html as m, nothing as f, LitElement as x } from "lit";
2
+ import { property as s, query as k, customElement as w } from "lit/decorators.js";
3
3
  import { classMap as b } from "lit/directives/class-map.js";
4
4
  import { ifDefined as a } from "lit/directives/if-defined.js";
5
5
  import { createRef as R, ref as C } from "lit/directives/ref.js";
6
- import { when as g } from "lit/directives/when.js";
7
- import { fromEvent as h, map as v, distinctUntilChanged as $, takeUntil as c, filter as x } from "rxjs";
6
+ import { when as v } from "lit/directives/when.js";
7
+ import { fromEvent as h, map as g, distinctUntilChanged as $, takeUntil as c, filter as E } from "rxjs";
8
8
  import "lit/directives/style-map.js";
9
9
  import { T as V } from "./tailwind.mixin-DZPJ7kCh.js";
10
- import { c as m } from "./ripple-BumgqsDT.js";
10
+ import { c as y } from "./ripple-BumgqsDT.js";
11
11
  import { S as p } from "./theme.interface-C5Kj6WjD.js";
12
- var q = Object.defineProperty, B = Object.getOwnPropertyDescriptor, i = (t, s, o, l) => {
13
- for (var u, n = l > 1 ? void 0 : l ? B(s, o) : s, d = t.length - 1; d >= 0; d--) (u = t[d]) && (n = (l ? u(s, o, n) : u(n)) || n);
14
- return l && n && q(s, o, n), n;
12
+ var q = Object.defineProperty, B = Object.getOwnPropertyDescriptor, i = (t, r, o, l) => {
13
+ for (var u, n = l > 1 ? void 0 : l ? B(r, o) : r, d = t.length - 1; d >= 0; d--) (u = t[d]) && (n = (l ? u(r, o, n) : u(n)) || n);
14
+ return l && n && q(r, o, n), n;
15
15
  };
16
16
  let e = class extends V() {
17
17
  constructor() {
@@ -29,8 +29,8 @@ let e = class extends V() {
29
29
  return ((t = this.internals) == null ? void 0 : t.form) ?? null;
30
30
  }
31
31
  updated(t) {
32
- var s, o, l;
33
- super.updated(t), t.has("value") && ((s = this.internals) == null || s.setFormValue(this.value)), t.has("error") && (this.error ? (o = this.internals) == null || o.setValidity({ customError: !0 }, "Invalid input", this.inputElement) : (l = this.internals) == null || l.setValidity({}));
32
+ var r, o, l;
33
+ super.updated(t), t.has("value") && ((r = this.internals) == null || r.setFormValue(this.value)), t.has("error") && (this.error ? (o = this.internals) == null || o.setValidity({ customError: !0 }, "Invalid input", this.inputElement) : (l = this.internals) == null || l.setValidity({}));
34
34
  }
35
35
  checkValidity() {
36
36
  var t;
@@ -41,20 +41,20 @@ let e = class extends V() {
41
41
  return ((t = this.inputRef.value) == null ? void 0 : t.reportValidity()) ?? !0;
42
42
  }
43
43
  setCustomValidity(t) {
44
- var s;
45
- (s = this.inputRef.value) == null || s.setCustomValidity(t);
44
+ var r;
45
+ (r = this.inputRef.value) == null || r.setCustomValidity(t);
46
46
  }
47
47
  firstUpdated() {
48
- this.autofocus && this.focus(), h(this.inputElement, "input").pipe(v((t) => t.target.value), $(), c(this.disconnecting)).subscribe((t) => {
49
- this.value = t, this.dispatchEvent(new CustomEvent("input", { detail: { value: t }, bubbles: !0, composed: !0 }));
50
- }), h(this.inputElement, "change").pipe(v((t) => t.target.value), $(), c(this.disconnecting)).subscribe((t) => {
48
+ this.autofocus && this.focus(), h(this.inputElement, "input").pipe(g((t) => t.target.value), $(), c(this.disconnecting)).subscribe((t) => {
49
+ this.value = t, this.dispatchEvent(new CustomEvent("input", { detail: { value: t }, bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent("change", { detail: { value: t }, bubbles: !0, composed: !0 }));
50
+ }), h(this.inputElement, "change").pipe(g((t) => t.target.value), $(), c(this.disconnecting)).subscribe((t) => {
51
51
  this.value = t, this.dispatchEvent(new CustomEvent("change", { detail: { value: t }, bubbles: !0, composed: !0 }));
52
- }), h(this.inputElement, "keyup").pipe(x((t) => t.key === "Enter"), c(this.disconnecting)).subscribe((t) => {
53
- const { value: s } = t.target;
54
- this.value = s, this.dispatchEvent(new CustomEvent("enter", { detail: { value: s }, bubbles: !0, composed: !0 }));
55
- }), h(this.inputElement, "animationstart").pipe(x((t) => t.animationName === "onAutoFillStart"), c(this.disconnecting)).subscribe((t) => {
56
- const { value: s } = t.target;
57
- this.value = s, this.dispatchEvent(new CustomEvent("change", { detail: { value: s }, bubbles: !0, composed: !0 }));
52
+ }), h(this.inputElement, "keyup").pipe(E((t) => t.key === "Enter"), c(this.disconnecting)).subscribe((t) => {
53
+ const { value: r } = t.target;
54
+ this.value = r, this.dispatchEvent(new CustomEvent("enter", { detail: { value: r }, bubbles: !0, composed: !0 }));
55
+ }), h(this.inputElement, "animationstart").pipe(E((t) => t.animationName === "onAutoFillStart"), c(this.disconnecting)).subscribe((t) => {
56
+ const { value: r } = t.target;
57
+ this.value = r, this.dispatchEvent(new CustomEvent("change", { detail: { value: r }, bubbles: !0, composed: !0 }));
58
58
  });
59
59
  }
60
60
  select() {
@@ -66,8 +66,8 @@ let e = class extends V() {
66
66
  return (t = this.inputRef.value) == null ? void 0 : t.validity;
67
67
  }
68
68
  focus(t) {
69
- var s;
70
- (s = this.inputRef.value) == null || s.focus(t), this.dispatchEvent(new Event("focus"));
69
+ var r;
70
+ (r = this.inputRef.value) == null || r.focus(t), this.dispatchEvent(new Event("focus"));
71
71
  }
72
72
  click() {
73
73
  var t;
@@ -78,14 +78,14 @@ let e = class extends V() {
78
78
  (t = this.inputRef.value) == null || t.blur(), this.dispatchEvent(new Event("blur"));
79
79
  }
80
80
  render() {
81
- const t = { "w-full flex-1 h-[50px] rounded-[8px] border-0 px-[8px] sm:px-[12px] md:px-[16px]": !0, "outline-secondary-default focus:outline-1 ": !0, "disabled:opacity-40 disabled:cursor-not-allowed": !0, "placeholder:text-muted": !0, "ring-0 ring-inset focus:ring-1 focus:ring-inset": !0, "ring-secondary-default ring-outline focus:ring-secondary-default": !this.error, "ring-error-default focus:ring-error-default": this.error, "caret-transparent focus:outline-hidden cursor-pointer text-select-none": this.readonly, "cursor-pointer": this.clickable, "text-center": this.align === "center", "text-right": this.align === "right" }, s = { "opacity-40": this.disabled, "block mb-[4px]": !0 };
82
- return y`
83
- ${g(this.label, () => y`
81
+ const t = { "w-full flex-1 h-[50px] rounded-[8px] border-0 px-[8px] sm:px-[12px] md:px-[16px]": !0, "outline-secondary-default focus:outline-1 ": !0, "disabled:opacity-40 disabled:cursor-not-allowed": !0, "placeholder:text-muted": !0, "ring-0 ring-inset focus:ring-1 focus:ring-inset": !0, "ring-secondary-default ring-outline focus:ring-secondary-default": !this.error, "ring-error-default focus:ring-error-default": this.error, "caret-transparent focus:outline-hidden cursor-pointer text-select-none": this.readonly, "cursor-pointer": this.clickable, "text-center": this.align === "center", "text-right": this.align === "right" }, r = { "opacity-40": this.disabled, "block mb-[4px]": !0 };
82
+ return m`
83
+ ${v(this.label, () => m`
84
84
  <label
85
85
  for=${this.id}
86
86
  id="label-${this.id}"
87
- class=${b(s)}
88
- ${m({ color: this.error ? p.sys.color.error.default : p.sys.color.primary.default })}
87
+ class=${b(r)}
88
+ ${y({ color: this.error ? p.sys.color.error.default : p.sys.color.primary.default })}
89
89
  >
90
90
  <schmancy-typography type="label" token="lg">${this.label}</schmancy-typography>
91
91
  </label>
@@ -93,7 +93,7 @@ let e = class extends V() {
93
93
 
94
94
  <form @submit=${(o) => o.preventDefault()} .autocomplete=${this.autocomplete === "off" ? "off" : "on"}>
95
95
  <input
96
- ${m({ bgColor: p.sys.color.surface.highest, color: p.sys.color.surface.on })}
96
+ ${y({ bgColor: p.sys.color.surface.highest, color: p.sys.color.surface.on })}
97
97
  ${C(this.inputRef)}
98
98
  id=${this.id}
99
99
  name=${this.name}
@@ -121,11 +121,11 @@ let e = class extends V() {
121
121
  />
122
122
  </form>
123
123
 
124
- ${g(this.hint, () => y`
124
+ ${v(this.hint, () => m`
125
125
  <div
126
126
  id="hint-${this.id}"
127
127
  class="pt-[4px]"
128
- ${m({ color: this.error ? p.sys.color.error.default : p.sys.color.primary.default })}
128
+ ${y({ color: this.error ? p.sys.color.error.default : p.sys.color.primary.default })}
129
129
  >
130
130
  <schmancy-typography align="left" type="body" token="sm"> ${this.hint} </schmancy-typography>
131
131
  </div>
@@ -133,5 +133,5 @@ let e = class extends V() {
133
133
  `;
134
134
  }
135
135
  };
136
- e._idCounter = 0, e.formAssociated = !0, e.shadowRootOptions = { ...E.shadowRootOptions, delegatesFocus: !0 }, i([r({ reflect: !0 })], e.prototype, "id", 2), i([r({ type: String })], e.prototype, "label", 2), i([r({ reflect: !0 })], e.prototype, "type", 2), i([r()], e.prototype, "name", 2), i([r()], e.prototype, "placeholder", 2), i([r({ type: String, reflect: !0 })], e.prototype, "value", 2), i([r({ type: String, reflect: !0 })], e.prototype, "pattern", 2), i([r({ type: Boolean, reflect: !0 })], e.prototype, "required", 2), i([r({ type: Boolean, reflect: !0 })], e.prototype, "disabled", 2), i([r({ type: Boolean, reflect: !0 })], e.prototype, "readonly", 2), i([r({ type: Boolean, reflect: !0 })], e.prototype, "clickable", 2), i([r({ type: Boolean, reflect: !0 })], e.prototype, "spellcheck", 2), i([r({ type: String, reflect: !0 })], e.prototype, "align", 2), i([r()], e.prototype, "inputmode", 2), i([r({ type: Number })], e.prototype, "minlength", 2), i([r({ type: Number })], e.prototype, "maxlength", 2), i([r()], e.prototype, "min", 2), i([r()], e.prototype, "max", 2), i([r({ type: Number, reflect: !0 })], e.prototype, "step", 2), i([r({ type: Boolean })], e.prototype, "autofocus", 2), i([r({ type: String })], e.prototype, "autocomplete", 2), i([r({ type: Number, reflect: !0 })], e.prototype, "tabIndex", 2), i([r()], e.prototype, "hint", 2), i([r({ type: Boolean, reflect: !0 })], e.prototype, "error", 2), i([k("input")], e.prototype, "inputElement", 2), e = i([w("schmancy-input")], e);
137
- //# sourceMappingURL=input-RBly67_Q.js.map
136
+ e._idCounter = 0, e.formAssociated = !0, e.shadowRootOptions = { ...x.shadowRootOptions, delegatesFocus: !0 }, i([s({ reflect: !0 })], e.prototype, "id", 2), i([s({ type: String })], e.prototype, "label", 2), i([s({ reflect: !0 })], e.prototype, "type", 2), i([s()], e.prototype, "name", 2), i([s()], e.prototype, "placeholder", 2), i([s({ type: String, reflect: !0 })], e.prototype, "value", 2), i([s({ type: String, reflect: !0 })], e.prototype, "pattern", 2), i([s({ type: Boolean, reflect: !0 })], e.prototype, "required", 2), i([s({ type: Boolean, reflect: !0 })], e.prototype, "disabled", 2), i([s({ type: Boolean, reflect: !0 })], e.prototype, "readonly", 2), i([s({ type: Boolean, reflect: !0 })], e.prototype, "clickable", 2), i([s({ type: Boolean, reflect: !0 })], e.prototype, "spellcheck", 2), i([s({ type: String, reflect: !0 })], e.prototype, "align", 2), i([s()], e.prototype, "inputmode", 2), i([s({ type: Number })], e.prototype, "minlength", 2), i([s({ type: Number })], e.prototype, "maxlength", 2), i([s()], e.prototype, "min", 2), i([s()], e.prototype, "max", 2), i([s({ type: Number, reflect: !0 })], e.prototype, "step", 2), i([s({ type: Boolean })], e.prototype, "autofocus", 2), i([s({ type: String })], e.prototype, "autocomplete", 2), i([s({ type: Number, reflect: !0 })], e.prototype, "tabIndex", 2), i([s()], e.prototype, "hint", 2), i([s({ type: Boolean, reflect: !0 })], e.prototype, "error", 2), i([k("input")], e.prototype, "inputElement", 2), e = i([w("schmancy-input")], e);
137
+ //# sourceMappingURL=input-DYyIyfZh.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-DYyIyfZh.js","sources":["../src/input/input.ts"],"sourcesContent":["import { html, LitElement, nothing, PropertyValueMap } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { createRef, ref } from 'lit/directives/ref.js'\nimport { when } from 'lit/directives/when.js'\nimport { distinctUntilChanged, filter, fromEvent, map, takeUntil } from 'rxjs'\n\nimport { TailwindElement } from '@mixins/index'\n\n// color directive + theme interface\nimport { color } from '@schmancy/directives'\nimport { SchmancyTheme } from '@schmancy/theme/theme.interface'\n\n// If you want to be form-associated, define the type on `ElementInternals`.\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-input': SchmancyInput\n\t}\n}\n\ntype EventDetails = {\n\tvalue: string\n}\n\n/**\n * Custom events the component may emit:\n * - 'input': on every keystroke\n * - 'change': on native blur/change\n * - 'enter': specifically when user presses Enter\n */\nexport type SchmancyInputInputEvent = CustomEvent<EventDetails>\nexport type SchmancyInputChangeEvent = CustomEvent<EventDetails>\nexport type SchmancyInputEnterEvent = CustomEvent<EventDetails>\n\n/** Common autocomplete/autofill hints. Extend as needed. */\ntype AutoFill =\n\t| 'on'\n\t| 'off'\n\t| 'name'\n\t| 'username'\n\t| 'email'\n\t| 'new-password'\n\t| 'current-password'\n\t| 'organization-title'\n\t| 'none'\n\n@customElement('schmancy-input')\nexport default class SchmancyInput extends TailwindElement() {\n\t// ----------------------------\n\t// A) Public properties\n\t// ----------------------------\n\n\t/** If user does NOT set `id`, we'll autogenerate one. */\n\tstatic _idCounter = 0\n\n\t@property({ reflect: true })\n\tpublic override id = ''\n\n\t/**\n\t * The label for the control. If populated, we render a `<label for=\"...\">`.\n\t * If empty, we add an `aria-label` to the <input> for better screenreader support.\n\t */\n\t@property({ type: String }) label = ''\n\n\t/**\n\t * The type of input. (e.g. 'text', 'password', 'email', etc.)\n\t */\n\t@property({ reflect: true })\n\tpublic type:\n\t\t| 'email'\n\t\t| 'number'\n\t\t| 'password'\n\t\t| 'search'\n\t\t| 'tel'\n\t\t| 'text'\n\t\t| 'url'\n\t\t| 'date'\n\t\t| 'datetime-local'\n\t\t| 'time'\n\t\t| 'month'\n\t\t| 'week'\n\t\t| 'color'\n\t\t| 'file' = 'text'\n\n\t/**\n\t * Name attribute (for form submissions). By default, a unique fallback.\n\t */\n\t@property()\n\tpublic name = `name_${Date.now()}`\n\n\t@property()\n\tpublic placeholder = ''\n\n\t/** Current value of the input. */\n\t@property({ type: String, reflect: true })\n\tpublic value = ''\n\n\t/** Pattern validation attribute. */\n\t@property({ type: String, reflect: true })\n\tpublic pattern?: string\n\n\t/** Whether the control is required for form validation. */\n\t@property({ type: Boolean, reflect: true })\n\tpublic required = false\n\n\t/** Whether the control is disabled. */\n\t@property({ type: Boolean, reflect: true })\n\tpublic disabled = false\n\n\t/** Whether the input is read-only. */\n\t@property({ type: Boolean, reflect: true })\n\tpublic readonly = false\n\n\t/** If true, we visually show a pointer cursor even if readOnly. */\n\t@property({ type: Boolean, reflect: true }) public clickable = false\n\n\t/** Whether browser spellcheck is enabled. */\n\t@property({ type: Boolean, reflect: true })\n\tpublic spellcheck = false\n\n\t/**\n\t * Text alignment within the input.\n\t * - 'left' | 'center' | 'right'\n\t */\n\t@property({ type: String, reflect: true })\n\tpublic align: 'left' | 'center' | 'right' = 'left'\n\n\t/** inputmode attribute (affects on-screen keyboards in mobile). */\n\t@property()\n\tpublic inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url'\n\n\t@property({ type: Number })\n\tpublic minlength?: number\n\n\t@property({ type: Number })\n\tpublic maxlength?: number\n\n\t@property()\n\tpublic min?: string\n\n\t@property()\n\tpublic max?: string\n\n\t@property({ type: Number, reflect: true })\n\tpublic step?: number\n\n\t/** If true, auto-focus this input on first render. */\n\t@property({ type: Boolean })\n\tpublic autofocus = false\n\n\t/** Autocomplete/autofill hints. */\n\t@property({ type: String })\n\tpublic autocomplete: AutoFill = 'off'\n\n\t/**\n\t * tabIndex for focusing by tab key. Typically 0 or -1.\n\t */\n\t@property({ type: Number, reflect: true })\n\tpublic tabIndex = 0\n\n\t/**\n\t * A small hint text or error message to display under the input.\n\t */\n\t@property()\n\tpublic hint?: string\n\n\t/**\n\t * If true, we style the input as an error state, and possibly display\n\t * the hint as an error message.\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic error = false\n\n\t// ----------------------------\n\t// B) Queries & Refs\n\t// ----------------------------\n\t@query('input') private inputElement!: HTMLInputElement\n\tprivate inputRef = createRef<HTMLInputElement>()\n\n\t// ----------------------------\n\t// C) Form-associated logic\n\t// ----------------------------\n\tstatic formAssociated = true\n\tprotected static shadowRootOptions = {\n\t\t...LitElement.shadowRootOptions,\n\t\tdelegatesFocus: true, // so focus() goes to <input>\n\t}\n\n\tprivate internals?: ElementInternals\n\n\tconstructor() {\n\t\tsuper()\n\t\tif ('attachInternals' in this) {\n\t\t\ttry {\n\t\t\t\tthis.internals = this.attachInternals()\n\t\t\t} catch {\n\t\t\t\t// no-op for older browsers / polyfills\n\t\t\t\tthis.internals = undefined\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * If user did not provide an ID, auto-generate one so <label for=\"...\">\n\t * and various aria-* attributes can reference it.\n\t */\n\tprotected override willUpdate(changedProps: PropertyValueMap<any> | Map<PropertyKey, unknown>) {\n\t\tif (!this.id) {\n\t\t\tthis.id = `schmancy-input-${SchmancyInput._idCounter++}`\n\t\t}\n\t\tsuper.willUpdate(changedProps)\n\t}\n\n\t/** The form this element is associated with, if any. */\n\tget form() {\n\t\treturn this.internals?.form ?? null\n\t}\n\n\tprotected override updated(changedProps: Map<string, unknown>) {\n\t\tsuper.updated(changedProps)\n\t\tif (changedProps.has('value')) {\n\t\t\t// Reflect the current value to the form internals, so it’s submitted.\n\t\t\tthis.internals?.setFormValue(this.value)\n\t\t}\n\n\t\tif (changedProps.has('error')) {\n\t\t\t// If we have an error state, we can set custom error validity, or none if resolved.\n\t\t\tif (this.error) {\n\t\t\t\tthis.internals?.setValidity({ customError: true }, 'Invalid input', this.inputElement)\n\t\t\t} else {\n\t\t\t\tthis.internals?.setValidity({})\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Native form methods:\n\t * - checkValidity()\n\t * - reportValidity()\n\t * - setCustomValidity()\n\t */\n\tpublic checkValidity() {\n\t\treturn this.inputRef.value?.checkValidity() ?? true\n\t}\n\tpublic reportValidity() {\n\t\treturn this.inputRef.value?.reportValidity() ?? true\n\t}\n\tpublic setCustomValidity(message: string) {\n\t\tthis.inputRef.value?.setCustomValidity(message)\n\t}\n\n\t// ----------------------------\n\t// D) Lifecycle Hooks\n\t// ----------------------------\n\tfirstUpdated() {\n\t\t// Autofocus if desired\n\t\tif (this.autofocus) {\n\t\t\tthis.focus()\n\t\t}\n\n\t\t// 1) Subscribe to 'input' events (every keystroke)\n\t\tfromEvent<InputEvent>(this.inputElement, 'input')\n\t\t\t.pipe(\n\t\t\t\tmap(ev => (ev.target as HTMLInputElement).value),\n\t\t\t\tdistinctUntilChanged(),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(value => {\n\t\t\t\tthis.value = value\n\t\t\t\t// Fire custom 'input' event with details\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('input', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t\t// dispatch change event\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('change', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\n\t\t// 2) Subscribe to 'change' events (native behavior, usually on blur)\n\t\tfromEvent<Event>(this.inputElement, 'change')\n\t\t\t.pipe(\n\t\t\t\tmap(ev => (ev.target as HTMLInputElement).value),\n\t\t\t\tdistinctUntilChanged(),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(value => {\n\t\t\t\tthis.value = value\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('change', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\n\t\t// 3) Emit a custom 'enter' event when user presses Enter\n\t\tfromEvent<KeyboardEvent>(this.inputElement, 'keyup')\n\t\t\t.pipe(\n\t\t\t\tfilter(ev => ev.key === 'Enter'),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(ev => {\n\t\t\t\tconst { value } = ev.target as HTMLInputElement\n\t\t\t\tthis.value = value\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('enter', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\n\t\t// 4) Detect autofill animation (Chrome, etc.)\n\t\tfromEvent<AnimationEvent>(this.inputElement, 'animationstart')\n\t\t\t.pipe(\n\t\t\t\tfilter(ev => ev.animationName === 'onAutoFillStart'),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(ev => {\n\t\t\t\tconst { value } = ev.target as HTMLInputElement\n\t\t\t\tthis.value = value\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('change', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\t}\n\n\t// ----------------------------\n\t// E) Utility Methods\n\t// ----------------------------\n\t/** Selects all text within the input. */\n\tpublic select() {\n\t\treturn this.inputRef.value?.select()\n\t}\n\n\t/** Returns the native validity state of the inner <input>. */\n\tpublic getValidity(): ValidityState | undefined {\n\t\treturn this.inputRef.value?.validity\n\t}\n\n\t/**\n\t * Override to forward focus to the internal <input>.\n\t * Also dispatch a 'focus' event for external listeners.\n\t */\n\tpublic override focus(options?: FocusOptions) {\n\t\tthis.inputRef.value?.focus(options)\n\t\tthis.dispatchEvent(new Event('focus'))\n\t}\n\n\t/**\n\t * Override to forward clicks to the internal <input>.\n\t * Also dispatch a 'click' event for external listeners.\n\t */\n\tpublic override click() {\n\t\tthis.inputRef.value?.click()\n\t\tthis.dispatchEvent(new Event('click'))\n\t}\n\n\t/** Forward blur to the internal <input>. */\n\tpublic override blur() {\n\t\tthis.inputRef.value?.blur()\n\t\tthis.dispatchEvent(new Event('blur'))\n\t}\n\n\t// ----------------------------\n\t// F) Rendering\n\t// ----------------------------\n\tprotected override render() {\n\t\tconst inputClasses = {\n\t\t\t'w-full flex-1 h-[50px] rounded-[8px] border-0 px-[8px] sm:px-[12px] md:px-[16px]': true,\n\t\t\t'outline-secondary-default focus:outline-1 ': true,\n\t\t\t'disabled:opacity-40 disabled:cursor-not-allowed': true,\n\t\t\t'placeholder:text-muted': true,\n\t\t\t'ring-0 ring-inset focus:ring-1 focus:ring-inset': true,\n\t\t\t// If not in error state, use standard ring color:\n\t\t\t'ring-secondary-default ring-outline focus:ring-secondary-default': !this.error,\n\t\t\t// Error ring override:\n\t\t\t'ring-error-default focus:ring-error-default': this.error,\n\t\t\t// If read-only but \"clickable\" is true, show pointer. Otherwise normal text cursor.\n\t\t\t'caret-transparent focus:outline-hidden cursor-pointer text-select-none': this.readonly,\n\t\t\t'cursor-pointer': this.clickable,\n\t\t\t// Alignment classes:\n\t\t\t'text-center': this.align === 'center',\n\t\t\t'text-right': this.align === 'right',\n\t\t}\n\n\t\tconst labelClasses = {\n\t\t\t'opacity-40': this.disabled,\n\t\t\t'block mb-[4px]': true,\n\t\t}\n\n\t\t/**\n\t\t * - If `this.label` is present, we render a proper `<label for=\"${this.id}\">`.\n\t\t * - If not, we add an aria-label to the <input> for better accessibility.\n\t\t * - If there's a `hint`, we reference it via aria-describedby.\n\t\t * - If there's an error, we set aria-invalid and could set aria-errormessage.\n\t\t */\n\t\treturn html`\n\t\t\t${when(\n\t\t\t\tthis.label,\n\t\t\t\t() => html`\n\t\t\t\t\t<label\n\t\t\t\t\t\tfor=${this.id}\n\t\t\t\t\t\tid=\"label-${this.id}\"\n\t\t\t\t\t\tclass=${classMap(labelClasses)}\n\t\t\t\t\t\t${color({\n\t\t\t\t\t\t\tcolor: this.error ? SchmancyTheme.sys.color.error.default : SchmancyTheme.sys.color.primary.default,\n\t\t\t\t\t\t})}\n\t\t\t\t\t>\n\t\t\t\t\t\t<schmancy-typography type=\"label\" token=\"lg\">${this.label}</schmancy-typography>\n\t\t\t\t\t</label>\n\t\t\t\t`,\n\t\t\t)}\n\n\t\t\t<form @submit=${(e: Event) => e.preventDefault()} .autocomplete=${this.autocomplete === 'off' ? 'off' : 'on'}>\n\t\t\t\t<input\n\t\t\t\t\t${color({\n\t\t\t\t\t\tbgColor: SchmancyTheme.sys.color.surface.highest,\n\t\t\t\t\t\tcolor: SchmancyTheme.sys.color.surface.on,\n\t\t\t\t\t})}\n\t\t\t\t\t${ref(this.inputRef)}\n\t\t\t\t\tid=${this.id}\n\t\t\t\t\tname=${this.name}\n\t\t\t\t\tclass=${classMap(inputClasses)}\n\t\t\t\t\t.value=${this.value}\n\t\t\t\t\t.type=${this.type}\n\t\t\t\t\t.autocomplete=${this.autocomplete}\n\t\t\t\t\t.spellcheck=${this.spellcheck}\n\t\t\t\t\tplaceholder=${this.placeholder}\n\t\t\t\t\tinputmode=${ifDefined(this.inputmode)}\n\t\t\t\t\tpattern=${ifDefined(this.pattern)}\n\t\t\t\t\tstep=${ifDefined(this.step)}\n\t\t\t\t\tminlength=${ifDefined(this.minlength)}\n\t\t\t\t\tmaxlength=${ifDefined(this.maxlength)}\n\t\t\t\t\tmin=${ifDefined(this.min)}\n\t\t\t\t\tmax=${ifDefined(this.max)}\n\t\t\t\t\t?required=${this.required}\n\t\t\t\t\t?disabled=${this.disabled}\n\t\t\t\t\t?readonly=${this.readonly}\n\t\t\t\t\taria-invalid=${this.error ? 'true' : 'false'}\n\t\t\t\t\taria-required=${this.required ? 'true' : 'false'}\n\t\t\t\t\taria-labelledby=${this.label ? `label-${this.id}` : nothing}\n\t\t\t\t\taria-describedby=${this.hint ? `hint-${this.id}` : nothing}\n\t\t\t\t\taria-label=${ifDefined(!this.label ? this.placeholder || 'Input' : undefined)}\n\t\t\t\t/>\n\t\t\t</form>\n\n\t\t\t${when(\n\t\t\t\tthis.hint,\n\t\t\t\t() => html`\n\t\t\t\t\t<div\n\t\t\t\t\t\tid=\"hint-${this.id}\"\n\t\t\t\t\t\tclass=\"pt-[4px]\"\n\t\t\t\t\t\t${color({\n\t\t\t\t\t\t\tcolor: this.error ? SchmancyTheme.sys.color.error.default : SchmancyTheme.sys.color.primary.default,\n\t\t\t\t\t\t})}\n\t\t\t\t\t>\n\t\t\t\t\t\t<schmancy-typography align=\"left\" type=\"body\" token=\"sm\"> ${this.hint} </schmancy-typography>\n\t\t\t\t\t</div>\n\t\t\t\t`,\n\t\t\t)}\n\t\t`\n\t}\n}\n"],"names":["SchmancyInput","TailwindElement","super","this","id","label","type","name","Date","now","placeholder","value","required","disabled","readonly","clickable","spellcheck","align","autofocus","autocomplete","tabIndex","error","inputRef","createRef","internals","attachInternals","changedProps","_idCounter","willUpdate","form","updated","has","setFormValue","setValidity","customError","inputElement","checkValidity","reportValidity","message","setCustomValidity","firstUpdated","focus","fromEvent","pipe","map","ev","target","distinctUntilChanged","takeUntil","disconnecting","subscribe","dispatchEvent","CustomEvent","detail","bubbles","composed","filter","key","animationName","select","getValidity","validity","options","Event","click","blur","inputClasses","labelClasses","html","when","classMap","color","SchmancyTheme","sys","default","primary","e","preventDefault","bgColor","surface","highest","on","ref","ifDefined","inputmode","pattern","step","minlength","maxlength","min","max","nothing","hint","formAssociated","shadowRootOptions","L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4 @@
1
- "use strict";const c=require("lit"),i=require("lit/decorators.js"),m=require("lit/directives/class-map.js"),l=require("lit/directives/if-defined.js"),f=require("lit/directives/ref.js"),b=require("lit/directives/when.js"),s=require("rxjs");require("lit/directives/style-map.js");const v=require("./tailwind.mixin-C16PXbzn.cjs"),y=require("./ripple-C2BHbhcS.cjs"),h=require("./theme.interface-Xg5Zi46a.cjs");var g=Object.defineProperty,$=Object.getOwnPropertyDescriptor,r=(e,o,n,p)=>{for(var u,a=p>1?void 0:p?$(o,n):o,d=e.length-1;d>=0;d--)(u=e[d])&&(a=(p?u(o,n,a):u(a))||a);return p&&a&&g(o,n,a),a};let t=class extends v.TailwindElement(){constructor(){if(super(),this.id="",this.label="",this.type="text",this.name=`name_${Date.now()}`,this.placeholder="",this.value="",this.required=!1,this.disabled=!1,this.readonly=!1,this.clickable=!1,this.spellcheck=!1,this.align="left",this.autofocus=!1,this.autocomplete="off",this.tabIndex=0,this.error=!1,this.inputRef=f.createRef(),"attachInternals"in this)try{this.internals=this.attachInternals()}catch{this.internals=void 0}}willUpdate(e){this.id||(this.id="schmancy-input-"+t._idCounter++),super.willUpdate(e)}get form(){var e;return((e=this.internals)==null?void 0:e.form)??null}updated(e){var o,n,p;super.updated(e),e.has("value")&&((o=this.internals)==null||o.setFormValue(this.value)),e.has("error")&&(this.error?(n=this.internals)==null||n.setValidity({customError:!0},"Invalid input",this.inputElement):(p=this.internals)==null||p.setValidity({}))}checkValidity(){var e;return((e=this.inputRef.value)==null?void 0:e.checkValidity())??!0}reportValidity(){var e;return((e=this.inputRef.value)==null?void 0:e.reportValidity())??!0}setCustomValidity(e){var o;(o=this.inputRef.value)==null||o.setCustomValidity(e)}firstUpdated(){this.autofocus&&this.focus(),s.fromEvent(this.inputElement,"input").pipe(s.map(e=>e.target.value),s.distinctUntilChanged(),s.takeUntil(this.disconnecting)).subscribe(e=>{this.value=e,this.dispatchEvent(new CustomEvent("input",{detail:{value:e},bubbles:!0,composed:!0}))}),s.fromEvent(this.inputElement,"change").pipe(s.map(e=>e.target.value),s.distinctUntilChanged(),s.takeUntil(this.disconnecting)).subscribe(e=>{this.value=e,this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0}))}),s.fromEvent(this.inputElement,"keyup").pipe(s.filter(e=>e.key==="Enter"),s.takeUntil(this.disconnecting)).subscribe(e=>{const{value:o}=e.target;this.value=o,this.dispatchEvent(new CustomEvent("enter",{detail:{value:o},bubbles:!0,composed:!0}))}),s.fromEvent(this.inputElement,"animationstart").pipe(s.filter(e=>e.animationName==="onAutoFillStart"),s.takeUntil(this.disconnecting)).subscribe(e=>{const{value:o}=e.target;this.value=o,this.dispatchEvent(new CustomEvent("change",{detail:{value:o},bubbles:!0,composed:!0}))})}select(){var e;return(e=this.inputRef.value)==null?void 0:e.select()}getValidity(){var e;return(e=this.inputRef.value)==null?void 0:e.validity}focus(e){var o;(o=this.inputRef.value)==null||o.focus(e),this.dispatchEvent(new Event("focus"))}click(){var e;(e=this.inputRef.value)==null||e.click(),this.dispatchEvent(new Event("click"))}blur(){var e;(e=this.inputRef.value)==null||e.blur(),this.dispatchEvent(new Event("blur"))}render(){const e={"w-full flex-1 h-[50px] rounded-[8px] border-0 px-[8px] sm:px-[12px] md:px-[16px]":!0,"outline-secondary-default focus:outline-1 ":!0,"disabled:opacity-40 disabled:cursor-not-allowed":!0,"placeholder:text-muted":!0,"ring-0 ring-inset focus:ring-1 focus:ring-inset":!0,"ring-secondary-default ring-outline focus:ring-secondary-default":!this.error,"ring-error-default focus:ring-error-default":this.error,"caret-transparent focus:outline-hidden cursor-pointer text-select-none":this.readonly,"cursor-pointer":this.clickable,"text-center":this.align==="center","text-right":this.align==="right"},o={"opacity-40":this.disabled,"block mb-[4px]":!0};return c.html`
1
+ "use strict";const c=require("lit"),i=require("lit/decorators.js"),m=require("lit/directives/class-map.js"),l=require("lit/directives/if-defined.js"),f=require("lit/directives/ref.js"),b=require("lit/directives/when.js"),s=require("rxjs");require("lit/directives/style-map.js");const v=require("./tailwind.mixin-C16PXbzn.cjs"),y=require("./ripple-C2BHbhcS.cjs"),h=require("./theme.interface-Xg5Zi46a.cjs");var g=Object.defineProperty,$=Object.getOwnPropertyDescriptor,r=(e,o,n,p)=>{for(var u,a=p>1?void 0:p?$(o,n):o,d=e.length-1;d>=0;d--)(u=e[d])&&(a=(p?u(o,n,a):u(a))||a);return p&&a&&g(o,n,a),a};let t=class extends v.TailwindElement(){constructor(){if(super(),this.id="",this.label="",this.type="text",this.name=`name_${Date.now()}`,this.placeholder="",this.value="",this.required=!1,this.disabled=!1,this.readonly=!1,this.clickable=!1,this.spellcheck=!1,this.align="left",this.autofocus=!1,this.autocomplete="off",this.tabIndex=0,this.error=!1,this.inputRef=f.createRef(),"attachInternals"in this)try{this.internals=this.attachInternals()}catch{this.internals=void 0}}willUpdate(e){this.id||(this.id="schmancy-input-"+t._idCounter++),super.willUpdate(e)}get form(){var e;return((e=this.internals)==null?void 0:e.form)??null}updated(e){var o,n,p;super.updated(e),e.has("value")&&((o=this.internals)==null||o.setFormValue(this.value)),e.has("error")&&(this.error?(n=this.internals)==null||n.setValidity({customError:!0},"Invalid input",this.inputElement):(p=this.internals)==null||p.setValidity({}))}checkValidity(){var e;return((e=this.inputRef.value)==null?void 0:e.checkValidity())??!0}reportValidity(){var e;return((e=this.inputRef.value)==null?void 0:e.reportValidity())??!0}setCustomValidity(e){var o;(o=this.inputRef.value)==null||o.setCustomValidity(e)}firstUpdated(){this.autofocus&&this.focus(),s.fromEvent(this.inputElement,"input").pipe(s.map(e=>e.target.value),s.distinctUntilChanged(),s.takeUntil(this.disconnecting)).subscribe(e=>{this.value=e,this.dispatchEvent(new CustomEvent("input",{detail:{value:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0}))}),s.fromEvent(this.inputElement,"change").pipe(s.map(e=>e.target.value),s.distinctUntilChanged(),s.takeUntil(this.disconnecting)).subscribe(e=>{this.value=e,this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0}))}),s.fromEvent(this.inputElement,"keyup").pipe(s.filter(e=>e.key==="Enter"),s.takeUntil(this.disconnecting)).subscribe(e=>{const{value:o}=e.target;this.value=o,this.dispatchEvent(new CustomEvent("enter",{detail:{value:o},bubbles:!0,composed:!0}))}),s.fromEvent(this.inputElement,"animationstart").pipe(s.filter(e=>e.animationName==="onAutoFillStart"),s.takeUntil(this.disconnecting)).subscribe(e=>{const{value:o}=e.target;this.value=o,this.dispatchEvent(new CustomEvent("change",{detail:{value:o},bubbles:!0,composed:!0}))})}select(){var e;return(e=this.inputRef.value)==null?void 0:e.select()}getValidity(){var e;return(e=this.inputRef.value)==null?void 0:e.validity}focus(e){var o;(o=this.inputRef.value)==null||o.focus(e),this.dispatchEvent(new Event("focus"))}click(){var e;(e=this.inputRef.value)==null||e.click(),this.dispatchEvent(new Event("click"))}blur(){var e;(e=this.inputRef.value)==null||e.blur(),this.dispatchEvent(new Event("blur"))}render(){const e={"w-full flex-1 h-[50px] rounded-[8px] border-0 px-[8px] sm:px-[12px] md:px-[16px]":!0,"outline-secondary-default focus:outline-1 ":!0,"disabled:opacity-40 disabled:cursor-not-allowed":!0,"placeholder:text-muted":!0,"ring-0 ring-inset focus:ring-1 focus:ring-inset":!0,"ring-secondary-default ring-outline focus:ring-secondary-default":!this.error,"ring-error-default focus:ring-error-default":this.error,"caret-transparent focus:outline-hidden cursor-pointer text-select-none":this.readonly,"cursor-pointer":this.clickable,"text-center":this.align==="center","text-right":this.align==="right"},o={"opacity-40":this.disabled,"block mb-[4px]":!0};return c.html`
2
2
  ${b.when(this.label,()=>c.html`
3
3
  <label
4
4
  for=${this.id}
@@ -50,4 +50,4 @@
50
50
  </div>
51
51
  `)}
52
52
  `}};t._idCounter=0,t.formAssociated=!0,t.shadowRootOptions={...c.LitElement.shadowRootOptions,delegatesFocus:!0},r([i.property({reflect:!0})],t.prototype,"id",2),r([i.property({type:String})],t.prototype,"label",2),r([i.property({reflect:!0})],t.prototype,"type",2),r([i.property()],t.prototype,"name",2),r([i.property()],t.prototype,"placeholder",2),r([i.property({type:String,reflect:!0})],t.prototype,"value",2),r([i.property({type:String,reflect:!0})],t.prototype,"pattern",2),r([i.property({type:Boolean,reflect:!0})],t.prototype,"required",2),r([i.property({type:Boolean,reflect:!0})],t.prototype,"disabled",2),r([i.property({type:Boolean,reflect:!0})],t.prototype,"readonly",2),r([i.property({type:Boolean,reflect:!0})],t.prototype,"clickable",2),r([i.property({type:Boolean,reflect:!0})],t.prototype,"spellcheck",2),r([i.property({type:String,reflect:!0})],t.prototype,"align",2),r([i.property()],t.prototype,"inputmode",2),r([i.property({type:Number})],t.prototype,"minlength",2),r([i.property({type:Number})],t.prototype,"maxlength",2),r([i.property()],t.prototype,"min",2),r([i.property()],t.prototype,"max",2),r([i.property({type:Number,reflect:!0})],t.prototype,"step",2),r([i.property({type:Boolean})],t.prototype,"autofocus",2),r([i.property({type:String})],t.prototype,"autocomplete",2),r([i.property({type:Number,reflect:!0})],t.prototype,"tabIndex",2),r([i.property()],t.prototype,"hint",2),r([i.property({type:Boolean,reflect:!0})],t.prototype,"error",2),r([i.query("input")],t.prototype,"inputElement",2),t=r([i.customElement("schmancy-input")],t);
53
- //# sourceMappingURL=input-1mohwkxJ.cjs.map
53
+ //# sourceMappingURL=input-Robi05py.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-Robi05py.cjs","sources":["../src/input/input.ts"],"sourcesContent":["import { html, LitElement, nothing, PropertyValueMap } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { createRef, ref } from 'lit/directives/ref.js'\nimport { when } from 'lit/directives/when.js'\nimport { distinctUntilChanged, filter, fromEvent, map, takeUntil } from 'rxjs'\n\nimport { TailwindElement } from '@mixins/index'\n\n// color directive + theme interface\nimport { color } from '@schmancy/directives'\nimport { SchmancyTheme } from '@schmancy/theme/theme.interface'\n\n// If you want to be form-associated, define the type on `ElementInternals`.\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-input': SchmancyInput\n\t}\n}\n\ntype EventDetails = {\n\tvalue: string\n}\n\n/**\n * Custom events the component may emit:\n * - 'input': on every keystroke\n * - 'change': on native blur/change\n * - 'enter': specifically when user presses Enter\n */\nexport type SchmancyInputInputEvent = CustomEvent<EventDetails>\nexport type SchmancyInputChangeEvent = CustomEvent<EventDetails>\nexport type SchmancyInputEnterEvent = CustomEvent<EventDetails>\n\n/** Common autocomplete/autofill hints. Extend as needed. */\ntype AutoFill =\n\t| 'on'\n\t| 'off'\n\t| 'name'\n\t| 'username'\n\t| 'email'\n\t| 'new-password'\n\t| 'current-password'\n\t| 'organization-title'\n\t| 'none'\n\n@customElement('schmancy-input')\nexport default class SchmancyInput extends TailwindElement() {\n\t// ----------------------------\n\t// A) Public properties\n\t// ----------------------------\n\n\t/** If user does NOT set `id`, we'll autogenerate one. */\n\tstatic _idCounter = 0\n\n\t@property({ reflect: true })\n\tpublic override id = ''\n\n\t/**\n\t * The label for the control. If populated, we render a `<label for=\"...\">`.\n\t * If empty, we add an `aria-label` to the <input> for better screenreader support.\n\t */\n\t@property({ type: String }) label = ''\n\n\t/**\n\t * The type of input. (e.g. 'text', 'password', 'email', etc.)\n\t */\n\t@property({ reflect: true })\n\tpublic type:\n\t\t| 'email'\n\t\t| 'number'\n\t\t| 'password'\n\t\t| 'search'\n\t\t| 'tel'\n\t\t| 'text'\n\t\t| 'url'\n\t\t| 'date'\n\t\t| 'datetime-local'\n\t\t| 'time'\n\t\t| 'month'\n\t\t| 'week'\n\t\t| 'color'\n\t\t| 'file' = 'text'\n\n\t/**\n\t * Name attribute (for form submissions). By default, a unique fallback.\n\t */\n\t@property()\n\tpublic name = `name_${Date.now()}`\n\n\t@property()\n\tpublic placeholder = ''\n\n\t/** Current value of the input. */\n\t@property({ type: String, reflect: true })\n\tpublic value = ''\n\n\t/** Pattern validation attribute. */\n\t@property({ type: String, reflect: true })\n\tpublic pattern?: string\n\n\t/** Whether the control is required for form validation. */\n\t@property({ type: Boolean, reflect: true })\n\tpublic required = false\n\n\t/** Whether the control is disabled. */\n\t@property({ type: Boolean, reflect: true })\n\tpublic disabled = false\n\n\t/** Whether the input is read-only. */\n\t@property({ type: Boolean, reflect: true })\n\tpublic readonly = false\n\n\t/** If true, we visually show a pointer cursor even if readOnly. */\n\t@property({ type: Boolean, reflect: true }) public clickable = false\n\n\t/** Whether browser spellcheck is enabled. */\n\t@property({ type: Boolean, reflect: true })\n\tpublic spellcheck = false\n\n\t/**\n\t * Text alignment within the input.\n\t * - 'left' | 'center' | 'right'\n\t */\n\t@property({ type: String, reflect: true })\n\tpublic align: 'left' | 'center' | 'right' = 'left'\n\n\t/** inputmode attribute (affects on-screen keyboards in mobile). */\n\t@property()\n\tpublic inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url'\n\n\t@property({ type: Number })\n\tpublic minlength?: number\n\n\t@property({ type: Number })\n\tpublic maxlength?: number\n\n\t@property()\n\tpublic min?: string\n\n\t@property()\n\tpublic max?: string\n\n\t@property({ type: Number, reflect: true })\n\tpublic step?: number\n\n\t/** If true, auto-focus this input on first render. */\n\t@property({ type: Boolean })\n\tpublic autofocus = false\n\n\t/** Autocomplete/autofill hints. */\n\t@property({ type: String })\n\tpublic autocomplete: AutoFill = 'off'\n\n\t/**\n\t * tabIndex for focusing by tab key. Typically 0 or -1.\n\t */\n\t@property({ type: Number, reflect: true })\n\tpublic tabIndex = 0\n\n\t/**\n\t * A small hint text or error message to display under the input.\n\t */\n\t@property()\n\tpublic hint?: string\n\n\t/**\n\t * If true, we style the input as an error state, and possibly display\n\t * the hint as an error message.\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic error = false\n\n\t// ----------------------------\n\t// B) Queries & Refs\n\t// ----------------------------\n\t@query('input') private inputElement!: HTMLInputElement\n\tprivate inputRef = createRef<HTMLInputElement>()\n\n\t// ----------------------------\n\t// C) Form-associated logic\n\t// ----------------------------\n\tstatic formAssociated = true\n\tprotected static shadowRootOptions = {\n\t\t...LitElement.shadowRootOptions,\n\t\tdelegatesFocus: true, // so focus() goes to <input>\n\t}\n\n\tprivate internals?: ElementInternals\n\n\tconstructor() {\n\t\tsuper()\n\t\tif ('attachInternals' in this) {\n\t\t\ttry {\n\t\t\t\tthis.internals = this.attachInternals()\n\t\t\t} catch {\n\t\t\t\t// no-op for older browsers / polyfills\n\t\t\t\tthis.internals = undefined\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * If user did not provide an ID, auto-generate one so <label for=\"...\">\n\t * and various aria-* attributes can reference it.\n\t */\n\tprotected override willUpdate(changedProps: PropertyValueMap<any> | Map<PropertyKey, unknown>) {\n\t\tif (!this.id) {\n\t\t\tthis.id = `schmancy-input-${SchmancyInput._idCounter++}`\n\t\t}\n\t\tsuper.willUpdate(changedProps)\n\t}\n\n\t/** The form this element is associated with, if any. */\n\tget form() {\n\t\treturn this.internals?.form ?? null\n\t}\n\n\tprotected override updated(changedProps: Map<string, unknown>) {\n\t\tsuper.updated(changedProps)\n\t\tif (changedProps.has('value')) {\n\t\t\t// Reflect the current value to the form internals, so it’s submitted.\n\t\t\tthis.internals?.setFormValue(this.value)\n\t\t}\n\n\t\tif (changedProps.has('error')) {\n\t\t\t// If we have an error state, we can set custom error validity, or none if resolved.\n\t\t\tif (this.error) {\n\t\t\t\tthis.internals?.setValidity({ customError: true }, 'Invalid input', this.inputElement)\n\t\t\t} else {\n\t\t\t\tthis.internals?.setValidity({})\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Native form methods:\n\t * - checkValidity()\n\t * - reportValidity()\n\t * - setCustomValidity()\n\t */\n\tpublic checkValidity() {\n\t\treturn this.inputRef.value?.checkValidity() ?? true\n\t}\n\tpublic reportValidity() {\n\t\treturn this.inputRef.value?.reportValidity() ?? true\n\t}\n\tpublic setCustomValidity(message: string) {\n\t\tthis.inputRef.value?.setCustomValidity(message)\n\t}\n\n\t// ----------------------------\n\t// D) Lifecycle Hooks\n\t// ----------------------------\n\tfirstUpdated() {\n\t\t// Autofocus if desired\n\t\tif (this.autofocus) {\n\t\t\tthis.focus()\n\t\t}\n\n\t\t// 1) Subscribe to 'input' events (every keystroke)\n\t\tfromEvent<InputEvent>(this.inputElement, 'input')\n\t\t\t.pipe(\n\t\t\t\tmap(ev => (ev.target as HTMLInputElement).value),\n\t\t\t\tdistinctUntilChanged(),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(value => {\n\t\t\t\tthis.value = value\n\t\t\t\t// Fire custom 'input' event with details\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('input', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t\t// dispatch change event\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('change', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\n\t\t// 2) Subscribe to 'change' events (native behavior, usually on blur)\n\t\tfromEvent<Event>(this.inputElement, 'change')\n\t\t\t.pipe(\n\t\t\t\tmap(ev => (ev.target as HTMLInputElement).value),\n\t\t\t\tdistinctUntilChanged(),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(value => {\n\t\t\t\tthis.value = value\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('change', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\n\t\t// 3) Emit a custom 'enter' event when user presses Enter\n\t\tfromEvent<KeyboardEvent>(this.inputElement, 'keyup')\n\t\t\t.pipe(\n\t\t\t\tfilter(ev => ev.key === 'Enter'),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(ev => {\n\t\t\t\tconst { value } = ev.target as HTMLInputElement\n\t\t\t\tthis.value = value\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('enter', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\n\t\t// 4) Detect autofill animation (Chrome, etc.)\n\t\tfromEvent<AnimationEvent>(this.inputElement, 'animationstart')\n\t\t\t.pipe(\n\t\t\t\tfilter(ev => ev.animationName === 'onAutoFillStart'),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(ev => {\n\t\t\t\tconst { value } = ev.target as HTMLInputElement\n\t\t\t\tthis.value = value\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('change', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\t}\n\n\t// ----------------------------\n\t// E) Utility Methods\n\t// ----------------------------\n\t/** Selects all text within the input. */\n\tpublic select() {\n\t\treturn this.inputRef.value?.select()\n\t}\n\n\t/** Returns the native validity state of the inner <input>. */\n\tpublic getValidity(): ValidityState | undefined {\n\t\treturn this.inputRef.value?.validity\n\t}\n\n\t/**\n\t * Override to forward focus to the internal <input>.\n\t * Also dispatch a 'focus' event for external listeners.\n\t */\n\tpublic override focus(options?: FocusOptions) {\n\t\tthis.inputRef.value?.focus(options)\n\t\tthis.dispatchEvent(new Event('focus'))\n\t}\n\n\t/**\n\t * Override to forward clicks to the internal <input>.\n\t * Also dispatch a 'click' event for external listeners.\n\t */\n\tpublic override click() {\n\t\tthis.inputRef.value?.click()\n\t\tthis.dispatchEvent(new Event('click'))\n\t}\n\n\t/** Forward blur to the internal <input>. */\n\tpublic override blur() {\n\t\tthis.inputRef.value?.blur()\n\t\tthis.dispatchEvent(new Event('blur'))\n\t}\n\n\t// ----------------------------\n\t// F) Rendering\n\t// ----------------------------\n\tprotected override render() {\n\t\tconst inputClasses = {\n\t\t\t'w-full flex-1 h-[50px] rounded-[8px] border-0 px-[8px] sm:px-[12px] md:px-[16px]': true,\n\t\t\t'outline-secondary-default focus:outline-1 ': true,\n\t\t\t'disabled:opacity-40 disabled:cursor-not-allowed': true,\n\t\t\t'placeholder:text-muted': true,\n\t\t\t'ring-0 ring-inset focus:ring-1 focus:ring-inset': true,\n\t\t\t// If not in error state, use standard ring color:\n\t\t\t'ring-secondary-default ring-outline focus:ring-secondary-default': !this.error,\n\t\t\t// Error ring override:\n\t\t\t'ring-error-default focus:ring-error-default': this.error,\n\t\t\t// If read-only but \"clickable\" is true, show pointer. Otherwise normal text cursor.\n\t\t\t'caret-transparent focus:outline-hidden cursor-pointer text-select-none': this.readonly,\n\t\t\t'cursor-pointer': this.clickable,\n\t\t\t// Alignment classes:\n\t\t\t'text-center': this.align === 'center',\n\t\t\t'text-right': this.align === 'right',\n\t\t}\n\n\t\tconst labelClasses = {\n\t\t\t'opacity-40': this.disabled,\n\t\t\t'block mb-[4px]': true,\n\t\t}\n\n\t\t/**\n\t\t * - If `this.label` is present, we render a proper `<label for=\"${this.id}\">`.\n\t\t * - If not, we add an aria-label to the <input> for better accessibility.\n\t\t * - If there's a `hint`, we reference it via aria-describedby.\n\t\t * - If there's an error, we set aria-invalid and could set aria-errormessage.\n\t\t */\n\t\treturn html`\n\t\t\t${when(\n\t\t\t\tthis.label,\n\t\t\t\t() => html`\n\t\t\t\t\t<label\n\t\t\t\t\t\tfor=${this.id}\n\t\t\t\t\t\tid=\"label-${this.id}\"\n\t\t\t\t\t\tclass=${classMap(labelClasses)}\n\t\t\t\t\t\t${color({\n\t\t\t\t\t\t\tcolor: this.error ? SchmancyTheme.sys.color.error.default : SchmancyTheme.sys.color.primary.default,\n\t\t\t\t\t\t})}\n\t\t\t\t\t>\n\t\t\t\t\t\t<schmancy-typography type=\"label\" token=\"lg\">${this.label}</schmancy-typography>\n\t\t\t\t\t</label>\n\t\t\t\t`,\n\t\t\t)}\n\n\t\t\t<form @submit=${(e: Event) => e.preventDefault()} .autocomplete=${this.autocomplete === 'off' ? 'off' : 'on'}>\n\t\t\t\t<input\n\t\t\t\t\t${color({\n\t\t\t\t\t\tbgColor: SchmancyTheme.sys.color.surface.highest,\n\t\t\t\t\t\tcolor: SchmancyTheme.sys.color.surface.on,\n\t\t\t\t\t})}\n\t\t\t\t\t${ref(this.inputRef)}\n\t\t\t\t\tid=${this.id}\n\t\t\t\t\tname=${this.name}\n\t\t\t\t\tclass=${classMap(inputClasses)}\n\t\t\t\t\t.value=${this.value}\n\t\t\t\t\t.type=${this.type}\n\t\t\t\t\t.autocomplete=${this.autocomplete}\n\t\t\t\t\t.spellcheck=${this.spellcheck}\n\t\t\t\t\tplaceholder=${this.placeholder}\n\t\t\t\t\tinputmode=${ifDefined(this.inputmode)}\n\t\t\t\t\tpattern=${ifDefined(this.pattern)}\n\t\t\t\t\tstep=${ifDefined(this.step)}\n\t\t\t\t\tminlength=${ifDefined(this.minlength)}\n\t\t\t\t\tmaxlength=${ifDefined(this.maxlength)}\n\t\t\t\t\tmin=${ifDefined(this.min)}\n\t\t\t\t\tmax=${ifDefined(this.max)}\n\t\t\t\t\t?required=${this.required}\n\t\t\t\t\t?disabled=${this.disabled}\n\t\t\t\t\t?readonly=${this.readonly}\n\t\t\t\t\taria-invalid=${this.error ? 'true' : 'false'}\n\t\t\t\t\taria-required=${this.required ? 'true' : 'false'}\n\t\t\t\t\taria-labelledby=${this.label ? `label-${this.id}` : nothing}\n\t\t\t\t\taria-describedby=${this.hint ? `hint-${this.id}` : nothing}\n\t\t\t\t\taria-label=${ifDefined(!this.label ? this.placeholder || 'Input' : undefined)}\n\t\t\t\t/>\n\t\t\t</form>\n\n\t\t\t${when(\n\t\t\t\tthis.hint,\n\t\t\t\t() => html`\n\t\t\t\t\t<div\n\t\t\t\t\t\tid=\"hint-${this.id}\"\n\t\t\t\t\t\tclass=\"pt-[4px]\"\n\t\t\t\t\t\t${color({\n\t\t\t\t\t\t\tcolor: this.error ? SchmancyTheme.sys.color.error.default : SchmancyTheme.sys.color.primary.default,\n\t\t\t\t\t\t})}\n\t\t\t\t\t>\n\t\t\t\t\t\t<schmancy-typography align=\"left\" type=\"body\" token=\"sm\"> ${this.hint} </schmancy-typography>\n\t\t\t\t\t</div>\n\t\t\t\t`,\n\t\t\t)}\n\t\t`\n\t}\n}\n"],"names":["SchmancyInput","TailwindElement","super","this","id","label","type","name","Date","now","placeholder","value","required","disabled","readonly","clickable","spellcheck","align","autofocus","autocomplete","tabIndex","error","inputRef","createRef","internals","attachInternals","undefined","changedProps","_idCounter","willUpdate","form","updated","has","setFormValue","setValidity","customError","inputElement","checkValidity","reportValidity","message","setCustomValidity","focus","fromEvent","pipe","map","ev","target","distinctUntilChanged","takeUntil","disconnecting","subscribe","dispatchEvent","CustomEvent","detail","bubbles","composed","filter","key","animationName","select","validity","options","Event","click","blur","render","inputClasses","labelClasses","html","when","classMap","color","SchmancyTheme","sys","default","primary","e","preventDefault","bgColor","surface","highest","on","ref","ifDefined","inputmode","pattern","step","minlength","maxlength","min","max","nothing","hint","formAssociated","shadowRootOptions","LitElement","delegatesFocus","__decorateClass","property","reflect","prototype","String","Boolean","Number","query","customElement"],"mappings":"slBAgDA,IAAqBA,EAArB,cAA2CC,EAAAA,gBA+I1C,CAAA,CAAA,aAEC,CAAA,GADMC,MAvIPC,EAAAA,KAAgBC,GAAK,GAMeD,KAAAE,MAAA,GAMpCF,KAAOG,KAcK,OAMZH,KAAOI,KAAO,QAAQC,KAAKC,IAG3BN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qFboG,UAAA,YAAA,CAGAH,EAAAA,EAAA,CADNC,WAAS,CAAE5F,KAAMiG,MAvFEvG,CAAAA,CAAAA,EAAAA,EAwFboG,UAAA,YAAA,GAGAH,EAAA,CADNC,EAASA,SAAAA,CAAAA,EA1FUlG,EA2FboG,UAAA,MAAA,CAGAH,EAAAA,EAAA,CADNC,EAASA,SA7FUlG,CAAAA,EAAAA,EA8FboG,UAAA,MAAA,CAAA,EAGAH,EAAA,CADNC,EAAAA,SAAS,CAAE5F,KAAMiG,OAAQJ,UAhGNnG,CAAAA,CAAAA,EAAAA,EAiGboG,UAAA,OAAA,CAIAH,EAAAA,EAAA,CADNC,WAAS,CAAE5F,KAAMgG,OApGEtG,CAAAA,CAAAA,EAAAA,EAqGboG,UAAA,YAAA,CAIAH,EAAAA,EAAA,CADNC,WAAS,CAAE5F,KAAM+F,MAxGErG,CAAAA,CAAAA,EAAAA,EAyGboG,UAAA,eAAA,GAMAH,EAAA,CADNC,EAAAA,SAAS,CAAE5F,KAAMiG,OAAQJ,QAAS,EAAA,CAAA,CAAA,EA9GfnG,EA+GboG,UAAA,WAAA,CAMAH,EAAAA,EAAA,CADNC,EAASA,SApHUlG,CAAAA,EAAAA,EAqHboG,UAAA,OAAA,CAAA,EAOAH,EAAA,CADNC,EAAAA,SAAS,CAAE5F,KAAMgG,QAASH,UA3HPnG,CAAAA,CAAAA,EAAAA,EA4HboG,UAAA,QAAA,CAKiBH,EAAAA,EAAA,CAAvBO,EAAAA,MAAM,OAjIaxG,CAAAA,EAAAA,EAiIIoG,UAAA,eAAA,GAjIJpG,EAArBiG,EAAA,CADCQ,EAAAA,cAAc,gBACMzG,CAAAA,EAAAA,CAAAA"}
package/dist/input.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";require("./input-1mohwkxJ.cjs");
1
+ "use strict";require("./input-Robi05py.cjs");
2
2
  //# sourceMappingURL=input.cjs.map
package/dist/input.js CHANGED
@@ -1,2 +1,2 @@
1
- import "./input-RBly67_Q.js";
1
+ import "./input-DYyIyfZh.js";
2
2
  //# sourceMappingURL=input.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./teleport.component-B_fXeDDQ.cjs");exports.$drawer=e.$drawer,Object.defineProperty(exports,"SchmancyDrawerAppbar",{enumerable:!0,get:()=>e.SchmancyDrawerAppbar}),exports.SchmancyDrawerNavbarMode=e.SchmancyDrawerNavbarMode,exports.SchmancyDrawerNavbarState=e.SchmancyDrawerNavbarState,Object.defineProperty(exports,"SchmancyNavigationDrawer",{enumerable:!0,get:()=>e.SchmancyNavigationDrawer}),Object.defineProperty(exports,"SchmancyNavigationDrawerContent",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerContent}),Object.defineProperty(exports,"SchmancyNavigationDrawerSidebar",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerSidebar}),exports.schmancyNavDrawer=e.schmancyNavDrawer;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./teleport.component-D8OSIPGk.cjs");exports.$drawer=e.$drawer,Object.defineProperty(exports,"SchmancyDrawerAppbar",{enumerable:!0,get:()=>e.SchmancyDrawerAppbar}),exports.SchmancyDrawerNavbarMode=e.SchmancyDrawerNavbarMode,exports.SchmancyDrawerNavbarState=e.SchmancyDrawerNavbarState,Object.defineProperty(exports,"SchmancyNavigationDrawer",{enumerable:!0,get:()=>e.SchmancyNavigationDrawer}),Object.defineProperty(exports,"SchmancyNavigationDrawerContent",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerContent}),Object.defineProperty(exports,"SchmancyNavigationDrawerSidebar",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerSidebar}),exports.schmancyNavDrawer=e.schmancyNavDrawer;
2
2
  //# sourceMappingURL=nav-drawer.cjs.map
@@ -1,4 +1,4 @@
1
- import { $ as c, i as e, k as n, l as m, m as s, j as h, n as i, h as t } from "./teleport.component-CoGQ6xi-.js";
1
+ import { $ as c, i as e, k as n, l as m, m as s, j as h, n as i, h as t } from "./teleport.component-BwflD2xY.js";
2
2
  export {
3
3
  c as $drawer,
4
4
  e as SchmancyDrawerAppbar,
@@ -1 +1 @@
1
- {"version":3,"file":"select-CV5sua6X.cjs","sources":["../src/select/select.ts"],"sourcesContent":["import { autoUpdate, computePosition, flip, offset, shift } from '@floating-ui/dom'\nimport { $LitElement } from '@mixins/index'\nimport { color } from '@schmancy/directives'\nimport SchmancyOption from '@schmancy/option/option'\nimport { SchmancyTheme } from '@schmancy/theme/theme.interface'\nimport { css, html } from 'lit'\nimport { customElement, property, query, queryAssignedElements, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\n\nexport type SchmancySelectChangeEvent = CustomEvent<{\n\tvalue: string | string[]\n}>\n\n@customElement('schmancy-select')\nexport class SchmancySelect extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t\tposition: relative;\n\t}\n\n\t[role='listbox'] {\n\t\tmax-height: 25vh;\n\t\toverflow-y: auto;\n\t\toutline: none;\n\t}\n`) {\n\t// API\n\t@property({ type: Boolean }) required = false\n\t@property({ type: String }) placeholder = ''\n\t@property({ type: String }) value = '' // for single-select\n\t@property({ type: Array }) selectedValues: string[] = [] // for multi-select\n\t@property({ type: Boolean }) multi = false\n\t@property({ type: String }) label = ''\n\n\t// Internal states\n\t@state() private isOpen = false\n\t@state() private valueLabel = ''\n\n\t@query('ul') private ul!: HTMLUListElement\n\t@queryAssignedElements({ flatten: true }) private options!: SchmancyOption[]\n\tprivate cleanupPositioner?: () => void\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tif (!this.id) {\n\t\t\tthis.id = `schmancy-select-${Math.random().toString(36).substr(2, 9)}`\n\t\t}\n\t\tthis.addEventListener('keydown', this.handleKeyDown)\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis.removeEventListener('keydown', this.handleKeyDown)\n\t\tthis.cleanupPositioner?.()\n\t}\n\n\tfirstUpdated() {\n\t\tthis.syncSelection()\n\t\tthis.setupOptionsAccessibility()\n\t}\n\n\tprivate syncSelection() {\n\t\tif (this.multi) {\n\t\t\tthis.selectedValues = this.options.filter(o => o.selected).map(o => o.value)\n\t\t\tthis.valueLabel =\n\t\t\t\tthis.selectedValues.length > 0\n\t\t\t\t\t? this.options\n\t\t\t\t\t\t\t.filter(o => this.selectedValues.includes(o.value))\n\t\t\t\t\t\t\t.map(o => o.label)\n\t\t\t\t\t\t\t.join(', ')\n\t\t\t\t\t: this.placeholder\n\t\t} else {\n\t\t\tconst selectedOption = this.options.find(o => o.value === this.value)\n\t\t\tthis.valueLabel = selectedOption?.label || this.placeholder\n\t\t}\n\t}\n\n\tprivate setupOptionsAccessibility() {\n\t\tthis.options.forEach((option, index) => {\n\t\t\toption.setAttribute('role', 'option')\n\t\t\tif (!option.id) {\n\t\t\t\toption.id = `${this.id}-option-${index}`\n\t\t\t}\n\t\t\toption.tabIndex = -1\n\t\t\toption.setAttribute(\n\t\t\t\t'aria-selected',\n\t\t\t\tString(this.multi ? this.selectedValues.includes(option.value) : option.value === this.value),\n\t\t\t)\n\t\t})\n\t}\n\n\tprivate async positionDropdown() {\n\t\tconst reference = this.renderRoot.querySelector('.trigger') as HTMLElement\n\t\tif (!reference || !this.ul) return\n\n\t\tthis.cleanupPositioner = autoUpdate(reference, this.ul, async () => {\n\t\t\tconst { x, y } = await computePosition(reference, this.ul, {\n\t\t\t\tplacement: 'bottom-start',\n\t\t\t\tmiddleware: [offset(5), flip(), shift({ padding: 5 })],\n\t\t\t})\n\n\t\t\tObject.assign(this.ul.style, {\n\t\t\t\tleft: `${x}px`,\n\t\t\t\ttop: `${y}px`,\n\t\t\t\tposition: 'absolute',\n\t\t\t})\n\t\t})\n\t}\n\n\tprivate handleKeyDown(e: KeyboardEvent) {\n\t\tif (!this.isOpen) {\n\t\t\tif (['Enter', ' ', 'ArrowDown'].includes(e.key)) {\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.openDropdown()\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tconst current = this.options.findIndex(o => o.matches(':focus')) ?? -1\n\n\t\tswitch (e.key) {\n\t\t\tcase 'Escape':\n\t\t\t\tthis.closeDropdown()\n\t\t\t\tbreak\n\t\t\tcase 'ArrowDown':\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.focusOption(this.options, Math.min(current + 1, this.options.length - 1))\n\t\t\t\tbreak\n\t\t\tcase 'ArrowUp':\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.focusOption(this.options, Math.max(current - 1, 0))\n\t\t\t\tbreak\n\t\t\tcase 'Enter':\n\t\t\tcase ' ':\n\t\t\t\te.preventDefault()\n\t\t\t\tif (current >= 0) this.handleOptionSelect(this.options[current].value)\n\t\t\t\tbreak\n\t\t\tcase 'Tab':\n\t\t\t\tthis.closeDropdown()\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\tprivate focusOption(options: HTMLElement[], index: number) {\n\t\tconst option = options[index]\n\t\tif (option) {\n\t\t\toption.focus()\n\t\t\tconst combobox = this.renderRoot.querySelector('.trigger')\n\t\t\tcombobox?.setAttribute('aria-activedescendant', option.id)\n\t\t}\n\t}\n\n\tprivate async openDropdown() {\n\t\tthis.isOpen = true\n\t\tawait this.updateComplete\n\n\t\tthis.positionDropdown()\n\t\tthis.setupOptionsAccessibility()\n\n\t\tconst options = Array.from(this.ul.querySelectorAll('[role=\"option\"]')) as HTMLElement[]\n\t\tconst selectedIndex = this.multi ? 0 : options.findIndex(o => o.getAttribute('value') === this.value)\n\t\tthis.focusOption(options, Math.max(selectedIndex, 0))\n\t}\n\n\tprivate closeDropdown() {\n\t\tthis.isOpen = false\n\t\tthis.cleanupPositioner?.()\n\t\tconst combobox = this.renderRoot.querySelector<HTMLElement>('.trigger')\n\t\tcombobox?.removeAttribute('aria-activedescendant')\n\t\tcombobox?.focus()\n\t}\n\n\tprivate handleOptionSelect(value: string) {\n\t\tif (this.multi) {\n\t\t\tconst option = this.options.find(o => o.value === value)\n\t\t\tif (!option) return\n\n\t\t\toption.selected = !option.selected\n\t\t\tif (option.selected) {\n\t\t\t\tthis.selectedValues = [...this.selectedValues, value]\n\t\t\t} else {\n\t\t\t\tthis.selectedValues = this.selectedValues.filter(v => v !== value)\n\t\t\t}\n\n\t\t\tthis.valueLabel =\n\t\t\t\tthis.selectedValues.length > 0\n\t\t\t\t\t? this.options\n\t\t\t\t\t\t\t.filter(o => this.selectedValues.includes(o.value))\n\t\t\t\t\t\t\t.map(o => o.label)\n\t\t\t\t\t\t\t.join(', ')\n\t\t\t\t\t: this.placeholder\n\n\t\t\tthis.dispatchChange(this.selectedValues)\n\t\t} else {\n\t\t\tthis.options.forEach(o => (o.selected = o.value === value))\n\t\t\tthis.value = value\n\t\t\tthis.valueLabel = this.options.find(o => o.value === value)?.label || this.placeholder\n\t\t\tthis.dispatchChange(value)\n\t\t\tthis.closeDropdown()\n\t\t}\n\n\t\tthis.setupOptionsAccessibility()\n\t}\n\n\tprivate dispatchChange(value: string | string[]) {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent<SchmancySelectChangeEvent['detail']>('change', {\n\t\t\t\tdetail: { value },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<div class=\"relative\">\n\t\t\t\t<schmancy-input\n\t\t\t\t\ttabIndex=\"0\"\n\t\t\t\t\tclass=\"trigger\"\n\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\taria-haspopup=\"listbox\"\n\t\t\t\t\taria-expanded=${this.isOpen}\n\t\t\t\t\taria-controls=\"options\"\n\t\t\t\t\taria-autocomplete=\"none\"\n\t\t\t\t\taria-required=${this.required}\n\t\t\t\t\t.label=${this.label}\n\t\t\t\t\t.placeholder=${this.placeholder}\n\t\t\t\t\t.value=${this.valueLabel}\n\t\t\t\t\t.required=${this.required}\n\t\t\t\t\treadonly\n\t\t\t\t\t@click=${() => (this.isOpen ? this.closeDropdown() : this.openDropdown())}\n\t\t\t\t></schmancy-input>\n\n\t\t\t\t<div\n\t\t\t\t\tid=\"overlay\"\n\t\t\t\t\tclass=\"fixed inset-0\"\n\t\t\t\t\t?hidden=${!this.isOpen}\n\t\t\t\t\t@click=${this.closeDropdown}\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t></div>\n\n\t\t\t\t<ul\n\t\t\t\t\tid=\"options\"\n\t\t\t\t\trole=\"listbox\"\n\t\t\t\t\taria-multiselectable=${this.multi}\n\t\t\t\t\tclass=${classMap({\n\t\t\t\t\t\t'absolute z-30 mt-1 w-full rounded-md shadow-sm': true,\n\t\t\t\t\t\thidden: !this.isOpen,\n\t\t\t\t\t})}\n\t\t\t\t\t${color({ bgColor: SchmancyTheme.sys.color.surface.container })}\n\t\t\t\t\t@click=${(e: Event) => {\n\t\t\t\t\t\tconst customEvt = e as CustomEvent\n\t\t\t\t\t\tconst detailVal = customEvt.detail?.value\n\t\t\t\t\t\tif (detailVal) {\n\t\t\t\t\t\t\tthis.handleOptionSelect(detailVal)\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<slot\n\t\t\t\t\t\t@slotchange=${() => {\n\t\t\t\t\t\t\tthis.syncSelection()\n\t\t\t\t\t\t\tthis.setupOptionsAccessibility()\n\t\t\t\t\t\t}}\n\t\t\t\t\t></slot>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t`\n\t}\n}\n"],"names":["SchmancySelect","$LitElement","css","super","arguments","this","required","placeholder","value","selectedValues","multi","label","isOpen","valueLabel","connectedCallback","id","Math","random","toString","substr","addEventListener","handleKeyDown","disconnectedCallback","removeEventListener","cleanupPositioner","syncSelection","setupOptionsAccessibility","options","filter","o","selected","map","length","includes","join","selectedOption","find","forEach","option","index","setAttribute","tabIndex","String","positionDropdown","reference","renderRoot","querySelector","ul","autoUpdate","async","x","y","computePosition","placement","middleware","offset","flip","shift","padding","Object","assign","style","left","top","position","e","key","preventDefault","openDropdown","current","findIndex","matches","closeDropdown","focusOption","min","max","handleOptionSelect","focus","combobox","updateComplete","Array","from","querySelectorAll","selectedIndex","getAttribute","removeAttribute","v","dispatchChange","dispatchEvent","CustomEvent","detail","bubbles","composed","html","classMap","hidden","color","bgColor","SchmancyTheme","sys","surface","container","customEvt","detailVal","__decorateClass","property","type","Boolean","prototype","state","query","queryAssignedElements","flatten","customElement"],"mappings":"wjBAcaA,QAAAA,eAAN,cAA6BC,EAAAA,YAAYC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAAzC,CAAA,CAAA,aAAAC,CAAAA,MAAAA,GAAAC,SAakCC,EAAAA,KAAAC,SAAA,GACED,KAAAE,YAAA,GACNF,KAAAG,MAAA,GACTH,KAAAI,eAA2B,CACjBJ,EAAAA,KAAAK,MAAA,GACDL,KAAAM,MAAA,GAG3BN,KAAQO,OAAS,GACjBP,KAAQQ,WAAa,EAAA,CAM9B,mBAAAC,CACCX,MAAMW,kBAAAA,EACDT,KAAKU,KACJV,KAAAU,GAAK,mBAAmBC,KAAKC,OAASC,EAAAA,SAAS,EAAIC,EAAAA,OAAO,EAAG,CAAA,CAAA,IAE9Dd,KAAAe,iBAAiB,UAAWf,KAAKgB,aAAa,CAAA,CAGpD,sBAAAC,OACCnB,MAAMmB,qBAAAA,EACDjB,KAAAkB,oBAAoB,UAAWlB,KAAKgB,aACzChB,GAAAA,EAAAA,KAAKmB,oBAALnB,MAAAA,EAAAA,UAAyB,CAG1B,cACCA,CAAAA,KAAKoB,cACLpB,EAAAA,KAAKqB,0BAA0B,CAAA,CAGxB,eAAAD,CACP,GAAIpB,KAAKK,MACHL,KAAAI,eAAiBJ,KAAKsB,QAAQC,OAAOC,GAAKA,EAAEC,QAAUC,EAAAA,IAASF,GAAAA,EAAErB,KACjEH,EAAAA,KAAAQ,WACJ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AcgB4G,UAAA,cAAA,CAAA,EACAJ,EAAA,CAA3BC,WAAS,CAAEC,KAAMhE,MAAAA,CAAAA,CAAAA,EAfN1C,uBAegB4G,UAAA,QAAA,CACDJ,EAAAA,EAAA,CAA1BC,WAAS,CAAEC,KAAM1B,KAAAA,CAAAA,CAAAA,EAhBNhF,uBAgBe4G,UAAA,iBAAA,CACEJ,EAAAA,EAAA,CAA5BC,WAAS,CAAEC,KAAMC,OAAAA,CAAAA,CAAAA,EAjBN3G,uBAiBiB4G,UAAA,QAAA,GACDJ,EAAA,CAA3BC,WAAS,CAAEC,KAAMhE,MAlBN1C,CAAAA,CAAAA,EAAAA,uBAkBgB4G,UAAA,QAAA,CAAA,EAGXJ,EAAA,CAAhBK,EAAMA,MAAAA,CAAAA,EArBK7G,uBAqBK4G,UAAA,SAAA,CACAJ,EAAAA,EAAA,CAAhBK,EAAMA,MAtBK7G,CAAAA,EAAAA,uBAsBK4G,UAAA,aAAA,CAAA,EAEIJ,EAAA,CAApBM,EAAAA,MAAM,IAAA,CAAA,EAxBK9G,uBAwBS4G,UAAA,KAAA,CAC6BJ,EAAAA,EAAA,CAAjDO,wBAAsB,CAAEC,QAAS,EAAA,CAAA,CAAA,EAzBtBhH,uBAyBsC4G,UAAA,UAAA,CAzBtC5G,EAAAA,QAANA,eAAAwG,EAAA,CADNS,EAAAA,cAAc,iBAAA,CAAA,EACFjH"}
1
+ {"version":3,"file":"select-CV5sua6X.cjs","sources":["../src/select/select.ts"],"sourcesContent":["import { autoUpdate, computePosition, flip, offset, shift } from '@floating-ui/dom'\nimport { $LitElement } from '@mixins/index'\nimport { color } from '@schmancy/directives'\nimport SchmancyOption from '@schmancy/option/option'\nimport { SchmancyTheme } from '@schmancy/theme/theme.interface'\nimport { css, html } from 'lit'\nimport { customElement, property, query, queryAssignedElements, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\n\nexport type SchmancySelectChangeEvent = CustomEvent<{\n\tvalue: string | string[]\n}>\n\n@customElement('schmancy-select')\nexport class SchmancySelect extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t\tposition: relative;\n\t}\n\n\t[role='listbox'] {\n\t\tmax-height: 25vh;\n\t\toverflow-y: auto;\n\t\toutline: none;\n\t}\n`) {\n\t// API\n\t@property({ type: Boolean }) required = false\n\t@property({ type: String }) placeholder = ''\n\t@property({ type: String }) value = '' // for single-select\n\t@property({ type: Array }) selectedValues: string[] = [] // for multi-select\n\t@property({ type: Boolean }) multi = false\n\t@property({ type: String }) label = ''\n\n\t// Internal states\n\t@state() private isOpen = false\n\t@state() private valueLabel = ''\n\n\t@query('ul') private ul!: HTMLUListElement\n\t@queryAssignedElements({ flatten: true }) private options!: SchmancyOption[]\n\tprivate cleanupPositioner?: () => void\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tif (!this.id) {\n\t\t\tthis.id = `schmancy-select-${Math.random().toString(36).substr(2, 9)}`\n\t\t}\n\t\tthis.addEventListener('keydown', this.handleKeyDown)\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis.removeEventListener('keydown', this.handleKeyDown)\n\t\tthis.cleanupPositioner?.()\n\t}\n\n\tfirstUpdated() {\n\t\tthis.syncSelection()\n\t\tthis.setupOptionsAccessibility()\n\t}\n\n\tprivate syncSelection() {\n\t\tif (this.multi) {\n\t\t\tthis.selectedValues = this.options.filter(o => o.selected).map(o => o.value)\n\t\t\tthis.valueLabel =\n\t\t\t\tthis.selectedValues.length > 0\n\t\t\t\t\t? this.options\n\t\t\t\t\t\t\t.filter(o => this.selectedValues.includes(o.value))\n\t\t\t\t\t\t\t.map(o => o.label)\n\t\t\t\t\t\t\t.join(', ')\n\t\t\t\t\t: this.placeholder\n\t\t} else {\n\t\t\tconst selectedOption = this.options.find(o => o.value === this.value)\n\t\t\tthis.valueLabel = selectedOption?.label || this.placeholder\n\t\t}\n\t}\n\n\tprivate setupOptionsAccessibility() {\n\t\tthis.options.forEach((option, index) => {\n\t\t\toption.setAttribute('role', 'option')\n\t\t\tif (!option.id) {\n\t\t\t\toption.id = `${this.id}-option-${index}`\n\t\t\t}\n\t\t\toption.tabIndex = -1\n\t\t\toption.setAttribute(\n\t\t\t\t'aria-selected',\n\t\t\t\tString(this.multi ? this.selectedValues.includes(option.value) : option.value === this.value),\n\t\t\t)\n\t\t})\n\t}\n\n\tprivate async positionDropdown() {\n\t\tconst reference = this.renderRoot.querySelector('.trigger') as HTMLElement\n\t\tif (!reference || !this.ul) return\n\n\t\tthis.cleanupPositioner = autoUpdate(reference, this.ul, async () => {\n\t\t\tconst { x, y } = await computePosition(reference, this.ul, {\n\t\t\t\tplacement: 'bottom-start',\n\t\t\t\tmiddleware: [offset(5), flip(), shift({ padding: 5 })],\n\t\t\t})\n\n\t\t\tObject.assign(this.ul.style, {\n\t\t\t\tleft: `${x}px`,\n\t\t\t\ttop: `${y}px`,\n\t\t\t\tposition: 'absolute',\n\t\t\t})\n\t\t})\n\t}\n\n\tprivate handleKeyDown(e: KeyboardEvent) {\n\t\tif (!this.isOpen) {\n\t\t\tif (['Enter', ' ', 'ArrowDown'].includes(e.key)) {\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.openDropdown()\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tconst current = this.options.findIndex(o => o.matches(':focus')) ?? -1\n\n\t\tswitch (e.key) {\n\t\t\tcase 'Escape':\n\t\t\t\tthis.closeDropdown()\n\t\t\t\tbreak\n\t\t\tcase 'ArrowDown':\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.focusOption(this.options, Math.min(current + 1, this.options.length - 1))\n\t\t\t\tbreak\n\t\t\tcase 'ArrowUp':\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.focusOption(this.options, Math.max(current - 1, 0))\n\t\t\t\tbreak\n\t\t\tcase 'Enter':\n\t\t\tcase ' ':\n\t\t\t\te.preventDefault()\n\t\t\t\tif (current >= 0) this.handleOptionSelect(this.options[current].value)\n\t\t\t\tbreak\n\t\t\tcase 'Tab':\n\t\t\t\tthis.closeDropdown()\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\tprivate focusOption(options: HTMLElement[], index: number) {\n\t\tconst option = options[index]\n\t\tif (option) {\n\t\t\toption.focus()\n\t\t\tconst combobox = this.renderRoot.querySelector('.trigger')\n\t\t\tcombobox?.setAttribute('aria-activedescendant', option.id)\n\t\t}\n\t}\n\n\tprivate async openDropdown() {\n\t\tthis.isOpen = true\n\t\tawait this.updateComplete\n\n\t\tthis.positionDropdown()\n\t\tthis.setupOptionsAccessibility()\n\n\t\tconst options = Array.from(this.ul.querySelectorAll('[role=\"option\"]')) as HTMLElement[]\n\t\tconst selectedIndex = this.multi ? 0 : options.findIndex(o => o.getAttribute('value') === this.value)\n\t\tthis.focusOption(options, Math.max(selectedIndex, 0))\n\t}\n\n\tprivate closeDropdown() {\n\t\tthis.isOpen = false\n\t\tthis.cleanupPositioner?.()\n\t\tconst combobox = this.renderRoot.querySelector<HTMLElement>('.trigger')\n\t\tcombobox?.removeAttribute('aria-activedescendant')\n\t\tcombobox?.focus()\n\t}\n\n\tprivate handleOptionSelect(value: string) {\n\t\tif (this.multi) {\n\t\t\tconst option = this.options.find(o => o.value === value)\n\t\t\tif (!option) return\n\n\t\t\toption.selected = !option.selected\n\t\t\tif (option.selected) {\n\t\t\t\tthis.selectedValues = [...this.selectedValues, value]\n\t\t\t} else {\n\t\t\t\tthis.selectedValues = this.selectedValues.filter(v => v !== value)\n\t\t\t}\n\n\t\t\tthis.valueLabel =\n\t\t\t\tthis.selectedValues.length > 0\n\t\t\t\t\t? this.options\n\t\t\t\t\t\t\t.filter(o => this.selectedValues.includes(o.value))\n\t\t\t\t\t\t\t.map(o => o.label)\n\t\t\t\t\t\t\t.join(', ')\n\t\t\t\t\t: this.placeholder\n\n\t\t\tthis.dispatchChange(this.selectedValues)\n\t\t} else {\n\t\t\tthis.options.forEach(o => (o.selected = o.value === value))\n\t\t\tthis.value = value\n\t\t\tthis.valueLabel = this.options.find(o => o.value === value)?.label || this.placeholder\n\t\t\tthis.dispatchChange(value)\n\t\t\tthis.closeDropdown()\n\t\t}\n\n\t\tthis.setupOptionsAccessibility()\n\t}\n\n\tprivate dispatchChange(value: string | string[]) {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent<SchmancySelectChangeEvent['detail']>('change', {\n\t\t\t\tdetail: { value },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<div class=\"relative\">\n\t\t\t\t<schmancy-input\n\t\t\t\t\ttabIndex=\"0\"\n\t\t\t\t\tclass=\"trigger\"\n\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\taria-haspopup=\"listbox\"\n\t\t\t\t\taria-expanded=${this.isOpen}\n\t\t\t\t\taria-controls=\"options\"\n\t\t\t\t\taria-autocomplete=\"none\"\n\t\t\t\t\taria-required=${this.required}\n\t\t\t\t\t.label=${this.label}\n\t\t\t\t\t.placeholder=${this.placeholder}\n\t\t\t\t\t.value=${this.valueLabel}\n\t\t\t\t\t.required=${this.required}\n\t\t\t\t\treadonly\n\t\t\t\t\t@click=${() => (this.isOpen ? this.closeDropdown() : this.openDropdown())}\n\t\t\t\t></schmancy-input>\n\n\t\t\t\t<div\n\t\t\t\t\tid=\"overlay\"\n\t\t\t\t\tclass=\"fixed inset-0\"\n\t\t\t\t\t?hidden=${!this.isOpen}\n\t\t\t\t\t@click=${this.closeDropdown}\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t></div>\n\n\t\t\t\t<ul\n\t\t\t\t\tid=\"options\"\n\t\t\t\t\trole=\"listbox\"\n\t\t\t\t\taria-multiselectable=${this.multi}\n\t\t\t\t\tclass=${classMap({\n\t\t\t\t\t\t'absolute z-30 mt-1 w-full rounded-md shadow-sm': true,\n\t\t\t\t\t\thidden: !this.isOpen,\n\t\t\t\t\t})}\n\t\t\t\t\t${color({ bgColor: SchmancyTheme.sys.color.surface.container })}\n\t\t\t\t\t@click=${(e: Event) => {\n\t\t\t\t\t\tconst customEvt = e as CustomEvent\n\t\t\t\t\t\tconst detailVal = customEvt.detail?.value\n\t\t\t\t\t\tif (detailVal) {\n\t\t\t\t\t\t\tthis.handleOptionSelect(detailVal)\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<slot\n\t\t\t\t\t\t@slotchange=${() => {\n\t\t\t\t\t\t\tthis.syncSelection()\n\t\t\t\t\t\t\tthis.setupOptionsAccessibility()\n\t\t\t\t\t\t}}\n\t\t\t\t\t></slot>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-select': SchmancySelect\n\t}\n}\n"],"names":["SchmancySelect","$LitElement","css","super","arguments","this","required","placeholder","value","selectedValues","multi","label","isOpen","valueLabel","connectedCallback","id","Math","random","toString","substr","addEventListener","handleKeyDown","disconnectedCallback","removeEventListener","cleanupPositioner","syncSelection","setupOptionsAccessibility","options","filter","o","selected","map","length","includes","join","selectedOption","find","forEach","option","index","setAttribute","tabIndex","String","positionDropdown","reference","renderRoot","querySelector","ul","autoUpdate","async","x","y","computePosition","placement","middleware","offset","flip","shift","padding","Object","assign","style","left","top","position","e","key","preventDefault","openDropdown","current","findIndex","matches","closeDropdown","focusOption","min","max","handleOptionSelect","focus","combobox","updateComplete","Array","from","querySelectorAll","selectedIndex","getAttribute","removeAttribute","v","dispatchChange","dispatchEvent","CustomEvent","detail","bubbles","composed","html","classMap","hidden","color","bgColor","SchmancyTheme","sys","surface","container","customEvt","detailVal","__decorateClass","property","type","Boolean","prototype","state","query","queryAssignedElements","flatten","customElement"],"mappings":"wjBAcaA,QAAAA,eAAN,cAA6BC,EAAAA,YAAYC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;A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AAA,QAAA,CAAA,EAGXJ,EAAA,CAAhBK,EAAMA,MAAAA,CAAAA,EArBK7G,uBAqBK4G,UAAA,SAAA,CACAJ,EAAAA,EAAA,CAAhBK,EAAMA,MAtBK7G,CAAAA,EAAAA,uBAsBK4G,UAAA,aAAA,CAAA,EAEIJ,EAAA,CAApBM,EAAAA,MAAM,IAAA,CAAA,EAxBK9G,uBAwBS4G,UAAA,KAAA,CAC6BJ,EAAAA,EAAA,CAAjDO,wBAAsB,CAAEC,QAAS,EAAA,CAAA,CAAA,EAzBtBhH,uBAyBsC4G,UAAA,UAAA,CAzBtC5G,EAAAA,QAANA,eAAAwG,EAAA,CADNS,EAAAA,cAAc,iBAAA,CAAA,EACFjH"}
@@ -1 +1 @@
1
- {"version":3,"file":"select-DOuDb1OD.js","sources":["../src/select/select.ts"],"sourcesContent":["import { autoUpdate, computePosition, flip, offset, shift } from '@floating-ui/dom'\nimport { $LitElement } from '@mixins/index'\nimport { color } from '@schmancy/directives'\nimport SchmancyOption from '@schmancy/option/option'\nimport { SchmancyTheme } from '@schmancy/theme/theme.interface'\nimport { css, html } from 'lit'\nimport { customElement, property, query, queryAssignedElements, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\n\nexport type SchmancySelectChangeEvent = CustomEvent<{\n\tvalue: string | string[]\n}>\n\n@customElement('schmancy-select')\nexport class SchmancySelect extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t\tposition: relative;\n\t}\n\n\t[role='listbox'] {\n\t\tmax-height: 25vh;\n\t\toverflow-y: auto;\n\t\toutline: none;\n\t}\n`) {\n\t// API\n\t@property({ type: Boolean }) required = false\n\t@property({ type: String }) placeholder = ''\n\t@property({ type: String }) value = '' // for single-select\n\t@property({ type: Array }) selectedValues: string[] = [] // for multi-select\n\t@property({ type: Boolean }) multi = false\n\t@property({ type: String }) label = ''\n\n\t// Internal states\n\t@state() private isOpen = false\n\t@state() private valueLabel = ''\n\n\t@query('ul') private ul!: HTMLUListElement\n\t@queryAssignedElements({ flatten: true }) private options!: SchmancyOption[]\n\tprivate cleanupPositioner?: () => void\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tif (!this.id) {\n\t\t\tthis.id = `schmancy-select-${Math.random().toString(36).substr(2, 9)}`\n\t\t}\n\t\tthis.addEventListener('keydown', this.handleKeyDown)\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis.removeEventListener('keydown', this.handleKeyDown)\n\t\tthis.cleanupPositioner?.()\n\t}\n\n\tfirstUpdated() {\n\t\tthis.syncSelection()\n\t\tthis.setupOptionsAccessibility()\n\t}\n\n\tprivate syncSelection() {\n\t\tif (this.multi) {\n\t\t\tthis.selectedValues = this.options.filter(o => o.selected).map(o => o.value)\n\t\t\tthis.valueLabel =\n\t\t\t\tthis.selectedValues.length > 0\n\t\t\t\t\t? this.options\n\t\t\t\t\t\t\t.filter(o => this.selectedValues.includes(o.value))\n\t\t\t\t\t\t\t.map(o => o.label)\n\t\t\t\t\t\t\t.join(', ')\n\t\t\t\t\t: this.placeholder\n\t\t} else {\n\t\t\tconst selectedOption = this.options.find(o => o.value === this.value)\n\t\t\tthis.valueLabel = selectedOption?.label || this.placeholder\n\t\t}\n\t}\n\n\tprivate setupOptionsAccessibility() {\n\t\tthis.options.forEach((option, index) => {\n\t\t\toption.setAttribute('role', 'option')\n\t\t\tif (!option.id) {\n\t\t\t\toption.id = `${this.id}-option-${index}`\n\t\t\t}\n\t\t\toption.tabIndex = -1\n\t\t\toption.setAttribute(\n\t\t\t\t'aria-selected',\n\t\t\t\tString(this.multi ? this.selectedValues.includes(option.value) : option.value === this.value),\n\t\t\t)\n\t\t})\n\t}\n\n\tprivate async positionDropdown() {\n\t\tconst reference = this.renderRoot.querySelector('.trigger') as HTMLElement\n\t\tif (!reference || !this.ul) return\n\n\t\tthis.cleanupPositioner = autoUpdate(reference, this.ul, async () => {\n\t\t\tconst { x, y } = await computePosition(reference, this.ul, {\n\t\t\t\tplacement: 'bottom-start',\n\t\t\t\tmiddleware: [offset(5), flip(), shift({ padding: 5 })],\n\t\t\t})\n\n\t\t\tObject.assign(this.ul.style, {\n\t\t\t\tleft: `${x}px`,\n\t\t\t\ttop: `${y}px`,\n\t\t\t\tposition: 'absolute',\n\t\t\t})\n\t\t})\n\t}\n\n\tprivate handleKeyDown(e: KeyboardEvent) {\n\t\tif (!this.isOpen) {\n\t\t\tif (['Enter', ' ', 'ArrowDown'].includes(e.key)) {\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.openDropdown()\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tconst current = this.options.findIndex(o => o.matches(':focus')) ?? -1\n\n\t\tswitch (e.key) {\n\t\t\tcase 'Escape':\n\t\t\t\tthis.closeDropdown()\n\t\t\t\tbreak\n\t\t\tcase 'ArrowDown':\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.focusOption(this.options, Math.min(current + 1, this.options.length - 1))\n\t\t\t\tbreak\n\t\t\tcase 'ArrowUp':\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.focusOption(this.options, Math.max(current - 1, 0))\n\t\t\t\tbreak\n\t\t\tcase 'Enter':\n\t\t\tcase ' ':\n\t\t\t\te.preventDefault()\n\t\t\t\tif (current >= 0) this.handleOptionSelect(this.options[current].value)\n\t\t\t\tbreak\n\t\t\tcase 'Tab':\n\t\t\t\tthis.closeDropdown()\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\tprivate focusOption(options: HTMLElement[], index: number) {\n\t\tconst option = options[index]\n\t\tif (option) {\n\t\t\toption.focus()\n\t\t\tconst combobox = this.renderRoot.querySelector('.trigger')\n\t\t\tcombobox?.setAttribute('aria-activedescendant', option.id)\n\t\t}\n\t}\n\n\tprivate async openDropdown() {\n\t\tthis.isOpen = true\n\t\tawait this.updateComplete\n\n\t\tthis.positionDropdown()\n\t\tthis.setupOptionsAccessibility()\n\n\t\tconst options = Array.from(this.ul.querySelectorAll('[role=\"option\"]')) as HTMLElement[]\n\t\tconst selectedIndex = this.multi ? 0 : options.findIndex(o => o.getAttribute('value') === this.value)\n\t\tthis.focusOption(options, Math.max(selectedIndex, 0))\n\t}\n\n\tprivate closeDropdown() {\n\t\tthis.isOpen = false\n\t\tthis.cleanupPositioner?.()\n\t\tconst combobox = this.renderRoot.querySelector<HTMLElement>('.trigger')\n\t\tcombobox?.removeAttribute('aria-activedescendant')\n\t\tcombobox?.focus()\n\t}\n\n\tprivate handleOptionSelect(value: string) {\n\t\tif (this.multi) {\n\t\t\tconst option = this.options.find(o => o.value === value)\n\t\t\tif (!option) return\n\n\t\t\toption.selected = !option.selected\n\t\t\tif (option.selected) {\n\t\t\t\tthis.selectedValues = [...this.selectedValues, value]\n\t\t\t} else {\n\t\t\t\tthis.selectedValues = this.selectedValues.filter(v => v !== value)\n\t\t\t}\n\n\t\t\tthis.valueLabel =\n\t\t\t\tthis.selectedValues.length > 0\n\t\t\t\t\t? this.options\n\t\t\t\t\t\t\t.filter(o => this.selectedValues.includes(o.value))\n\t\t\t\t\t\t\t.map(o => o.label)\n\t\t\t\t\t\t\t.join(', ')\n\t\t\t\t\t: this.placeholder\n\n\t\t\tthis.dispatchChange(this.selectedValues)\n\t\t} else {\n\t\t\tthis.options.forEach(o => (o.selected = o.value === value))\n\t\t\tthis.value = value\n\t\t\tthis.valueLabel = this.options.find(o => o.value === value)?.label || this.placeholder\n\t\t\tthis.dispatchChange(value)\n\t\t\tthis.closeDropdown()\n\t\t}\n\n\t\tthis.setupOptionsAccessibility()\n\t}\n\n\tprivate dispatchChange(value: string | string[]) {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent<SchmancySelectChangeEvent['detail']>('change', {\n\t\t\t\tdetail: { value },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<div class=\"relative\">\n\t\t\t\t<schmancy-input\n\t\t\t\t\ttabIndex=\"0\"\n\t\t\t\t\tclass=\"trigger\"\n\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\taria-haspopup=\"listbox\"\n\t\t\t\t\taria-expanded=${this.isOpen}\n\t\t\t\t\taria-controls=\"options\"\n\t\t\t\t\taria-autocomplete=\"none\"\n\t\t\t\t\taria-required=${this.required}\n\t\t\t\t\t.label=${this.label}\n\t\t\t\t\t.placeholder=${this.placeholder}\n\t\t\t\t\t.value=${this.valueLabel}\n\t\t\t\t\t.required=${this.required}\n\t\t\t\t\treadonly\n\t\t\t\t\t@click=${() => (this.isOpen ? this.closeDropdown() : this.openDropdown())}\n\t\t\t\t></schmancy-input>\n\n\t\t\t\t<div\n\t\t\t\t\tid=\"overlay\"\n\t\t\t\t\tclass=\"fixed inset-0\"\n\t\t\t\t\t?hidden=${!this.isOpen}\n\t\t\t\t\t@click=${this.closeDropdown}\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t></div>\n\n\t\t\t\t<ul\n\t\t\t\t\tid=\"options\"\n\t\t\t\t\trole=\"listbox\"\n\t\t\t\t\taria-multiselectable=${this.multi}\n\t\t\t\t\tclass=${classMap({\n\t\t\t\t\t\t'absolute z-30 mt-1 w-full rounded-md shadow-sm': true,\n\t\t\t\t\t\thidden: !this.isOpen,\n\t\t\t\t\t})}\n\t\t\t\t\t${color({ bgColor: SchmancyTheme.sys.color.surface.container })}\n\t\t\t\t\t@click=${(e: Event) => {\n\t\t\t\t\t\tconst customEvt = e as CustomEvent\n\t\t\t\t\t\tconst detailVal = customEvt.detail?.value\n\t\t\t\t\t\tif (detailVal) {\n\t\t\t\t\t\t\tthis.handleOptionSelect(detailVal)\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<slot\n\t\t\t\t\t\t@slotchange=${() => {\n\t\t\t\t\t\t\tthis.syncSelection()\n\t\t\t\t\t\t\tthis.setupOptionsAccessibility()\n\t\t\t\t\t\t}}\n\t\t\t\t\t></slot>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t`\n\t}\n}\n"],"names":["SchmancySelect","$LitElement","css","super","arguments","this","required","placeholder","value","selectedValues","multi","label","isOpen","valueLabel","connectedCallback","id","Math","random","toString","substr","addEventListener","handleKeyDown","disconnectedCallback","removeEventListener","cleanupPositioner","firstUpdated","syncSelection","setupOptionsAccessibility","options","filter","o","selected","map","length","includes","join","selectedOption","find","forEach","option","index","setAttribute","tabIndex","String","positionDropdown","reference","renderRoot","querySelector","ul","autoUpdate","async","x","y","computePosition","placement","middleware","offset","flip","shift","padding","Object","assign","style","left","top","position","e","key","preventDefault","openDropdown","current","findIndex","matches","closeDropdown","focusOption","min","max","handleOptionSelect","focus","combobox","updateComplete","Array","from","querySelectorAll","selectedIndex","getAttribute","removeAttribute","v","dispatchChange","dispatchEvent","CustomEvent","detail","bubbles","composed","render","html","classMap","hidden","color","bgColor","SchmancyTheme","sys","surface","container","customEvt","detailVal","__decorateClass","property","type","Boolean","prototype","state","query","queryAssignedElements","flatten","customElement"],"mappings":";;;;;;;;;;;;;;AAca,IAAAA,IAAN,cAA6BC,EAAYC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAAzC,EAAA;AAAA,EAAA,cAAAC;AAAAA,UAAAA,GAAAC,SAakCC,GAAAA,KAAAC,WAAA,IACED,KAAAE,cAAA,IACNF,KAAAG,QAAA,IACTH,KAAAI,iBAA2B,CACjBJ,GAAAA,KAAAK,QAAA,IACDL,KAAAM,QAAA,IAG3BN,KAAQO,SAAS,IACjBP,KAAQQ,aAAa;AAAA,EAAA;AAAA,EAM9B,oBAAAC;AACCX,UAAMW,kBAAAA,GACDT,KAAKU,OACJV,KAAAU,KAAK,mBAAmBC,KAAKC,OAASC,EAAAA,SAAS,EAAIC,EAAAA,OAAO,GAAG,CAAA,CAAA,KAE9Dd,KAAAe,iBAAiB,WAAWf,KAAKgB,aAAa;AAAA,EAA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EAAA,CAAhBK,EAtBW/G,CAAAA,GAAAA,EAsBK8G,WAAA,cAAA,IAEIJ,EAAA,CAApBM,EAAM,IAxBKhH,CAAAA,GAAAA,EAwBS8G,WAAA,MAAA,CAAA,GAC6BJ,EAAA,CAAjDO,EAAsB,EAAEC,YAzBblH,CAAAA,CAAAA,GAAAA,EAyBsC8G,WAAA,WAAA,CAAA,GAzBtC9G,IAAN0G,EAAA,CADNS,EAAc,iBAAA,CAAA,GACFnH;"}
1
+ {"version":3,"file":"select-DOuDb1OD.js","sources":["../src/select/select.ts"],"sourcesContent":["import { autoUpdate, computePosition, flip, offset, shift } from '@floating-ui/dom'\nimport { $LitElement } from '@mixins/index'\nimport { color } from '@schmancy/directives'\nimport SchmancyOption from '@schmancy/option/option'\nimport { SchmancyTheme } from '@schmancy/theme/theme.interface'\nimport { css, html } from 'lit'\nimport { customElement, property, query, queryAssignedElements, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\n\nexport type SchmancySelectChangeEvent = CustomEvent<{\n\tvalue: string | string[]\n}>\n\n@customElement('schmancy-select')\nexport class SchmancySelect extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t\tposition: relative;\n\t}\n\n\t[role='listbox'] {\n\t\tmax-height: 25vh;\n\t\toverflow-y: auto;\n\t\toutline: none;\n\t}\n`) {\n\t// API\n\t@property({ type: Boolean }) required = false\n\t@property({ type: String }) placeholder = ''\n\t@property({ type: String }) value = '' // for single-select\n\t@property({ type: Array }) selectedValues: string[] = [] // for multi-select\n\t@property({ type: Boolean }) multi = false\n\t@property({ type: String }) label = ''\n\n\t// Internal states\n\t@state() private isOpen = false\n\t@state() private valueLabel = ''\n\n\t@query('ul') private ul!: HTMLUListElement\n\t@queryAssignedElements({ flatten: true }) private options!: SchmancyOption[]\n\tprivate cleanupPositioner?: () => void\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tif (!this.id) {\n\t\t\tthis.id = `schmancy-select-${Math.random().toString(36).substr(2, 9)}`\n\t\t}\n\t\tthis.addEventListener('keydown', this.handleKeyDown)\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis.removeEventListener('keydown', this.handleKeyDown)\n\t\tthis.cleanupPositioner?.()\n\t}\n\n\tfirstUpdated() {\n\t\tthis.syncSelection()\n\t\tthis.setupOptionsAccessibility()\n\t}\n\n\tprivate syncSelection() {\n\t\tif (this.multi) {\n\t\t\tthis.selectedValues = this.options.filter(o => o.selected).map(o => o.value)\n\t\t\tthis.valueLabel =\n\t\t\t\tthis.selectedValues.length > 0\n\t\t\t\t\t? this.options\n\t\t\t\t\t\t\t.filter(o => this.selectedValues.includes(o.value))\n\t\t\t\t\t\t\t.map(o => o.label)\n\t\t\t\t\t\t\t.join(', ')\n\t\t\t\t\t: this.placeholder\n\t\t} else {\n\t\t\tconst selectedOption = this.options.find(o => o.value === this.value)\n\t\t\tthis.valueLabel = selectedOption?.label || this.placeholder\n\t\t}\n\t}\n\n\tprivate setupOptionsAccessibility() {\n\t\tthis.options.forEach((option, index) => {\n\t\t\toption.setAttribute('role', 'option')\n\t\t\tif (!option.id) {\n\t\t\t\toption.id = `${this.id}-option-${index}`\n\t\t\t}\n\t\t\toption.tabIndex = -1\n\t\t\toption.setAttribute(\n\t\t\t\t'aria-selected',\n\t\t\t\tString(this.multi ? this.selectedValues.includes(option.value) : option.value === this.value),\n\t\t\t)\n\t\t})\n\t}\n\n\tprivate async positionDropdown() {\n\t\tconst reference = this.renderRoot.querySelector('.trigger') as HTMLElement\n\t\tif (!reference || !this.ul) return\n\n\t\tthis.cleanupPositioner = autoUpdate(reference, this.ul, async () => {\n\t\t\tconst { x, y } = await computePosition(reference, this.ul, {\n\t\t\t\tplacement: 'bottom-start',\n\t\t\t\tmiddleware: [offset(5), flip(), shift({ padding: 5 })],\n\t\t\t})\n\n\t\t\tObject.assign(this.ul.style, {\n\t\t\t\tleft: `${x}px`,\n\t\t\t\ttop: `${y}px`,\n\t\t\t\tposition: 'absolute',\n\t\t\t})\n\t\t})\n\t}\n\n\tprivate handleKeyDown(e: KeyboardEvent) {\n\t\tif (!this.isOpen) {\n\t\t\tif (['Enter', ' ', 'ArrowDown'].includes(e.key)) {\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.openDropdown()\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tconst current = this.options.findIndex(o => o.matches(':focus')) ?? -1\n\n\t\tswitch (e.key) {\n\t\t\tcase 'Escape':\n\t\t\t\tthis.closeDropdown()\n\t\t\t\tbreak\n\t\t\tcase 'ArrowDown':\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.focusOption(this.options, Math.min(current + 1, this.options.length - 1))\n\t\t\t\tbreak\n\t\t\tcase 'ArrowUp':\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.focusOption(this.options, Math.max(current - 1, 0))\n\t\t\t\tbreak\n\t\t\tcase 'Enter':\n\t\t\tcase ' ':\n\t\t\t\te.preventDefault()\n\t\t\t\tif (current >= 0) this.handleOptionSelect(this.options[current].value)\n\t\t\t\tbreak\n\t\t\tcase 'Tab':\n\t\t\t\tthis.closeDropdown()\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\tprivate focusOption(options: HTMLElement[], index: number) {\n\t\tconst option = options[index]\n\t\tif (option) {\n\t\t\toption.focus()\n\t\t\tconst combobox = this.renderRoot.querySelector('.trigger')\n\t\t\tcombobox?.setAttribute('aria-activedescendant', option.id)\n\t\t}\n\t}\n\n\tprivate async openDropdown() {\n\t\tthis.isOpen = true\n\t\tawait this.updateComplete\n\n\t\tthis.positionDropdown()\n\t\tthis.setupOptionsAccessibility()\n\n\t\tconst options = Array.from(this.ul.querySelectorAll('[role=\"option\"]')) as HTMLElement[]\n\t\tconst selectedIndex = this.multi ? 0 : options.findIndex(o => o.getAttribute('value') === this.value)\n\t\tthis.focusOption(options, Math.max(selectedIndex, 0))\n\t}\n\n\tprivate closeDropdown() {\n\t\tthis.isOpen = false\n\t\tthis.cleanupPositioner?.()\n\t\tconst combobox = this.renderRoot.querySelector<HTMLElement>('.trigger')\n\t\tcombobox?.removeAttribute('aria-activedescendant')\n\t\tcombobox?.focus()\n\t}\n\n\tprivate handleOptionSelect(value: string) {\n\t\tif (this.multi) {\n\t\t\tconst option = this.options.find(o => o.value === value)\n\t\t\tif (!option) return\n\n\t\t\toption.selected = !option.selected\n\t\t\tif (option.selected) {\n\t\t\t\tthis.selectedValues = [...this.selectedValues, value]\n\t\t\t} else {\n\t\t\t\tthis.selectedValues = this.selectedValues.filter(v => v !== value)\n\t\t\t}\n\n\t\t\tthis.valueLabel =\n\t\t\t\tthis.selectedValues.length > 0\n\t\t\t\t\t? this.options\n\t\t\t\t\t\t\t.filter(o => this.selectedValues.includes(o.value))\n\t\t\t\t\t\t\t.map(o => o.label)\n\t\t\t\t\t\t\t.join(', ')\n\t\t\t\t\t: this.placeholder\n\n\t\t\tthis.dispatchChange(this.selectedValues)\n\t\t} else {\n\t\t\tthis.options.forEach(o => (o.selected = o.value === value))\n\t\t\tthis.value = value\n\t\t\tthis.valueLabel = this.options.find(o => o.value === value)?.label || this.placeholder\n\t\t\tthis.dispatchChange(value)\n\t\t\tthis.closeDropdown()\n\t\t}\n\n\t\tthis.setupOptionsAccessibility()\n\t}\n\n\tprivate dispatchChange(value: string | string[]) {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent<SchmancySelectChangeEvent['detail']>('change', {\n\t\t\t\tdetail: { value },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<div class=\"relative\">\n\t\t\t\t<schmancy-input\n\t\t\t\t\ttabIndex=\"0\"\n\t\t\t\t\tclass=\"trigger\"\n\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\taria-haspopup=\"listbox\"\n\t\t\t\t\taria-expanded=${this.isOpen}\n\t\t\t\t\taria-controls=\"options\"\n\t\t\t\t\taria-autocomplete=\"none\"\n\t\t\t\t\taria-required=${this.required}\n\t\t\t\t\t.label=${this.label}\n\t\t\t\t\t.placeholder=${this.placeholder}\n\t\t\t\t\t.value=${this.valueLabel}\n\t\t\t\t\t.required=${this.required}\n\t\t\t\t\treadonly\n\t\t\t\t\t@click=${() => (this.isOpen ? this.closeDropdown() : this.openDropdown())}\n\t\t\t\t></schmancy-input>\n\n\t\t\t\t<div\n\t\t\t\t\tid=\"overlay\"\n\t\t\t\t\tclass=\"fixed inset-0\"\n\t\t\t\t\t?hidden=${!this.isOpen}\n\t\t\t\t\t@click=${this.closeDropdown}\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t></div>\n\n\t\t\t\t<ul\n\t\t\t\t\tid=\"options\"\n\t\t\t\t\trole=\"listbox\"\n\t\t\t\t\taria-multiselectable=${this.multi}\n\t\t\t\t\tclass=${classMap({\n\t\t\t\t\t\t'absolute z-30 mt-1 w-full rounded-md shadow-sm': true,\n\t\t\t\t\t\thidden: !this.isOpen,\n\t\t\t\t\t})}\n\t\t\t\t\t${color({ bgColor: SchmancyTheme.sys.color.surface.container })}\n\t\t\t\t\t@click=${(e: Event) => {\n\t\t\t\t\t\tconst customEvt = e as CustomEvent\n\t\t\t\t\t\tconst detailVal = customEvt.detail?.value\n\t\t\t\t\t\tif (detailVal) {\n\t\t\t\t\t\t\tthis.handleOptionSelect(detailVal)\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<slot\n\t\t\t\t\t\t@slotchange=${() => {\n\t\t\t\t\t\t\tthis.syncSelection()\n\t\t\t\t\t\t\tthis.setupOptionsAccessibility()\n\t\t\t\t\t\t}}\n\t\t\t\t\t></slot>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-select': SchmancySelect\n\t}\n}\n"],"names":["SchmancySelect","$LitElement","css","super","arguments","this","required","placeholder","value","selectedValues","multi","label","isOpen","valueLabel","connectedCallback","id","Math","random","toString","substr","addEventListener","handleKeyDown","disconnectedCallback","removeEventListener","cleanupPositioner","firstUpdated","syncSelection","setupOptionsAccessibility","options","filter","o","selected","map","length","includes","join","selectedOption","find","forEach","option","index","setAttribute","tabIndex","String","positionDropdown","reference","renderRoot","querySelector","ul","autoUpdate","async","x","y","computePosition","placement","middleware","offset","flip","shift","padding","Object","assign","style","left","top","position","e","key","preventDefault","openDropdown","current","findIndex","matches","closeDropdown","focusOption","min","max","handleOptionSelect","focus","combobox","updateComplete","Array","from","querySelectorAll","selectedIndex","getAttribute","removeAttribute","v","dispatchChange","dispatchEvent","CustomEvent","detail","bubbles","composed","render","html","classMap","hidden","color","bgColor","SchmancyTheme","sys","surface","container","customEvt","detailVal","__decorateClass","property","type","Boolean","prototype","state","query","queryAssignedElements","flatten","customElement"],"mappings":";;;;;;;;;;;;;;AAca,IAAAA,IAAN,cAA6BC,EAAYC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAAzC,EAAA;AAAA,EAAA,cAAAC;AAAAA,UAAAA,GAAAC,SAakCC,GAAAA,KAAAC,WAAA,IACED,KAAAE,cAAA,IACNF,KAAAG,QAAA,IACTH,KAAAI,iBAA2B,CACjBJ,GAAAA,KAAAK,QAAA,IACDL,KAAAM,QAAA,IAG3BN,KAAQO,SAAS,IACjBP,KAAQQ,aAAa;AAAA,EAAA;AAAA,EAM9B,oBAAAC;AACCX,UAAMW,kBAAAA,GACDT,KAAKU,OACJV,KAAAU,KAAK,mBAAmBC,KAAKC,OAASC,EAAAA,SAAS,EAAIC,EAAAA,OAAO,GAAG,CAAA,CAAA,KAE9Dd,KAAAe,iBAAiB,WAAWf,KAAKgB,aAAa;AAAA,EAAA;AAAA,EAGpD,uBAAAC;;AACCnB,UAAMmB,qBAAAA,GACDjB,KAAAkB,oBAAoB,WAAWlB,KAAKgB,a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BKhH,CAAAA,GAAAA,EAwBS8G,WAAA,MAAA,CAAA,GAC6BJ,EAAA,CAAjDO,EAAsB,EAAEC,YAzBblH,CAAAA,CAAAA,GAAAA,EAyBsC8G,WAAA,WAAA,CAAA,GAzBtC9G,IAAN0G,EAAA,CADNS,EAAc,iBAAA,CAAA,GACFnH;"}
package/dist/teleport.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./teleport.component-B_fXeDDQ.cjs");exports.HereMorty=e.HereMorty,Object.defineProperty(exports,"SchmancyTeleportation",{enumerable:!0,get:()=>e.SchmancyTeleportation}),exports.WhereAreYouRicky=e.WhereAreYouRicky,exports.teleport=e.teleport;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./teleport.component-D8OSIPGk.cjs");exports.HereMorty=e.HereMorty,Object.defineProperty(exports,"SchmancyTeleportation",{enumerable:!0,get:()=>e.SchmancyTeleportation}),exports.WhereAreYouRicky=e.WhereAreYouRicky,exports.teleport=e.teleport;
2
2
  //# sourceMappingURL=teleport.cjs.map