@mhmo91/schmancy 0.2.19 → 0.2.20

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-DeXpYHXV.cjs");
1
+ "use strict";require("./teleport.component-90QAnife.cjs");
2
2
  //# sourceMappingURL=card.cjs.map
package/dist/card.js CHANGED
@@ -1,2 +1,2 @@
1
- import "./teleport.component-DRNVI8FU.js";
1
+ import "./teleport.component-CMZW0HoW.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-DeXpYHXV.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-90QAnife.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-DRNVI8FU.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-CMZW0HoW.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-VuDSGmJu.cjs");const r=require("./area.component-qqTF9Cwv.cjs");require("./autocomplete-B0fc_Nh_.cjs"),require("./spinner-vK7ZLqSI.cjs");const o=require("./icon-button-BnakhpuT.cjs"),e=require("./teleport.component-DeXpYHXV.cjs"),S=require("./checkbox-CFRY_WA9.cjs");require("./chips-DK1t1fX8.cjs");const u=require("./payment-card-form-DT2MgPCZ.cjs");require("./date-range-ojNc9Onw.cjs");const y=require("./delay-BdpZfHDc.cjs"),n=require("./ripple-C2BHbhcS.cjs");require("./divider-_i9O2PBo.cjs"),require("./form-CqnEVlhB.cjs"),require("./icon-CpZBVkRH.cjs"),require("./input-B2rV3JCi.cjs");const c=require("./scroll-CD1V-q-_.cjs"),m=require("./list-DOnYlCys.cjs");require("./menu-BZyh3Omd.cjs");const a=require("./outlet-B1D2BYCl.cjs");require("./option-DC1BiTB1.cjs");const b=require("./radio-group-WV66V12S.cjs"),l=require("./rxjs-utils.cjs");require("rxjs"),require("./index-DyJ0oDpR.cjs"),require("./select-BP6OE_lC.cjs");const t=require("./sheet-CUTDrhww.cjs"),h=require("./slider-BEGG7odV.cjs"),d=require("./surface-pByMeeQt.cjs");require("./table-DduFFvUh.cjs"),require("./tabs-group-BBByN_wj.cjs"),require("./textarea-DnIefaLe.cjs");const i=require("./theme.component-CbQ3s3hX.cjs"),p=require("./theme.interface-Xg5Zi46a.cjs");require("./theme-button-B0kxPZka.cjs");const g=require("./tree-BKd26LdC.cjs"),f=require("./types.cjs"),q=require("./typewriter-jklG56Kf.cjs"),D=require("./typography-D5hY_euh.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,"SchmnacyButton",{enumerable:!0,get:()=>o.SchmnacyButton}),Object.defineProperty(exports,"SchmnacyIconButton",{enumerable:!0,get:()=>o.SchmnacyIconButton}),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,exports.SchmancySheetPosition=t.SchmancySheetPosition,exports.SheetHereMorty=t.SheetHereMorty,exports.SheetWhereAreYouRicky=t.SheetWhereAreYouRicky,exports.hook=t.hook,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:()=>d.SchmancySurface}),Object.defineProperty(exports,"SchmancyThemeComponent",{enumerable:!0,get:()=>i.SchmancyThemeComponent}),exports.formateTheme=i.formateTheme,exports.tailwindStyles=i.tailwindStyles,exports.SchmancyTheme=p.SchmancyTheme,Object.defineProperty(exports,"SchmancyTree",{enumerable:!0,get:()=>g.SchmancyTree}),exports.SchmancyEvents=f.SchmancyEvents,Object.defineProperty(exports,"TypewriterElement",{enumerable:!0,get:()=>q.TypewriterElement}),Object.defineProperty(exports,"SchmancyTypography",{enumerable:!0,get:()=>D.SchmancyTypography});
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("./animated-text-VuDSGmJu.cjs");const r=require("./area.component-qqTF9Cwv.cjs");require("./autocomplete-B0fc_Nh_.cjs"),require("./spinner-vK7ZLqSI.cjs");const o=require("./icon-button-BnakhpuT.cjs"),e=require("./teleport.component-90QAnife.cjs"),S=require("./checkbox-CFRY_WA9.cjs");require("./chips-DK1t1fX8.cjs");const u=require("./payment-card-form-DT2MgPCZ.cjs");require("./date-range-ojNc9Onw.cjs");const y=require("./delay-BdpZfHDc.cjs"),n=require("./ripple-C2BHbhcS.cjs");require("./divider-_i9O2PBo.cjs"),require("./form-CqnEVlhB.cjs"),require("./icon-CpZBVkRH.cjs"),require("./input-B2rV3JCi.cjs");const c=require("./scroll-CD1V-q-_.cjs"),m=require("./list-DOnYlCys.cjs");require("./menu-BZyh3Omd.cjs");const a=require("./outlet-B1D2BYCl.cjs");require("./option-DC1BiTB1.cjs");const b=require("./radio-group-WV66V12S.cjs"),l=require("./rxjs-utils.cjs");require("rxjs"),require("./index-DyJ0oDpR.cjs"),require("./select-BP6OE_lC.cjs");const t=require("./sheet-VJBIc1zb.cjs"),h=require("./slider-BEGG7odV.cjs"),d=require("./surface-pByMeeQt.cjs");require("./table-DduFFvUh.cjs"),require("./tabs-group-BBByN_wj.cjs"),require("./textarea-DnIefaLe.cjs");const i=require("./theme.component-CbQ3s3hX.cjs"),p=require("./theme.interface-Xg5Zi46a.cjs");require("./theme-button-B0kxPZka.cjs");const g=require("./tree-BKd26LdC.cjs"),f=require("./types.cjs"),q=require("./typewriter-jklG56Kf.cjs"),D=require("./typography-D5hY_euh.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,"SchmnacyButton",{enumerable:!0,get:()=>o.SchmnacyButton}),Object.defineProperty(exports,"SchmnacyIconButton",{enumerable:!0,get:()=>o.SchmnacyIconButton}),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,exports.SchmancySheetPosition=t.SchmancySheetPosition,exports.SheetHereMorty=t.SheetHereMorty,exports.SheetWhereAreYouRicky=t.SheetWhereAreYouRicky,exports.hook=t.hook,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:()=>d.SchmancySurface}),Object.defineProperty(exports,"SchmancyThemeComponent",{enumerable:!0,get:()=>i.SchmancyThemeComponent}),exports.formateTheme=i.formateTheme,exports.tailwindStyles=i.tailwindStyles,exports.SchmancyTheme=p.SchmancyTheme,Object.defineProperty(exports,"SchmancyTree",{enumerable:!0,get:()=>g.SchmancyTree}),exports.SchmancyEvents=f.SchmancyEvents,Object.defineProperty(exports,"TypewriterElement",{enumerable:!0,get:()=>q.TypewriterElement}),Object.defineProperty(exports,"SchmancyTypography",{enumerable:!0,get:()=>D.SchmancyTypography});
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { F as d, H as T, b, S as u, a as N, r as H } from "./area.component-BLgl
3
3
  import "./autocomplete-cGKAFBi1.js";
4
4
  import "./spinner-Qncx6I22.js";
5
5
  import { S as v, a as I } from "./icon-button-DX3Zm-2u.js";
6
- import { H as g, e as E, b as k, f as A, c as Y, d as F, g as G, S as O, a as W, i as L, k as _, l as B, m as P, j as $, n as j, o as K, W as q, s as z, h as J, t as Q } from "./teleport.component-DRNVI8FU.js";
6
+ import { H as g, e as E, b as k, f as A, c as Y, d as F, g as G, S as O, a as W, i as L, k as _, l as B, m as P, j as $, n as j, o as K, W as q, s as z, h as J, t as Q } from "./teleport.component-CMZW0HoW.js";
7
7
  import { S as V } from "./checkbox-D9M3J9G8.js";
8
8
  import "./chips-CCQq31in.js";
9
9
  import { S as Z } from "./payment-card-form-D2wNtJk-.js";
@@ -24,7 +24,7 @@ import { mutationObserver as Ta } from "./rxjs-utils.js";
24
24
  import "rxjs";
25
25
  import "./index-CuY8m6ta.js";
26
26
  import "./select-CV8IdXQf.js";
27
- import { S as ua, b as Na, a as Ha, h as Ra, s as va } from "./sheet-DQxsDc4a.js";
27
+ import { S as ua, b as Na, a as Ha, h as Ra, s as va } from "./sheet-D8-zxp3n.js";
28
28
  import { S as Ma, a as ga } from "./slider-B12L6AxV.js";
29
29
  import { S as ka } from "./surface-DYJn8g9F.js";
30
30
  import "./table-DvOkIhMb.js";
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./teleport.component-DeXpYHXV.cjs");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-90QAnife.cjs");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 { i as c, k as n, l as e, m, j as h, n as i, h as s } from "./teleport.component-DRNVI8FU.js";
1
+ import { i as c, k as n, l as e, m, j as h, n as i, h as s } from "./teleport.component-CMZW0HoW.js";
2
2
  export {
3
3
  c as SchmancyDrawerAppbar,
4
4
  n as SchmancyDrawerNavbarMode,
@@ -2,7 +2,7 @@ import { Subject as x, switchMap as D, forkJoin as S, fromEvent as d, takeUntil
2
2
  import "lit/directives/class-map.js";
3
3
  import "lit/directives/style-map.js";
4
4
  import { T as $ } from "./tailwind.mixin-jeUK-Doz.js";
5
- import { css as T, html as g } from "lit";
5
+ import { css as T, html as f } from "lit";
6
6
  import { property as h, customElement as w, query as L, queryAssignedElements as q } from "lit/decorators.js";
7
7
  import { $ as z } from "./litElement.mixin-BnUdikbt.js";
8
8
  var N = Object.defineProperty, M = Object.getOwnPropertyDescriptor, O = (t, e, s, o) => {
@@ -18,7 +18,7 @@ let m = class extends $(T`
18
18
  `) {
19
19
  render() {
20
20
  const t = { absolute: this.title.length === 0, relative: this.title.length > 0 };
21
- return g`
21
+ return f`
22
22
  <schmancy-grid class="${this.classMap(t)}" align="center" justify="stretch" cols="auto 1fr auto">
23
23
  <slot name="back">
24
24
  <schmancy-button
@@ -58,7 +58,7 @@ O([h()], m.prototype, "title", 2), m = O([w("schmancy-sheet-header")], m);
58
58
  var J = Object.defineProperty, Y = Object.getOwnPropertyDescriptor;
59
59
  let A = class extends $() {
60
60
  render() {
61
- return g`
61
+ return f`
62
62
  <div tabindex="0">
63
63
  <slot></slot>
64
64
  </div>
@@ -70,9 +70,9 @@ A = ((t, e, s, o) => {
70
70
  return o && i && J(e, s, i), i;
71
71
  })([w("schmancy-sheet-content")], A);
72
72
  var j = ((t) => (t.Side = "side", t.Bottom = "bottom", t.BottomCenter = "bottom-center", t.TopRight = "top-right", t.BottomRight = "bottom-right", t))(j || {});
73
- const v = "are-you-there-sheet", f = "yes-here", y = new class {
73
+ const v = "are-you-there-sheet", g = "yes-here", y = new class {
74
74
  constructor() {
75
- this.bottomSheet = new x(), this.$dismiss = new x(), this.bottomSheet.pipe(D((t) => S([d(window, f).pipe(b(k(0)), p((e) => e.detail.sheet), C(void 0)), F(t).pipe(l(() => {
75
+ this.bottomSheet = new x(), this.$dismiss = new x(), this.bottomSheet.pipe(D((t) => S([d(window, g).pipe(b(k(0)), p((e) => e.detail.sheet), C(void 0)), F(t).pipe(l(() => {
76
76
  window.dispatchEvent(new CustomEvent(v, { detail: { uid: t.uid ?? t.component.tagName } }));
77
77
  }))])), p(([t, e]) => (t || (t = document.createElement("schmancy-sheet"), document.body.appendChild(t)), t.setAttribute("uid", e.uid ?? e.component.tagName), t.setAttribute("position", e.position ?? "bottom"), t.setAttribute("allowOverlyDismiss", e.allowOverlyDismiss === !1 ? "false" : "true"), e.title && t.setAttribute("title", e.title), e.persist && t.setAttribute("persist", e.persist ?? !1), e.header && t.setAttribute("header", e.header), document.body.style.overflow = "hidden", { target: e, sheet: t })), u(20), P(({ target: t, sheet: e }) => {
78
78
  var s, o;
@@ -86,7 +86,7 @@ const v = "are-you-there-sheet", f = "yes-here", y = new class {
86
86
  const s = e.target;
87
87
  s != null && s.persist || (s == null || s.remove()), document.body.style.overflow = "auto";
88
88
  });
89
- })).subscribe(), this.$dismiss.pipe(B((t) => S([d(window, f).pipe(b(k(100)), p((e) => e.detail.sheet), C(void 0)), F(t).pipe(l(() => {
89
+ })).subscribe(), this.$dismiss.pipe(B((t) => S([d(window, g).pipe(b(k(100)), p((e) => e.detail.sheet), C(void 0)), F(t).pipe(l(() => {
90
90
  window.dispatchEvent(new CustomEvent(v, { detail: { uid: t } }));
91
91
  }))])), l(([t]) => {
92
92
  t == null || t.closeSheet();
@@ -103,7 +103,7 @@ var G = Object.defineProperty, H = Object.getOwnPropertyDescriptor, c = (t, e, s
103
103
  for (var n, i = o > 1 ? void 0 : o ? H(e, s) : e, a = t.length - 1; a >= 0; a--) (n = t[a]) && (i = (o ? n(e, s, i) : n(i)) || i);
104
104
  return o && i && G(e, s, i), i;
105
105
  };
106
- let r = class extends z(":host{--overlay-color: var(--schmancy-sys-color-surface-dim);--transition-duration: .2s;--sheet-radius: 0;--max-height: 100vh}.sheet{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;display:flex;visibility:visible;transition:visibility var(--transition-duration) ease-in-out}.sheet[aria-hidden=true]{visibility:hidden;pointer-events:none}.sheet[aria-hidden=true] .content{transform:translateY(100%)}.sheet[aria-hidden=true] .content[data-position=side]{transform:translate(100%)}.sheet[aria-hidden=true] .overlay{opacity:0}.overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:var(--overlay-color);opacity:.4;transition:opacity var(--transition-duration) ease-in-out}.content{position:relative;z-index:1;display:flex;flex-direction:column;background:#fff;transition:transform var(--transition-duration) ease-in-out}.content[data-position=side]{height:100%;margin-left:auto;min-width:320px;max-width:90vw}.content[data-position=bottom]{width:100%;margin-top:auto;border-radius:16px 16px 0 0;max-height:90vh}.content-body{flex:1;overflow-y:auto;padding:1rem}") {
106
+ let r = class extends z(':host{--overlay-color: var(--schmancy-sys-color-surface-dim);--transition-duration: .2s;--sheet-radius: 0;--max-height: 100vh}.sheet{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;display:flex;visibility:visible;transition:visibility var(--transition-duration) ease-in-out}.sheet[aria-hidden=true]{visibility:hidden;pointer-events:none}.sheet[aria-hidden=true] .content{transform:translateY(100%)}.sheet[aria-hidden=true] .content[data-position=side]{transform:translate(100%)}.sheet[aria-hidden=true] .overlay{opacity:0}.overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:var(--overlay-color);opacity:.4;transition:opacity var(--transition-duration) ease-in-out}.content{position:relative;display:grid;grid-template-columns:"auto 1fr";z-index:1;top:0;right:0;bottom:0;left:0;background-color:var(--schmancy-sys-color-surface-container);transition:transform var(--transition-duration) ease-in-out}.content[data-position=side]{height:100%;margin-left:auto;min-width:320px;max-width:90vw}.content[data-position=bottom]{width:100%;margin-top:auto;border-radius:16px 16px 0 0;max-height:90vh}') {
107
107
  constructor() {
108
108
  super(...arguments), this.open = !1, this.header = "visible", this.position = j.Side, this.persist = !1, this.allowOverlayDismiss = !0, this.title = "", this.focusAttribute = "autofocus", this.lastFocusedElement = null, this.handleFocusIn = (t) => {
109
109
  var e;
@@ -135,7 +135,7 @@ let r = class extends z(":host{--overlay-color: var(--schmancy-sys-color-surface
135
135
  return ((t = this.sheet) == null ? void 0 : t.contains(document.activeElement)) ?? !1;
136
136
  }
137
137
  announcePresence() {
138
- this.dispatchEvent(new CustomEvent(f, { detail: { sheet: this }, bubbles: !0, composed: !0 }));
138
+ this.dispatchEvent(new CustomEvent(g, { detail: { sheet: this }, bubbles: !0, composed: !0 }));
139
139
  }
140
140
  addFocusTrap() {
141
141
  document.addEventListener("focusin", this.handleFocusIn);
@@ -159,25 +159,25 @@ let r = class extends z(":host{--overlay-color: var(--schmancy-sys-color-surface
159
159
  (t = this.getFocusElement()) == null || t.focus();
160
160
  }
161
161
  render() {
162
- return g`
162
+ return f`
163
163
  <schmancy-theme>
164
164
  <div class="sheet" role="dialog" aria-labelledby="sheet-title" aria-hidden="true" aria-modal="false">
165
165
  <div class="overlay" @click=${() => this.allowOverlayDismiss && y.dismiss(this.uid)}></div>
166
166
 
167
- <schmancy-sheet-content class="content" data-position=${this.position}>
168
- <schmancy-sheet-header
169
- @dismiss=${(t) => {
167
+ <schmancy-scroll
168
+ ><schmancy-sheet-content class="content" data-position=${this.position}>
169
+ <schmancy-sheet-header
170
+ @dismiss=${(t) => {
170
171
  t.stopPropagation(), y.dismiss(this.uid);
171
172
  }}
172
- id="sheet-title"
173
- .hidden=${this.header === "hidden"}
174
- title=${this.title}
175
- ></schmancy-sheet-header>
173
+ id="sheet-title"
174
+ .hidden=${this.header === "hidden"}
175
+ title=${this.title}
176
+ ></schmancy-sheet-header>
176
177
 
177
- <section class="content-body">
178
178
  <slot></slot>
179
- </section>
180
- </schmancy-sheet-content>
179
+ </schmancy-sheet-content>
180
+ </schmancy-scroll>
181
181
  </div>
182
182
  </schmancy-theme>
183
183
  `;
@@ -187,8 +187,8 @@ c([h({ type: String, reflect: !0 })], r.prototype, "uid", 2), c([h({ type: Boole
187
187
  export {
188
188
  j as S,
189
189
  v as a,
190
- f as b,
190
+ g as b,
191
191
  R as h,
192
192
  y as s
193
193
  };
194
- //# sourceMappingURL=sheet-DQxsDc4a.js.map
194
+ //# sourceMappingURL=sheet-D8-zxp3n.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sheet-DQxsDc4a.js","sources":["../src/sheet/header.ts","../src/sheet/hook.ts","../src/sheet/sheet-content.ts","../src/sheet/sheet.service.ts","../src/sheet/sheet.ts"],"sourcesContent":["import { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\n@customElement('schmancy-sheet-header')\nexport default class SchmancySheetHeader extends TailwindElement(css`\n\t:host {\n\t\tinset: 0;\n\t\tdisplay: block;\n\t\tpadding-bottom: 16px;\n\t}\n`) {\n\t@property() title: string\n\trender() {\n\t\tconst classes = {\n\t\t\tabsolute: this.title.length === 0,\n\t\t\trelative: this.title.length > 0,\n\t\t}\n\t\treturn html`\n\t\t\t<schmancy-grid class=\"${this.classMap(classes)}\" align=\"center\" justify=\"stretch\" cols=\"auto 1fr auto\">\n\t\t\t\t<slot name=\"back\">\n\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\t\t\tnew CustomEvent('dismiss', {\n\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span class=\"text-[24px]\">&#8592; </span>\n\t\t\t\t\t</schmancy-button>\n\t\t\t\t</slot>\n\t\t\t\t<schmancy-typography transform=\"capitalize\" type=\"headline\" token=\"lg\"> ${this.title} </schmancy-typography>\n\t\t\t\t<slot name=\"actions\">\n\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\t\t\tnew CustomEvent('dismiss', {\n\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span class=\"text-[24px]\">✕</span>\n\t\t\t\t\t</schmancy-button>\n\t\t\t\t</slot>\n\t\t\t</schmancy-grid>\n\t\t`\n\t}\n}\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet-header': SchmancySheetHeader\n\t}\n}\n","// @watch decorator\n//\n// Runs when an observed property changes, e.g. @property or @state, but before the component updates.\n//\n// To wait for an update to complete after a change occurs, use `await this.updateComplete` in the handler. To start\n// watching after the initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.\n//\n// Usage:\n//\n// @watch('propName')\n// handlePropChange(oldValue, newValue) {\n// ...\n// }\n//\ninterface WatchOptions {\n waitUntilFirstUpdate?: boolean\n}\n\nexport function hook(propName: string, options?: WatchOptions) {\n return (protoOrDescriptor: any, name: string): any => {\n const { willUpdate } = protoOrDescriptor\n\n options = Object.assign({ waitUntilFirstUpdate: false }, options) as WatchOptions\n\n protoOrDescriptor.willUpdate = function (changedProps: Map<string, any>) {\n willUpdate.call(this, changedProps)\n\n if (changedProps.has(propName)) {\n const oldValue = changedProps.get(propName)\n const newValue = this[propName]\n\n if (oldValue !== newValue) {\n if (!options?.waitUntilFirstUpdate || this.hasUpdated) {\n this[name].call(this, oldValue, newValue)\n }\n }\n }\n }\n }\n}\n","import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\n@customElement('schmancy-sheet-content')\nexport default class SchmancySheetContent extends TailwindElement() {\n\trender() {\n\t\treturn html`\n\t\t\t<div tabindex=\"0\">\n\t\t\t\t<slot></slot>\n\t\t\t</div>\n\t\t`\n\t}\n}\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet-content': SchmancySheetContent\n\t}\n}\n","import {\n\tdefaultIfEmpty,\n\tdelay,\n\tfilter,\n\tforkJoin,\n\tfromEvent,\n\tmap,\n\tmergeMap,\n\tof,\n\tSubject,\n\tswitchMap,\n\ttake,\n\ttakeUntil,\n\ttap,\n\ttimer,\n} from 'rxjs'\nimport SchmancySheet from './sheet'\n\nexport enum SchmancySheetPosition {\n\tSide = 'side',\n\tBottom = 'bottom',\n\t/**\n\t * @deprecated use bottom instead\n\t */\n\tBottomCenter = 'bottom-center',\n\t/**\n\t * @deprecated use side instead\n\t */\n\tTopRight = 'top-right',\n\t/**\n\t * @deprecated use side instead\n\t */\n\tBottomRight = 'bottom-right',\n}\n\ntype BottomSheeetTarget = {\n\tcomponent: HTMLElement\n\tuid?: string\n\tposition?: SchmancySheetPosition\n\tpersist?: boolean\n\tclose?: () => void\n\tallowOverlyDismiss?: boolean\n\ttitle?: string\n\theader?: 'hidden' | 'visible'\n}\n\n// Events for communication between bottom-sheet component and bottom-sheet.service\nexport type SheetWhereAreYouRickyEvent = CustomEvent<{\n\tuid: string\n}>\nexport const SheetWhereAreYouRicky = 'are-you-there-sheet'\n\nexport type SheetHereMortyEvent = CustomEvent<{\n\tsheet: SchmancySheet\n}>\nexport const SheetHereMorty = 'yes-here'\nclass BottomSheetService {\n\tbottomSheet = new Subject<BottomSheeetTarget>()\n\t$dismiss = new Subject<string>()\n\tconstructor() {\n\t\tthis.bottomSheet\n\t\t\t.pipe(\n\t\t\t\tswitchMap(target =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<SheetHereMortyEvent>(window, SheetHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(0)),\n\t\t\t\t\t\t\tmap(e => e.detail.sheet),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(target).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(SheetWhereAreYouRicky, {\n\t\t\t\t\t\t\t\t\t\tdetail: { uid: target.uid ?? target.component.tagName },\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\tmap(([sheet, target]) => {\n\t\t\t\t\tconsole.log(sheet, target)\n\t\t\t\t\tif (!sheet) {\n\t\t\t\t\t\t// if sheet is not found, create it\n\t\t\t\t\t\tsheet = document.createElement('schmancy-sheet')\n\t\t\t\t\t\tdocument.body.appendChild(sheet)\n\t\t\t\t\t}\n\t\t\t\t\tsheet.setAttribute('uid', target.uid ?? target.component.tagName)\n\t\t\t\t\tsheet.setAttribute('position', target.position ?? SchmancySheetPosition.Bottom)\n\t\t\t\t\tsheet.setAttribute('allowOverlyDismiss', target.allowOverlyDismiss === false ? 'false' : 'true')\n\t\t\t\t\ttarget.title && sheet.setAttribute('title', target.title)\n\t\t\t\t\ttarget.persist && sheet.setAttribute('persist', target.persist ?? false)\n\t\t\t\t\ttarget.header && sheet.setAttribute('header', target.header)\n\t\t\t\t\tdocument.body.style.overflow = 'hidden' // lock the scroll of the host\n\t\t\t\t\treturn { target, sheet }\n\t\t\t\t}),\n\t\t\t\tdelay(20),\n\t\t\t\tfilter(({ target, sheet }) => {\n\t\t\t\t\t// if the sheet has already the component, just show it\n\t\t\t\t\tif (\n\t\t\t\t\t\ttarget.persist &&\n\t\t\t\t\t\tsheet?.shadowRoot\n\t\t\t\t\t\t\t?.querySelector('slot')\n\t\t\t\t\t\t\t?.assignedElements()\n\t\t\t\t\t\t\t.find(e => e.tagName === target.component.tagName)\n\t\t\t\t\t) {\n\t\t\t\t\t\tsheet?.setAttribute('open', 'true')\n\t\t\t\t\t\treturn false\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn true // if the sheet does not have the component, continue to the next step\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttap(({ target, sheet }) => {\n\t\t\t\t\tsheet?.appendChild(target.component)\n\t\t\t\t}),\n\t\t\t\tdelay(1),\n\t\t\t\ttap(({ sheet }) => {\n\t\t\t\t\tsheet?.setAttribute('open', 'true')\n\t\t\t\t}),\n\t\t\t\ttap(({ sheet }) => {\n\t\t\t\t\tfromEvent<CustomEvent>(sheet, 'close')\n\t\t\t\t\t\t.pipe(take(1))\n\t\t\t\t\t\t.pipe(delay(300))\n\t\t\t\t\t\t.subscribe(e => {\n\t\t\t\t\t\t\tconst target = e.target as SchmancySheet\n\t\t\t\t\t\t\tconsole.log(target)\n\n\t\t\t\t\t\t\tif (!target?.persist) target?.remove()\n\t\t\t\t\t\t\tdocument.body.style.overflow = 'auto' // unlock the scroll of the host\n\t\t\t\t\t\t})\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\n\t\tthis.$dismiss\n\t\t\t.pipe(\n\t\t\t\tmergeMap(uid =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<SheetHereMortyEvent>(window, SheetHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)), // Some people say why 10? I say why not?\n\t\t\t\t\t\t\tmap(e => e.detail.sheet),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(uid).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new CustomEvent(SheetWhereAreYouRicky, { detail: { uid } }))\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\ttap(([sheet]) => {\n\t\t\t\t\tsheet?.closeSheet()\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\tdismiss(uid: string) {\n\t\tthis.$dismiss.next(uid)\n\t}\n\n\topen(target: BottomSheeetTarget) {\n\t\tthis.bottomSheet.next(target)\n\t}\n}\nexport const sheet = new BottomSheetService()\n","import { $LitElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, property, query, queryAssignedElements } from 'lit/decorators.js'\nimport { fromEvent, merge, takeUntil, tap } from 'rxjs'\nimport { hook } from './hook'\nimport style from './sheet.scss?inline'\nimport {\n\tSchmancySheetPosition,\n\tSheetHereMorty,\n\tSheetWhereAreYouRicky,\n\tSheetWhereAreYouRickyEvent,\n\tsheet,\n} from './sheet.service'\n\n@customElement('schmancy-sheet')\nexport default class SchmancySheet extends $LitElement(style) {\n\t@property({ type: String, reflect: true }) uid!: string\n\t@property({ type: Boolean, reflect: true }) open = false\n\t@property({ type: String, reflect: true }) header: 'hidden' | 'visible' = 'visible'\n\t@property({ type: String, reflect: true }) position: SchmancySheetPosition = SchmancySheetPosition.Side\n\t@property({ type: Boolean, reflect: true }) persist = false\n\t@property({ type: Boolean, reflect: true }) allowOverlayDismiss = true\n\t@property({ type: String, reflect: true }) title = ''\n\n\t@query('.sheet') private sheet!: HTMLElement\n\t@queryAssignedElements({ flatten: true }) private assignedElements!: HTMLElement[]\n\n\t@property() focusAttribute = 'autofocus'\n\tprivate lastFocusedElement: HTMLElement | null = null\n\n\t@hook('open')\n\tonOpenChange(_oldValue: boolean, newValue: boolean) {\n\t\tthis.setIsSheetShown(newValue)\n\n\t\tif (newValue) {\n\t\t\tthis.lastFocusedElement = document.activeElement as HTMLElement\n\t\t\tthis.addFocusTrap()\n\t\t\tthis.focus()\n\t\t} else {\n\t\t\tthis.removeFocusTrap()\n\t\t\tthis.lastFocusedElement?.focus()\n\t\t\tthis.lastFocusedElement = null\n\t\t}\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tthis.setupEventListeners()\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis.disconnecting.next(true)\n\t}\n\n\tprivate setupEventListeners() {\n\t\t// Handle browser back button\n\t\tconst popState$ = fromEvent<PopStateEvent>(window, 'popstate').pipe(\n\t\t\ttap(e => {\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.closeSheet()\n\t\t\t}),\n\t\t)\n\n\t\t// Handle ESC key\n\t\tconst keyUp$ = fromEvent<KeyboardEvent>(window, 'keyup').pipe(\n\t\t\ttap(event => {\n\t\t\t\tif (event.key === 'Escape' && !this.sheetContainsFocus()) {\n\t\t\t\t\tsheet.dismiss(this.uid)\n\t\t\t\t}\n\t\t\t}),\n\t\t)\n\n\t\t// Handle inter-component communication\n\t\tconst rickyComm$ = fromEvent<SheetWhereAreYouRickyEvent>(window, SheetWhereAreYouRicky).pipe(\n\t\t\ttap(e => {\n\t\t\t\tif (e.detail.uid === this.uid) this.announcePresence()\n\t\t\t}),\n\t\t)\n\n\t\tmerge(popState$, keyUp$, rickyComm$).pipe(takeUntil(this.disconnecting)).subscribe()\n\t}\n\n\tprivate sheetContainsFocus(): boolean {\n\t\treturn this.sheet?.contains(document.activeElement) ?? false\n\t}\n\n\tprivate announcePresence() {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(SheetHereMorty, {\n\t\t\t\tdetail: { sheet: this },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\tprivate addFocusTrap() {\n\t\tdocument.addEventListener('focusin', this.handleFocusIn)\n\t}\n\n\tprivate removeFocusTrap() {\n\t\tdocument.removeEventListener('focusin', this.handleFocusIn)\n\t}\n\n\tprivate handleFocusIn = (e: Event) => {\n\t\tif (!this.sheet?.contains(e.target as Node)) {\n\t\t\tthis.focus()\n\t\t}\n\t}\n\n\tsetIsSheetShown(isShown: boolean) {\n\t\tthis.sheet?.setAttribute('aria-hidden', String(!isShown))\n\t\tthis.sheet?.setAttribute('aria-modal', String(isShown))\n\t}\n\n\tcloseSheet() {\n\t\tthis.open = false\n\t\tthis.dispatchEvent(new CustomEvent('close'))\n\t}\n\n\tprivate getFocusElement(): HTMLElement | null {\n\t\tconst selector = `[${this.focusAttribute}]`\n\t\treturn (this.assignedElements.find(el => el.matches(selector) || el.querySelector(selector)) as HTMLElement) ?? null\n\t}\n\n\toverride focus() {\n\t\tthis.getFocusElement()?.focus()\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<schmancy-theme>\n\t\t\t\t<div class=\"sheet\" role=\"dialog\" aria-labelledby=\"sheet-title\" aria-hidden=\"true\" aria-modal=\"false\">\n\t\t\t\t\t<div class=\"overlay\" @click=${() => this.allowOverlayDismiss && sheet.dismiss(this.uid)}></div>\n\n\t\t\t\t\t<schmancy-sheet-content class=\"content\" data-position=${this.position}>\n\t\t\t\t\t\t<schmancy-sheet-header\n\t\t\t\t\t\t\t@dismiss=${(e: CustomEvent) => {\n\t\t\t\t\t\t\t\te.stopPropagation()\n\t\t\t\t\t\t\t\tsheet.dismiss(this.uid)\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tid=\"sheet-title\"\n\t\t\t\t\t\t\t.hidden=${this.header === 'hidden'}\n\t\t\t\t\t\t\ttitle=${this.title}\n\t\t\t\t\t\t></schmancy-sheet-header>\n\n\t\t\t\t\t\t<section class=\"content-body\">\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t</section>\n\t\t\t\t\t</schmancy-sheet-content>\n\t\t\t\t</div>\n\t\t\t</schmancy-theme>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet': SchmancySheet\n\t}\n}\n"],"names":["SchmancySheetHeader","TailwindElement","css","classes","absolute","this","title","length","relative","html","classMap","dispatchEvent","CustomEvent","bubbles","composed","hook","propName","options","protoOrDescriptor","name","willUpdate","Object","assign","waitUntilFirstUpdate","changedProps","call","has","oldValue","get","newValue","hasUpdated","__decorateClass","property","prototype","customElement","SchmancySheetContent","render","SchmancySheetPosition","SheetWhereAreYouRicky","SheetHereMorty","sheet","bottomSheet","Subject","$dismiss","pipe","switchMap","forkJoin","fromEvent","window","takeUntil","timer","map","e","detail","defaultIfEmpty","of","target","tap","uid","component","tagName","document","createElement","body","appendChild","setAttribute","position","allowOverlyDismiss","persist","header","style","overflow","delay","filter","shadowRoot","querySelector","assignedElements","find","take","subscribe","remove","mergeMap","closeSheet","next","SchmancySheet","$LitElement","constructor","super","arguments","open","Side","allowOverlayDismiss","focusAttribute","lastFocusedElement","handleFocusIn","contains","focus","_oldValue","setIsSheetShown","activeElement","addFocusTrap","removeFocusTrap","connectedCallback","setupEventListeners","disconnectedCallback","disconnecting","popState$","preventDefault","keyUp$","event","key","sheetContainsFocus","dismiss","rickyComm$","announcePresence","merge","addEventListener","removeEventListener","isShown","String","selector","el","matches","getFocusElement","stopPropagation","type","reflect","Boolean","query","queryAssignedElements","flatten"],"mappings":";;;;;;;;;;;AAKA,IAAqBA,IAArB,cAAiDC,EAAgBC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAQhE,EAAA;AAAA,EAAA,SACC;AAAA,UAAMC,IAAU,EACfC,UAAUC,KAAKC,MAAMC,WAAW,GAChCC,UAAUH,KAAKC,MAAMC,SAAS,EAAA;AAExB,WAAAE;AAAAA,2BACkBJ,KAAKK,SAASP,CAAAA,CAAAA;AAAAA;AAAAA;AAAAA,eAG1B,MACHE;AAAAA,WAAAM,cACJ,IAAIC,YAAY,WAAW,EAC1BC,SAAAA,IACAC,UAAAA,GAEF,CAAA,CAAA;AAAA,IAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8EAMuET,KAAKC,KAAAA;AAAAA;AAAAA;AAAAA,eAGpE,MACHD;AAAAA,WAAAM,cACJ,IAAIC,YAAY,WAAW,EAC1BC,SAAAA,IACA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AA,GAAAA,EAU8BnD,WAAA,oBAAA,CAEtCF,GAAAA,EAAA,CAAXC,EAAAA,CAAAA,GAZmBoD,EAYRnD,WAAA,kBAAA,CAAA,GAIZF,EAAA,CADChB,EAAK,MAAA,CAAA,GAfcqE,EAgBpBnD,WAAA,gBAAA,CAAA,GAhBoBmD,IAArBrD,EAAA,CADCG,EAAc,gBACMkD,CAAAA,GAAAA,CAAAA;"}
1
+ {"version":3,"file":"sheet-D8-zxp3n.js","sources":["../src/sheet/header.ts","../src/sheet/hook.ts","../src/sheet/sheet-content.ts","../src/sheet/sheet.service.ts","../src/sheet/sheet.ts"],"sourcesContent":["import { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\n@customElement('schmancy-sheet-header')\nexport default class SchmancySheetHeader extends TailwindElement(css`\n\t:host {\n\t\tinset: 0;\n\t\tdisplay: block;\n\t\tpadding-bottom: 16px;\n\t}\n`) {\n\t@property() title: string\n\trender() {\n\t\tconst classes = {\n\t\t\tabsolute: this.title.length === 0,\n\t\t\trelative: this.title.length > 0,\n\t\t}\n\t\treturn html`\n\t\t\t<schmancy-grid class=\"${this.classMap(classes)}\" align=\"center\" justify=\"stretch\" cols=\"auto 1fr auto\">\n\t\t\t\t<slot name=\"back\">\n\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\t\t\tnew CustomEvent('dismiss', {\n\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span class=\"text-[24px]\">&#8592; </span>\n\t\t\t\t\t</schmancy-button>\n\t\t\t\t</slot>\n\t\t\t\t<schmancy-typography transform=\"capitalize\" type=\"headline\" token=\"lg\"> ${this.title} </schmancy-typography>\n\t\t\t\t<slot name=\"actions\">\n\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\t\t\tnew CustomEvent('dismiss', {\n\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span class=\"text-[24px]\">✕</span>\n\t\t\t\t\t</schmancy-button>\n\t\t\t\t</slot>\n\t\t\t</schmancy-grid>\n\t\t`\n\t}\n}\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet-header': SchmancySheetHeader\n\t}\n}\n","// @watch decorator\n//\n// Runs when an observed property changes, e.g. @property or @state, but before the component updates.\n//\n// To wait for an update to complete after a change occurs, use `await this.updateComplete` in the handler. To start\n// watching after the initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.\n//\n// Usage:\n//\n// @watch('propName')\n// handlePropChange(oldValue, newValue) {\n// ...\n// }\n//\ninterface WatchOptions {\n waitUntilFirstUpdate?: boolean\n}\n\nexport function hook(propName: string, options?: WatchOptions) {\n return (protoOrDescriptor: any, name: string): any => {\n const { willUpdate } = protoOrDescriptor\n\n options = Object.assign({ waitUntilFirstUpdate: false }, options) as WatchOptions\n\n protoOrDescriptor.willUpdate = function (changedProps: Map<string, any>) {\n willUpdate.call(this, changedProps)\n\n if (changedProps.has(propName)) {\n const oldValue = changedProps.get(propName)\n const newValue = this[propName]\n\n if (oldValue !== newValue) {\n if (!options?.waitUntilFirstUpdate || this.hasUpdated) {\n this[name].call(this, oldValue, newValue)\n }\n }\n }\n }\n }\n}\n","import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\n@customElement('schmancy-sheet-content')\nexport default class SchmancySheetContent extends TailwindElement() {\n\trender() {\n\t\treturn html`\n\t\t\t<div tabindex=\"0\">\n\t\t\t\t<slot></slot>\n\t\t\t</div>\n\t\t`\n\t}\n}\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet-content': SchmancySheetContent\n\t}\n}\n","import {\n\tdefaultIfEmpty,\n\tdelay,\n\tfilter,\n\tforkJoin,\n\tfromEvent,\n\tmap,\n\tmergeMap,\n\tof,\n\tSubject,\n\tswitchMap,\n\ttake,\n\ttakeUntil,\n\ttap,\n\ttimer,\n} from 'rxjs'\nimport SchmancySheet from './sheet'\n\nexport enum SchmancySheetPosition {\n\tSide = 'side',\n\tBottom = 'bottom',\n\t/**\n\t * @deprecated use bottom instead\n\t */\n\tBottomCenter = 'bottom-center',\n\t/**\n\t * @deprecated use side instead\n\t */\n\tTopRight = 'top-right',\n\t/**\n\t * @deprecated use side instead\n\t */\n\tBottomRight = 'bottom-right',\n}\n\ntype BottomSheeetTarget = {\n\tcomponent: HTMLElement\n\tuid?: string\n\tposition?: SchmancySheetPosition\n\tpersist?: boolean\n\tclose?: () => void\n\tallowOverlyDismiss?: boolean\n\ttitle?: string\n\theader?: 'hidden' | 'visible'\n}\n\n// Events for communication between bottom-sheet component and bottom-sheet.service\nexport type SheetWhereAreYouRickyEvent = CustomEvent<{\n\tuid: string\n}>\nexport const SheetWhereAreYouRicky = 'are-you-there-sheet'\n\nexport type SheetHereMortyEvent = CustomEvent<{\n\tsheet: SchmancySheet\n}>\nexport const SheetHereMorty = 'yes-here'\nclass BottomSheetService {\n\tbottomSheet = new Subject<BottomSheeetTarget>()\n\t$dismiss = new Subject<string>()\n\tconstructor() {\n\t\tthis.bottomSheet\n\t\t\t.pipe(\n\t\t\t\tswitchMap(target =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<SheetHereMortyEvent>(window, SheetHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(0)),\n\t\t\t\t\t\t\tmap(e => e.detail.sheet),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(target).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(SheetWhereAreYouRicky, {\n\t\t\t\t\t\t\t\t\t\tdetail: { uid: target.uid ?? target.component.tagName },\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\tmap(([sheet, target]) => {\n\t\t\t\t\tconsole.log(sheet, target)\n\t\t\t\t\tif (!sheet) {\n\t\t\t\t\t\t// if sheet is not found, create it\n\t\t\t\t\t\tsheet = document.createElement('schmancy-sheet')\n\t\t\t\t\t\tdocument.body.appendChild(sheet)\n\t\t\t\t\t}\n\t\t\t\t\tsheet.setAttribute('uid', target.uid ?? target.component.tagName)\n\t\t\t\t\tsheet.setAttribute('position', target.position ?? SchmancySheetPosition.Bottom)\n\t\t\t\t\tsheet.setAttribute('allowOverlyDismiss', target.allowOverlyDismiss === false ? 'false' : 'true')\n\t\t\t\t\ttarget.title && sheet.setAttribute('title', target.title)\n\t\t\t\t\ttarget.persist && sheet.setAttribute('persist', target.persist ?? false)\n\t\t\t\t\ttarget.header && sheet.setAttribute('header', target.header)\n\t\t\t\t\tdocument.body.style.overflow = 'hidden' // lock the scroll of the host\n\t\t\t\t\treturn { target, sheet }\n\t\t\t\t}),\n\t\t\t\tdelay(20),\n\t\t\t\tfilter(({ target, sheet }) => {\n\t\t\t\t\t// if the sheet has already the component, just show it\n\t\t\t\t\tif (\n\t\t\t\t\t\ttarget.persist &&\n\t\t\t\t\t\tsheet?.shadowRoot\n\t\t\t\t\t\t\t?.querySelector('slot')\n\t\t\t\t\t\t\t?.assignedElements()\n\t\t\t\t\t\t\t.find(e => e.tagName === target.component.tagName)\n\t\t\t\t\t) {\n\t\t\t\t\t\tsheet?.setAttribute('open', 'true')\n\t\t\t\t\t\treturn false\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn true // if the sheet does not have the component, continue to the next step\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttap(({ target, sheet }) => {\n\t\t\t\t\tsheet?.appendChild(target.component)\n\t\t\t\t}),\n\t\t\t\tdelay(1),\n\t\t\t\ttap(({ sheet }) => {\n\t\t\t\t\tsheet?.setAttribute('open', 'true')\n\t\t\t\t}),\n\t\t\t\ttap(({ sheet }) => {\n\t\t\t\t\tfromEvent<CustomEvent>(sheet, 'close')\n\t\t\t\t\t\t.pipe(take(1))\n\t\t\t\t\t\t.pipe(delay(300))\n\t\t\t\t\t\t.subscribe(e => {\n\t\t\t\t\t\t\tconst target = e.target as SchmancySheet\n\t\t\t\t\t\t\tconsole.log(target)\n\n\t\t\t\t\t\t\tif (!target?.persist) target?.remove()\n\t\t\t\t\t\t\tdocument.body.style.overflow = 'auto' // unlock the scroll of the host\n\t\t\t\t\t\t})\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\n\t\tthis.$dismiss\n\t\t\t.pipe(\n\t\t\t\tmergeMap(uid =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<SheetHereMortyEvent>(window, SheetHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)), // Some people say why 10? I say why not?\n\t\t\t\t\t\t\tmap(e => e.detail.sheet),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(uid).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new CustomEvent(SheetWhereAreYouRicky, { detail: { uid } }))\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\ttap(([sheet]) => {\n\t\t\t\t\tsheet?.closeSheet()\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\tdismiss(uid: string) {\n\t\tthis.$dismiss.next(uid)\n\t}\n\n\topen(target: BottomSheeetTarget) {\n\t\tthis.bottomSheet.next(target)\n\t}\n}\nexport const sheet = new BottomSheetService()\n","import { $LitElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, property, query, queryAssignedElements } from 'lit/decorators.js'\nimport { fromEvent, merge, takeUntil, tap } from 'rxjs'\nimport { hook } from './hook'\nimport style from './sheet.scss?inline'\nimport {\n\tSchmancySheetPosition,\n\tSheetHereMorty,\n\tSheetWhereAreYouRicky,\n\tSheetWhereAreYouRickyEvent,\n\tsheet,\n} from './sheet.service'\n\n@customElement('schmancy-sheet')\nexport default class SchmancySheet extends $LitElement(style) {\n\t@property({ type: String, reflect: true }) uid!: string\n\t@property({ type: Boolean, reflect: true }) open = false\n\t@property({ type: String, reflect: true }) header: 'hidden' | 'visible' = 'visible'\n\t@property({ type: String, reflect: true }) position: SchmancySheetPosition = SchmancySheetPosition.Side\n\t@property({ type: Boolean, reflect: true }) persist = false\n\t@property({ type: Boolean, reflect: true }) allowOverlayDismiss = true\n\t@property({ type: String, reflect: true }) title = ''\n\n\t@query('.sheet') private sheet!: HTMLElement\n\t@queryAssignedElements({ flatten: true }) private assignedElements!: HTMLElement[]\n\n\t@property() focusAttribute = 'autofocus'\n\tprivate lastFocusedElement: HTMLElement | null = null\n\n\t@hook('open')\n\tonOpenChange(_oldValue: boolean, newValue: boolean) {\n\t\tthis.setIsSheetShown(newValue)\n\n\t\tif (newValue) {\n\t\t\tthis.lastFocusedElement = document.activeElement as HTMLElement\n\t\t\tthis.addFocusTrap()\n\t\t\tthis.focus()\n\t\t} else {\n\t\t\tthis.removeFocusTrap()\n\t\t\tthis.lastFocusedElement?.focus()\n\t\t\tthis.lastFocusedElement = null\n\t\t}\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tthis.setupEventListeners()\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis.disconnecting.next(true)\n\t}\n\n\tprivate setupEventListeners() {\n\t\t// Handle browser back button\n\t\tconst popState$ = fromEvent<PopStateEvent>(window, 'popstate').pipe(\n\t\t\ttap(e => {\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.closeSheet()\n\t\t\t}),\n\t\t)\n\n\t\t// Handle ESC key\n\t\tconst keyUp$ = fromEvent<KeyboardEvent>(window, 'keyup').pipe(\n\t\t\ttap(event => {\n\t\t\t\tif (event.key === 'Escape' && !this.sheetContainsFocus()) {\n\t\t\t\t\tsheet.dismiss(this.uid)\n\t\t\t\t}\n\t\t\t}),\n\t\t)\n\n\t\t// Handle inter-component communication\n\t\tconst rickyComm$ = fromEvent<SheetWhereAreYouRickyEvent>(window, SheetWhereAreYouRicky).pipe(\n\t\t\ttap(e => {\n\t\t\t\tif (e.detail.uid === this.uid) this.announcePresence()\n\t\t\t}),\n\t\t)\n\n\t\tmerge(popState$, keyUp$, rickyComm$).pipe(takeUntil(this.disconnecting)).subscribe()\n\t}\n\n\tprivate sheetContainsFocus(): boolean {\n\t\treturn this.sheet?.contains(document.activeElement) ?? false\n\t}\n\n\tprivate announcePresence() {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(SheetHereMorty, {\n\t\t\t\tdetail: { sheet: this },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\tprivate addFocusTrap() {\n\t\tdocument.addEventListener('focusin', this.handleFocusIn)\n\t}\n\n\tprivate removeFocusTrap() {\n\t\tdocument.removeEventListener('focusin', this.handleFocusIn)\n\t}\n\n\tprivate handleFocusIn = (e: Event) => {\n\t\tif (!this.sheet?.contains(e.target as Node)) {\n\t\t\tthis.focus()\n\t\t}\n\t}\n\n\tsetIsSheetShown(isShown: boolean) {\n\t\tthis.sheet?.setAttribute('aria-hidden', String(!isShown))\n\t\tthis.sheet?.setAttribute('aria-modal', String(isShown))\n\t}\n\n\tcloseSheet() {\n\t\tthis.open = false\n\t\tthis.dispatchEvent(new CustomEvent('close'))\n\t}\n\n\tprivate getFocusElement(): HTMLElement | null {\n\t\tconst selector = `[${this.focusAttribute}]`\n\t\treturn (this.assignedElements.find(el => el.matches(selector) || el.querySelector(selector)) as HTMLElement) ?? null\n\t}\n\n\toverride focus() {\n\t\tthis.getFocusElement()?.focus()\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<schmancy-theme>\n\t\t\t\t<div class=\"sheet\" role=\"dialog\" aria-labelledby=\"sheet-title\" aria-hidden=\"true\" aria-modal=\"false\">\n\t\t\t\t\t<div class=\"overlay\" @click=${() => this.allowOverlayDismiss && sheet.dismiss(this.uid)}></div>\n\n\t\t\t\t\t<schmancy-scroll\n\t\t\t\t\t\t><schmancy-sheet-content class=\"content\" data-position=${this.position}>\n\t\t\t\t\t\t\t<schmancy-sheet-header\n\t\t\t\t\t\t\t\t@dismiss=${(e: CustomEvent) => {\n\t\t\t\t\t\t\t\t\te.stopPropagation()\n\t\t\t\t\t\t\t\t\tsheet.dismiss(this.uid)\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tid=\"sheet-title\"\n\t\t\t\t\t\t\t\t.hidden=${this.header === 'hidden'}\n\t\t\t\t\t\t\t\ttitle=${this.title}\n\t\t\t\t\t\t\t></schmancy-sheet-header>\n\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t</schmancy-sheet-content>\n\t\t\t\t\t</schmancy-scroll>\n\t\t\t\t</div>\n\t\t\t</schmancy-theme>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet': SchmancySheet\n\t}\n}\n"],"names":["SchmancySheetHeader","TailwindElement","css","classes","absolute","this","title","length","relative","html","classMap","dispatchEvent","CustomEvent","bubbles","composed","hook","propName","options","protoOrDescriptor","name","willUpdate","Object","assign","waitUntilFirstUpdate","changedProps","call","has","oldValue","get","newValue","hasUpdated","__decorateClass","property","prototype","customElement","SchmancySheetContent","render","SchmancySheetPosition","SheetWhereAreYouRicky","SheetHereMorty","sheet","bottomSheet","Subject","$dismiss","pipe","switchMap","forkJoin","fromEvent","window","takeUntil","timer","map","e","detail","defaultIfEmpty","of","target","tap","uid","component","tagName","document","createElement","body","appendChild","setAttribute","position","allowOverlyDismiss","persist","header","style","overflow","delay","filter","shadowRoot","querySelector","assignedElements","find","take","subscribe","remove","mergeMap","closeSheet","next","SchmancySheet","$LitElement","constructor","super","arguments","open","Side","allowOverlayDismiss","focusAttribute","lastFocusedElement","handleFocusIn","contains","focus","_oldValue","setIsSheetShown","activeElement","addFocusTrap","removeFocusTrap","connectedCallback","setupEventListeners","disconnectedCallback","disconnecting","popState$","preventDefault","keyUp$","event","key","sheetContainsFocus","dismiss","rickyComm$","announcePresence","merge","addEventListener","removeEventListener","isShown","String","selector","el","matches","getFocusElement","stopPropagation","type","reflect","Boolean","query","queryAssignedElements","flatten"],"mappings":";;;;;;;;;;;AAKA,IAAqBA,IAArB,cAAiDC,EAAgBC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAQhE,EAAA;AAAA,EAAA,SACC;AAAA,UAAMC,IAAU,EACfC,UAAUC,KAAKC,MAAMC,WAAW,GAChCC,UAAUH,KAAKC,MAAMC,SAAS,EAAA;AAExB,WAAAE;AAAAA,2BACkBJ,KAAKK,SAASP,CAAAA,CAAAA;AAAAA;AAAAA;AAAAA,eAG1B,MACHE;AAAAA,WAAAM,cACJ,IAAIC,YAAY,WAAW,EAC1BC,SAAAA,IACAC,UAAAA,GAEF,CAAA,CAAA;AAAA,IAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8EAMuET,KAAKC,KAAAA;AAAAA;AAAAA;AAAAA,eAGpE,MACHD;AAAAA,WAAAM,cACJ,IAAIC,YAAY,WAAW,EAC1BC,SAAAA,IACAC,UAAAA,GAEF,CAAA,CAAA;AAAA,IAAA,CAAA;AAAA;AAAA;AAAA;AA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AAA,CAAAA,GAZmBoD,EAYRnD,WAAA,kBAAA,CAAA,GAIZF,EAAA,CADChB,EAAK,MAAA,CAAA,GAfcqE,EAgBpBnD,WAAA,gBAAA,CAAA,GAhBoBmD,IAArBrD,EAAA,CADCG,EAAc,gBACMkD,CAAAA,GAAAA,CAAAA;"}
@@ -1,4 +1,4 @@
1
- "use strict";const s=require("rxjs");require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const E=require("./tailwind.mixin-bRVZL2lY.cjs"),d=require("lit"),c=require("lit/decorators.js"),S=require("./litElement.mixin-BGFFSTo6.cjs");var x=Object.defineProperty,k=Object.getOwnPropertyDescriptor,f=(t,e,i,n)=>{for(var r,o=n>1?void 0:n?k(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(n?r(e,i,o):r(o))||o);return n&&o&&x(e,i,o),o};let y=class extends E.TailwindElement(d.css`
1
+ "use strict";const s=require("rxjs");require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const E=require("./tailwind.mixin-bRVZL2lY.cjs"),d=require("lit"),c=require("lit/decorators.js"),S=require("./litElement.mixin-BGFFSTo6.cjs");var k=Object.defineProperty,x=Object.getOwnPropertyDescriptor,f=(t,e,i,n)=>{for(var r,o=n>1?void 0:n?x(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(n?r(e,i,o):r(o))||o);return n&&o&&k(e,i,o),o};let y=class extends E.TailwindElement(d.css`
2
2
  :host {
3
3
  inset: 0;
4
4
  display: block;
@@ -26,24 +26,24 @@
26
26
  <div tabindex="0">
27
27
  <slot></slot>
28
28
  </div>
29
- `}};w=((t,e,i,n)=>{for(var r,o=n>1?void 0:n?F(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(n?r(e,i,o):r(o))||o);return n&&o&&C(e,i,o),o})([c.customElement("schmancy-sheet-content")],w);var b=(t=>(t.Side="side",t.Bottom="bottom",t.BottomCenter="bottom-center",t.TopRight="top-right",t.BottomRight="bottom-right",t))(b||{});const u="are-you-there-sheet",m="yes-here",p=new class{constructor(){this.bottomSheet=new s.Subject,this.$dismiss=new s.Subject,this.bottomSheet.pipe(s.switchMap(t=>s.forkJoin([s.fromEvent(window,m).pipe(s.takeUntil(s.timer(0)),s.map(e=>e.detail.sheet),s.defaultIfEmpty(void 0)),s.of(t).pipe(s.tap(()=>{window.dispatchEvent(new CustomEvent(u,{detail:{uid:t.uid??t.component.tagName}}))}))])),s.map(([t,e])=>(t||(t=document.createElement("schmancy-sheet"),document.body.appendChild(t)),t.setAttribute("uid",e.uid??e.component.tagName),t.setAttribute("position",e.position??"bottom"),t.setAttribute("allowOverlyDismiss",e.allowOverlyDismiss===!1?"false":"true"),e.title&&t.setAttribute("title",e.title),e.persist&&t.setAttribute("persist",e.persist??!1),e.header&&t.setAttribute("header",e.header),document.body.style.overflow="hidden",{target:e,sheet:t})),s.delay(20),s.filter(({target:t,sheet:e})=>{var i,n;return!t.persist||!((n=(i=e==null?void 0:e.shadowRoot)==null?void 0:i.querySelector("slot"))!=null&&n.assignedElements().find(r=>r.tagName===t.component.tagName))||(e==null||e.setAttribute("open","true"),!1)}),s.tap(({target:t,sheet:e})=>{e==null||e.appendChild(t.component)}),s.delay(1),s.tap(({sheet:t})=>{t==null||t.setAttribute("open","true")}),s.tap(({sheet:t})=>{s.fromEvent(t,"close").pipe(s.take(1)).pipe(s.delay(300)).subscribe(e=>{const i=e.target;i!=null&&i.persist||(i==null||i.remove()),document.body.style.overflow="auto"})})).subscribe(),this.$dismiss.pipe(s.mergeMap(t=>s.forkJoin([s.fromEvent(window,m).pipe(s.takeUntil(s.timer(100)),s.map(e=>e.detail.sheet),s.defaultIfEmpty(void 0)),s.of(t).pipe(s.tap(()=>{window.dispatchEvent(new CustomEvent(u,{detail:{uid:t}}))}))])),s.tap(([t])=>{t==null||t.closeSheet()})).subscribe()}dismiss(t){this.$dismiss.next(t)}open(t){this.bottomSheet.next(t)}};var O=Object.defineProperty,A=Object.getOwnPropertyDescriptor,h=(t,e,i,n)=>{for(var r,o=n>1?void 0:n?A(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(n?r(e,i,o):r(o))||o);return n&&o&&O(e,i,o),o};let l=class extends S.$LitElement(":host{--overlay-color: var(--schmancy-sys-color-surface-dim);--transition-duration: .2s;--sheet-radius: 0;--max-height: 100vh}.sheet{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;display:flex;visibility:visible;transition:visibility var(--transition-duration) ease-in-out}.sheet[aria-hidden=true]{visibility:hidden;pointer-events:none}.sheet[aria-hidden=true] .content{transform:translateY(100%)}.sheet[aria-hidden=true] .content[data-position=side]{transform:translate(100%)}.sheet[aria-hidden=true] .overlay{opacity:0}.overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:var(--overlay-color);opacity:.4;transition:opacity var(--transition-duration) ease-in-out}.content{position:relative;z-index:1;display:flex;flex-direction:column;background:#fff;transition:transform var(--transition-duration) ease-in-out}.content[data-position=side]{height:100%;margin-left:auto;min-width:320px;max-width:90vw}.content[data-position=bottom]{width:100%;margin-top:auto;border-radius:16px 16px 0 0;max-height:90vh}.content-body{flex:1;overflow-y:auto;padding:1rem}"){constructor(){super(...arguments),this.open=!1,this.header="visible",this.position=b.Side,this.persist=!1,this.allowOverlayDismiss=!0,this.title="",this.focusAttribute="autofocus",this.lastFocusedElement=null,this.handleFocusIn=t=>{var e;(e=this.sheet)!=null&&e.contains(t.target)||this.focus()}}onOpenChange(t,e){var i;this.setIsSheetShown(e),e?(this.lastFocusedElement=document.activeElement,this.addFocusTrap(),this.focus()):(this.removeFocusTrap(),(i=this.lastFocusedElement)==null||i.focus(),this.lastFocusedElement=null)}connectedCallback(){super.connectedCallback(),this.setupEventListeners()}disconnectedCallback(){super.disconnectedCallback(),this.disconnecting.next(!0)}setupEventListeners(){const t=s.fromEvent(window,"popstate").pipe(s.tap(n=>{n.preventDefault(),this.closeSheet()})),e=s.fromEvent(window,"keyup").pipe(s.tap(n=>{n.key!=="Escape"||this.sheetContainsFocus()||p.dismiss(this.uid)})),i=s.fromEvent(window,u).pipe(s.tap(n=>{n.detail.uid===this.uid&&this.announcePresence()}));s.merge(t,e,i).pipe(s.takeUntil(this.disconnecting)).subscribe()}sheetContainsFocus(){var t;return((t=this.sheet)==null?void 0:t.contains(document.activeElement))??!1}announcePresence(){this.dispatchEvent(new CustomEvent(m,{detail:{sheet:this},bubbles:!0,composed:!0}))}addFocusTrap(){document.addEventListener("focusin",this.handleFocusIn)}removeFocusTrap(){document.removeEventListener("focusin",this.handleFocusIn)}setIsSheetShown(t){var e,i;(e=this.sheet)==null||e.setAttribute("aria-hidden",String(!t)),(i=this.sheet)==null||i.setAttribute("aria-modal",String(t))}closeSheet(){this.open=!1,this.dispatchEvent(new CustomEvent("close"))}getFocusElement(){const t=`[${this.focusAttribute}]`;return this.assignedElements.find(e=>e.matches(t)||e.querySelector(t))??null}focus(){var t;(t=this.getFocusElement())==null||t.focus()}render(){return d.html`
29
+ `}};w=((t,e,i,n)=>{for(var r,o=n>1?void 0:n?F(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(n?r(e,i,o):r(o))||o);return n&&o&&C(e,i,o),o})([c.customElement("schmancy-sheet-content")],w);var b=(t=>(t.Side="side",t.Bottom="bottom",t.BottomCenter="bottom-center",t.TopRight="top-right",t.BottomRight="bottom-right",t))(b||{});const u="are-you-there-sheet",m="yes-here",p=new class{constructor(){this.bottomSheet=new s.Subject,this.$dismiss=new s.Subject,this.bottomSheet.pipe(s.switchMap(t=>s.forkJoin([s.fromEvent(window,m).pipe(s.takeUntil(s.timer(0)),s.map(e=>e.detail.sheet),s.defaultIfEmpty(void 0)),s.of(t).pipe(s.tap(()=>{window.dispatchEvent(new CustomEvent(u,{detail:{uid:t.uid??t.component.tagName}}))}))])),s.map(([t,e])=>(t||(t=document.createElement("schmancy-sheet"),document.body.appendChild(t)),t.setAttribute("uid",e.uid??e.component.tagName),t.setAttribute("position",e.position??"bottom"),t.setAttribute("allowOverlyDismiss",e.allowOverlyDismiss===!1?"false":"true"),e.title&&t.setAttribute("title",e.title),e.persist&&t.setAttribute("persist",e.persist??!1),e.header&&t.setAttribute("header",e.header),document.body.style.overflow="hidden",{target:e,sheet:t})),s.delay(20),s.filter(({target:t,sheet:e})=>{var i,n;return!t.persist||!((n=(i=e==null?void 0:e.shadowRoot)==null?void 0:i.querySelector("slot"))!=null&&n.assignedElements().find(r=>r.tagName===t.component.tagName))||(e==null||e.setAttribute("open","true"),!1)}),s.tap(({target:t,sheet:e})=>{e==null||e.appendChild(t.component)}),s.delay(1),s.tap(({sheet:t})=>{t==null||t.setAttribute("open","true")}),s.tap(({sheet:t})=>{s.fromEvent(t,"close").pipe(s.take(1)).pipe(s.delay(300)).subscribe(e=>{const i=e.target;i!=null&&i.persist||(i==null||i.remove()),document.body.style.overflow="auto"})})).subscribe(),this.$dismiss.pipe(s.mergeMap(t=>s.forkJoin([s.fromEvent(window,m).pipe(s.takeUntil(s.timer(100)),s.map(e=>e.detail.sheet),s.defaultIfEmpty(void 0)),s.of(t).pipe(s.tap(()=>{window.dispatchEvent(new CustomEvent(u,{detail:{uid:t}}))}))])),s.tap(([t])=>{t==null||t.closeSheet()})).subscribe()}dismiss(t){this.$dismiss.next(t)}open(t){this.bottomSheet.next(t)}};var O=Object.defineProperty,A=Object.getOwnPropertyDescriptor,l=(t,e,i,n)=>{for(var r,o=n>1?void 0:n?A(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(n?r(e,i,o):r(o))||o);return n&&o&&O(e,i,o),o};let h=class extends S.$LitElement(':host{--overlay-color: var(--schmancy-sys-color-surface-dim);--transition-duration: .2s;--sheet-radius: 0;--max-height: 100vh}.sheet{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;display:flex;visibility:visible;transition:visibility var(--transition-duration) ease-in-out}.sheet[aria-hidden=true]{visibility:hidden;pointer-events:none}.sheet[aria-hidden=true] .content{transform:translateY(100%)}.sheet[aria-hidden=true] .content[data-position=side]{transform:translate(100%)}.sheet[aria-hidden=true] .overlay{opacity:0}.overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:var(--overlay-color);opacity:.4;transition:opacity var(--transition-duration) ease-in-out}.content{position:relative;display:grid;grid-template-columns:"auto 1fr";z-index:1;top:0;right:0;bottom:0;left:0;background-color:var(--schmancy-sys-color-surface-container);transition:transform var(--transition-duration) ease-in-out}.content[data-position=side]{height:100%;margin-left:auto;min-width:320px;max-width:90vw}.content[data-position=bottom]{width:100%;margin-top:auto;border-radius:16px 16px 0 0;max-height:90vh}'){constructor(){super(...arguments),this.open=!1,this.header="visible",this.position=b.Side,this.persist=!1,this.allowOverlayDismiss=!0,this.title="",this.focusAttribute="autofocus",this.lastFocusedElement=null,this.handleFocusIn=t=>{var e;(e=this.sheet)!=null&&e.contains(t.target)||this.focus()}}onOpenChange(t,e){var i;this.setIsSheetShown(e),e?(this.lastFocusedElement=document.activeElement,this.addFocusTrap(),this.focus()):(this.removeFocusTrap(),(i=this.lastFocusedElement)==null||i.focus(),this.lastFocusedElement=null)}connectedCallback(){super.connectedCallback(),this.setupEventListeners()}disconnectedCallback(){super.disconnectedCallback(),this.disconnecting.next(!0)}setupEventListeners(){const t=s.fromEvent(window,"popstate").pipe(s.tap(n=>{n.preventDefault(),this.closeSheet()})),e=s.fromEvent(window,"keyup").pipe(s.tap(n=>{n.key!=="Escape"||this.sheetContainsFocus()||p.dismiss(this.uid)})),i=s.fromEvent(window,u).pipe(s.tap(n=>{n.detail.uid===this.uid&&this.announcePresence()}));s.merge(t,e,i).pipe(s.takeUntil(this.disconnecting)).subscribe()}sheetContainsFocus(){var t;return((t=this.sheet)==null?void 0:t.contains(document.activeElement))??!1}announcePresence(){this.dispatchEvent(new CustomEvent(m,{detail:{sheet:this},bubbles:!0,composed:!0}))}addFocusTrap(){document.addEventListener("focusin",this.handleFocusIn)}removeFocusTrap(){document.removeEventListener("focusin",this.handleFocusIn)}setIsSheetShown(t){var e,i;(e=this.sheet)==null||e.setAttribute("aria-hidden",String(!t)),(i=this.sheet)==null||i.setAttribute("aria-modal",String(t))}closeSheet(){this.open=!1,this.dispatchEvent(new CustomEvent("close"))}getFocusElement(){const t=`[${this.focusAttribute}]`;return this.assignedElements.find(e=>e.matches(t)||e.querySelector(t))??null}focus(){var t;(t=this.getFocusElement())==null||t.focus()}render(){return d.html`
30
30
  <schmancy-theme>
31
31
  <div class="sheet" role="dialog" aria-labelledby="sheet-title" aria-hidden="true" aria-modal="false">
32
32
  <div class="overlay" @click=${()=>this.allowOverlayDismiss&&p.dismiss(this.uid)}></div>
33
33
 
34
- <schmancy-sheet-content class="content" data-position=${this.position}>
35
- <schmancy-sheet-header
36
- @dismiss=${t=>{t.stopPropagation(),p.dismiss(this.uid)}}
37
- id="sheet-title"
38
- .hidden=${this.header==="hidden"}
39
- title=${this.title}
40
- ></schmancy-sheet-header>
34
+ <schmancy-scroll
35
+ ><schmancy-sheet-content class="content" data-position=${this.position}>
36
+ <schmancy-sheet-header
37
+ @dismiss=${t=>{t.stopPropagation(),p.dismiss(this.uid)}}
38
+ id="sheet-title"
39
+ .hidden=${this.header==="hidden"}
40
+ title=${this.title}
41
+ ></schmancy-sheet-header>
41
42
 
42
- <section class="content-body">
43
43
  <slot></slot>
44
- </section>
45
- </schmancy-sheet-content>
44
+ </schmancy-sheet-content>
45
+ </schmancy-scroll>
46
46
  </div>
47
47
  </schmancy-theme>
48
- `}};h([c.property({type:String,reflect:!0})],l.prototype,"uid",2),h([c.property({type:Boolean,reflect:!0})],l.prototype,"open",2),h([c.property({type:String,reflect:!0})],l.prototype,"header",2),h([c.property({type:String,reflect:!0})],l.prototype,"position",2),h([c.property({type:Boolean,reflect:!0})],l.prototype,"persist",2),h([c.property({type:Boolean,reflect:!0})],l.prototype,"allowOverlayDismiss",2),h([c.property({type:String,reflect:!0})],l.prototype,"title",2),h([c.query(".sheet")],l.prototype,"sheet",2),h([c.queryAssignedElements({flatten:!0})],l.prototype,"assignedElements",2),h([c.property()],l.prototype,"focusAttribute",2),h([g("open")],l.prototype,"onOpenChange",1),l=h([c.customElement("schmancy-sheet")],l),exports.SchmancySheetPosition=b,exports.SheetHereMorty=m,exports.SheetWhereAreYouRicky=u,exports.hook=g,exports.sheet=p;
49
- //# sourceMappingURL=sheet-CUTDrhww.cjs.map
48
+ `}};l([c.property({type:String,reflect:!0})],h.prototype,"uid",2),l([c.property({type:Boolean,reflect:!0})],h.prototype,"open",2),l([c.property({type:String,reflect:!0})],h.prototype,"header",2),l([c.property({type:String,reflect:!0})],h.prototype,"position",2),l([c.property({type:Boolean,reflect:!0})],h.prototype,"persist",2),l([c.property({type:Boolean,reflect:!0})],h.prototype,"allowOverlayDismiss",2),l([c.property({type:String,reflect:!0})],h.prototype,"title",2),l([c.query(".sheet")],h.prototype,"sheet",2),l([c.queryAssignedElements({flatten:!0})],h.prototype,"assignedElements",2),l([c.property()],h.prototype,"focusAttribute",2),l([g("open")],h.prototype,"onOpenChange",1),h=l([c.customElement("schmancy-sheet")],h),exports.SchmancySheetPosition=b,exports.SheetHereMorty=m,exports.SheetWhereAreYouRicky=u,exports.hook=g,exports.sheet=p;
49
+ //# sourceMappingURL=sheet-VJBIc1zb.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"sheet-CUTDrhww.cjs","sources":["../src/sheet/header.ts","../src/sheet/hook.ts","../src/sheet/sheet-content.ts","../src/sheet/sheet.service.ts","../src/sheet/sheet.ts"],"sourcesContent":["import { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\n@customElement('schmancy-sheet-header')\nexport default class SchmancySheetHeader extends TailwindElement(css`\n\t:host {\n\t\tinset: 0;\n\t\tdisplay: block;\n\t\tpadding-bottom: 16px;\n\t}\n`) {\n\t@property() title: string\n\trender() {\n\t\tconst classes = {\n\t\t\tabsolute: this.title.length === 0,\n\t\t\trelative: this.title.length > 0,\n\t\t}\n\t\treturn html`\n\t\t\t<schmancy-grid class=\"${this.classMap(classes)}\" align=\"center\" justify=\"stretch\" cols=\"auto 1fr auto\">\n\t\t\t\t<slot name=\"back\">\n\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\t\t\tnew CustomEvent('dismiss', {\n\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span class=\"text-[24px]\">&#8592; </span>\n\t\t\t\t\t</schmancy-button>\n\t\t\t\t</slot>\n\t\t\t\t<schmancy-typography transform=\"capitalize\" type=\"headline\" token=\"lg\"> ${this.title} </schmancy-typography>\n\t\t\t\t<slot name=\"actions\">\n\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\t\t\tnew CustomEvent('dismiss', {\n\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span class=\"text-[24px]\">✕</span>\n\t\t\t\t\t</schmancy-button>\n\t\t\t\t</slot>\n\t\t\t</schmancy-grid>\n\t\t`\n\t}\n}\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet-header': SchmancySheetHeader\n\t}\n}\n","// @watch decorator\n//\n// Runs when an observed property changes, e.g. @property or @state, but before the component updates.\n//\n// To wait for an update to complete after a change occurs, use `await this.updateComplete` in the handler. To start\n// watching after the initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.\n//\n// Usage:\n//\n// @watch('propName')\n// handlePropChange(oldValue, newValue) {\n// ...\n// }\n//\ninterface WatchOptions {\n waitUntilFirstUpdate?: boolean\n}\n\nexport function hook(propName: string, options?: WatchOptions) {\n return (protoOrDescriptor: any, name: string): any => {\n const { willUpdate } = protoOrDescriptor\n\n options = Object.assign({ waitUntilFirstUpdate: false }, options) as WatchOptions\n\n protoOrDescriptor.willUpdate = function (changedProps: Map<string, any>) {\n willUpdate.call(this, changedProps)\n\n if (changedProps.has(propName)) {\n const oldValue = changedProps.get(propName)\n const newValue = this[propName]\n\n if (oldValue !== newValue) {\n if (!options?.waitUntilFirstUpdate || this.hasUpdated) {\n this[name].call(this, oldValue, newValue)\n }\n }\n }\n }\n }\n}\n","import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\n@customElement('schmancy-sheet-content')\nexport default class SchmancySheetContent extends TailwindElement() {\n\trender() {\n\t\treturn html`\n\t\t\t<div tabindex=\"0\">\n\t\t\t\t<slot></slot>\n\t\t\t</div>\n\t\t`\n\t}\n}\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet-content': SchmancySheetContent\n\t}\n}\n","import {\n\tdefaultIfEmpty,\n\tdelay,\n\tfilter,\n\tforkJoin,\n\tfromEvent,\n\tmap,\n\tmergeMap,\n\tof,\n\tSubject,\n\tswitchMap,\n\ttake,\n\ttakeUntil,\n\ttap,\n\ttimer,\n} from 'rxjs'\nimport SchmancySheet from './sheet'\n\nexport enum SchmancySheetPosition {\n\tSide = 'side',\n\tBottom = 'bottom',\n\t/**\n\t * @deprecated use bottom instead\n\t */\n\tBottomCenter = 'bottom-center',\n\t/**\n\t * @deprecated use side instead\n\t */\n\tTopRight = 'top-right',\n\t/**\n\t * @deprecated use side instead\n\t */\n\tBottomRight = 'bottom-right',\n}\n\ntype BottomSheeetTarget = {\n\tcomponent: HTMLElement\n\tuid?: string\n\tposition?: SchmancySheetPosition\n\tpersist?: boolean\n\tclose?: () => void\n\tallowOverlyDismiss?: boolean\n\ttitle?: string\n\theader?: 'hidden' | 'visible'\n}\n\n// Events for communication between bottom-sheet component and bottom-sheet.service\nexport type SheetWhereAreYouRickyEvent = CustomEvent<{\n\tuid: string\n}>\nexport const SheetWhereAreYouRicky = 'are-you-there-sheet'\n\nexport type SheetHereMortyEvent = CustomEvent<{\n\tsheet: SchmancySheet\n}>\nexport const SheetHereMorty = 'yes-here'\nclass BottomSheetService {\n\tbottomSheet = new Subject<BottomSheeetTarget>()\n\t$dismiss = new Subject<string>()\n\tconstructor() {\n\t\tthis.bottomSheet\n\t\t\t.pipe(\n\t\t\t\tswitchMap(target =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<SheetHereMortyEvent>(window, SheetHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(0)),\n\t\t\t\t\t\t\tmap(e => e.detail.sheet),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(target).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(SheetWhereAreYouRicky, {\n\t\t\t\t\t\t\t\t\t\tdetail: { uid: target.uid ?? target.component.tagName },\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\tmap(([sheet, target]) => {\n\t\t\t\t\tconsole.log(sheet, target)\n\t\t\t\t\tif (!sheet) {\n\t\t\t\t\t\t// if sheet is not found, create it\n\t\t\t\t\t\tsheet = document.createElement('schmancy-sheet')\n\t\t\t\t\t\tdocument.body.appendChild(sheet)\n\t\t\t\t\t}\n\t\t\t\t\tsheet.setAttribute('uid', target.uid ?? target.component.tagName)\n\t\t\t\t\tsheet.setAttribute('position', target.position ?? SchmancySheetPosition.Bottom)\n\t\t\t\t\tsheet.setAttribute('allowOverlyDismiss', target.allowOverlyDismiss === false ? 'false' : 'true')\n\t\t\t\t\ttarget.title && sheet.setAttribute('title', target.title)\n\t\t\t\t\ttarget.persist && sheet.setAttribute('persist', target.persist ?? false)\n\t\t\t\t\ttarget.header && sheet.setAttribute('header', target.header)\n\t\t\t\t\tdocument.body.style.overflow = 'hidden' // lock the scroll of the host\n\t\t\t\t\treturn { target, sheet }\n\t\t\t\t}),\n\t\t\t\tdelay(20),\n\t\t\t\tfilter(({ target, sheet }) => {\n\t\t\t\t\t// if the sheet has already the component, just show it\n\t\t\t\t\tif (\n\t\t\t\t\t\ttarget.persist &&\n\t\t\t\t\t\tsheet?.shadowRoot\n\t\t\t\t\t\t\t?.querySelector('slot')\n\t\t\t\t\t\t\t?.assignedElements()\n\t\t\t\t\t\t\t.find(e => e.tagName === target.component.tagName)\n\t\t\t\t\t) {\n\t\t\t\t\t\tsheet?.setAttribute('open', 'true')\n\t\t\t\t\t\treturn false\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn true // if the sheet does not have the component, continue to the next step\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttap(({ target, sheet }) => {\n\t\t\t\t\tsheet?.appendChild(target.component)\n\t\t\t\t}),\n\t\t\t\tdelay(1),\n\t\t\t\ttap(({ sheet }) => {\n\t\t\t\t\tsheet?.setAttribute('open', 'true')\n\t\t\t\t}),\n\t\t\t\ttap(({ sheet }) => {\n\t\t\t\t\tfromEvent<CustomEvent>(sheet, 'close')\n\t\t\t\t\t\t.pipe(take(1))\n\t\t\t\t\t\t.pipe(delay(300))\n\t\t\t\t\t\t.subscribe(e => {\n\t\t\t\t\t\t\tconst target = e.target as SchmancySheet\n\t\t\t\t\t\t\tconsole.log(target)\n\n\t\t\t\t\t\t\tif (!target?.persist) target?.remove()\n\t\t\t\t\t\t\tdocument.body.style.overflow = 'auto' // unlock the scroll of the host\n\t\t\t\t\t\t})\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\n\t\tthis.$dismiss\n\t\t\t.pipe(\n\t\t\t\tmergeMap(uid =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<SheetHereMortyEvent>(window, SheetHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)), // Some people say why 10? I say why not?\n\t\t\t\t\t\t\tmap(e => e.detail.sheet),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(uid).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new CustomEvent(SheetWhereAreYouRicky, { detail: { uid } }))\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\ttap(([sheet]) => {\n\t\t\t\t\tsheet?.closeSheet()\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\tdismiss(uid: string) {\n\t\tthis.$dismiss.next(uid)\n\t}\n\n\topen(target: BottomSheeetTarget) {\n\t\tthis.bottomSheet.next(target)\n\t}\n}\nexport const sheet = new BottomSheetService()\n","import { $LitElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, property, query, queryAssignedElements } from 'lit/decorators.js'\nimport { fromEvent, merge, takeUntil, tap } from 'rxjs'\nimport { hook } from './hook'\nimport style from './sheet.scss?inline'\nimport {\n\tSchmancySheetPosition,\n\tSheetHereMorty,\n\tSheetWhereAreYouRicky,\n\tSheetWhereAreYouRickyEvent,\n\tsheet,\n} from './sheet.service'\n\n@customElement('schmancy-sheet')\nexport default class SchmancySheet extends $LitElement(style) {\n\t@property({ type: String, reflect: true }) uid!: string\n\t@property({ type: Boolean, reflect: true }) open = false\n\t@property({ type: String, reflect: true }) header: 'hidden' | 'visible' = 'visible'\n\t@property({ type: String, reflect: true }) position: SchmancySheetPosition = SchmancySheetPosition.Side\n\t@property({ type: Boolean, reflect: true }) persist = false\n\t@property({ type: Boolean, reflect: true }) allowOverlayDismiss = true\n\t@property({ type: String, reflect: true }) title = ''\n\n\t@query('.sheet') private sheet!: HTMLElement\n\t@queryAssignedElements({ flatten: true }) private assignedElements!: HTMLElement[]\n\n\t@property() focusAttribute = 'autofocus'\n\tprivate lastFocusedElement: HTMLElement | null = null\n\n\t@hook('open')\n\tonOpenChange(_oldValue: boolean, newValue: boolean) {\n\t\tthis.setIsSheetShown(newValue)\n\n\t\tif (newValue) {\n\t\t\tthis.lastFocusedElement = document.activeElement as HTMLElement\n\t\t\tthis.addFocusTrap()\n\t\t\tthis.focus()\n\t\t} else {\n\t\t\tthis.removeFocusTrap()\n\t\t\tthis.lastFocusedElement?.focus()\n\t\t\tthis.lastFocusedElement = null\n\t\t}\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tthis.setupEventListeners()\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis.disconnecting.next(true)\n\t}\n\n\tprivate setupEventListeners() {\n\t\t// Handle browser back button\n\t\tconst popState$ = fromEvent<PopStateEvent>(window, 'popstate').pipe(\n\t\t\ttap(e => {\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.closeSheet()\n\t\t\t}),\n\t\t)\n\n\t\t// Handle ESC key\n\t\tconst keyUp$ = fromEvent<KeyboardEvent>(window, 'keyup').pipe(\n\t\t\ttap(event => {\n\t\t\t\tif (event.key === 'Escape' && !this.sheetContainsFocus()) {\n\t\t\t\t\tsheet.dismiss(this.uid)\n\t\t\t\t}\n\t\t\t}),\n\t\t)\n\n\t\t// Handle inter-component communication\n\t\tconst rickyComm$ = fromEvent<SheetWhereAreYouRickyEvent>(window, SheetWhereAreYouRicky).pipe(\n\t\t\ttap(e => {\n\t\t\t\tif (e.detail.uid === this.uid) this.announcePresence()\n\t\t\t}),\n\t\t)\n\n\t\tmerge(popState$, keyUp$, rickyComm$).pipe(takeUntil(this.disconnecting)).subscribe()\n\t}\n\n\tprivate sheetContainsFocus(): boolean {\n\t\treturn this.sheet?.contains(document.activeElement) ?? false\n\t}\n\n\tprivate announcePresence() {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(SheetHereMorty, {\n\t\t\t\tdetail: { sheet: this },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\tprivate addFocusTrap() {\n\t\tdocument.addEventListener('focusin', this.handleFocusIn)\n\t}\n\n\tprivate removeFocusTrap() {\n\t\tdocument.removeEventListener('focusin', this.handleFocusIn)\n\t}\n\n\tprivate handleFocusIn = (e: Event) => {\n\t\tif (!this.sheet?.contains(e.target as Node)) {\n\t\t\tthis.focus()\n\t\t}\n\t}\n\n\tsetIsSheetShown(isShown: boolean) {\n\t\tthis.sheet?.setAttribute('aria-hidden', String(!isShown))\n\t\tthis.sheet?.setAttribute('aria-modal', String(isShown))\n\t}\n\n\tcloseSheet() {\n\t\tthis.open = false\n\t\tthis.dispatchEvent(new CustomEvent('close'))\n\t}\n\n\tprivate getFocusElement(): HTMLElement | null {\n\t\tconst selector = `[${this.focusAttribute}]`\n\t\treturn (this.assignedElements.find(el => el.matches(selector) || el.querySelector(selector)) as HTMLElement) ?? null\n\t}\n\n\toverride focus() {\n\t\tthis.getFocusElement()?.focus()\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<schmancy-theme>\n\t\t\t\t<div class=\"sheet\" role=\"dialog\" aria-labelledby=\"sheet-title\" aria-hidden=\"true\" aria-modal=\"false\">\n\t\t\t\t\t<div class=\"overlay\" @click=${() => this.allowOverlayDismiss && sheet.dismiss(this.uid)}></div>\n\n\t\t\t\t\t<schmancy-sheet-content class=\"content\" data-position=${this.position}>\n\t\t\t\t\t\t<schmancy-sheet-header\n\t\t\t\t\t\t\t@dismiss=${(e: CustomEvent) => {\n\t\t\t\t\t\t\t\te.stopPropagation()\n\t\t\t\t\t\t\t\tsheet.dismiss(this.uid)\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tid=\"sheet-title\"\n\t\t\t\t\t\t\t.hidden=${this.header === 'hidden'}\n\t\t\t\t\t\t\ttitle=${this.title}\n\t\t\t\t\t\t></schmancy-sheet-header>\n\n\t\t\t\t\t\t<section class=\"content-body\">\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t</section>\n\t\t\t\t\t</schmancy-sheet-content>\n\t\t\t\t</div>\n\t\t\t</schmancy-theme>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet': SchmancySheet\n\t}\n}\n"],"names":["SchmancySheetHeader","TailwindElement","css","classes","absolute","this","title","length","relative","html","classMap","dispatchEvent","CustomEvent","bubbles","composed","hook","propName","options","protoOrDescriptor","name","willUpdate","Object","assign","waitUntilFirstUpdate","changedProps","call","has","oldValue","get","newValue","hasUpdated","__decorateClass","property","prototype","customElement","SchmancySheetContent","SchmancySheetPosition","SheetWhereAreYouRicky","SheetHereMorty","sheet","bottomSheet","Subject","$dismiss","pipe","switchMap","forkJoin","fromEvent","window","takeUntil","timer","map","e","detail","defaultIfEmpty","undefined","of","target","tap","uid","component","tagName","document","createElement","body","appendChild","setAttribute","position","allowOverlyDismiss","persist","header","style","overflow","delay","filter","shadowRoot","querySelector","assignedElements","find","take","subscribe","remove","mergeMap","closeSheet","next","SchmancySheet","$LitElement","super","arguments","open","Side","allowOverlayDismiss","focusAttribute","lastFocusedElement","handleFocusIn","contains","focus","_oldValue","setIsSheetShown","activeElement","addFocusTrap","removeFocusTrap","connectedCallback","setupEventListeners","disconnectedCallback","disconnecting","popState$","preventDefault","keyUp$","event","key","sheetContainsFocus","dismiss","rickyComm$","announcePresence","merge","addEventListener","removeEventListener","isShown","String","selector","el","matches","getFocusElement","stopPropagation","type","reflect","Boolean","query","queryAssignedElements","flatten"],"mappings":"icAKA,IAAqBA,EAArB,cAAiDC,EAAAA,gBAAgBC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAQhE,CAAA,CAAA,SACC,MAAMC,EAAU,CACfC,SAAUC,KAAKC,MAAMC,SAAW,EAChCC,SAAUH,K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AS,CAAE4F,KAAMN,OAAQO,QAAS,EAAA,CAAA,CAAA,EAPfzC,EAOuBnD,UAAA,QAAA,CAElBF,EAAAA,EAAA,CAAxBgG,EAAAA,MAAM,QAAA,CAAA,EATa3C,EASKnD,UAAA,QAAA,CACyBF,EAAAA,EAAA,CAAjDiG,wBAAsB,CAAEC,QAAAA,EAVL7C,CAAAA,CAAAA,EAAAA,EAU8BnD,UAAA,mBAAA,CAAA,EAEtCF,EAAA,CAAXC,EAASA,SAAAA,CAAAA,EAZUoD,EAYRnD,UAAA,iBAAA,CAIZF,EAAAA,EAAA,CADChB,EAAK,SAfcqE,EAgBpBnD,UAAA,eAAA,CAAA,EAhBoBmD,EAArBrD,EAAA,CADCG,EAAAA,cAAc,gBACMkD,CAAAA,EAAAA,CAAAA"}
1
+ {"version":3,"file":"sheet-VJBIc1zb.cjs","sources":["../src/sheet/header.ts","../src/sheet/hook.ts","../src/sheet/sheet-content.ts","../src/sheet/sheet.service.ts","../src/sheet/sheet.ts"],"sourcesContent":["import { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\n@customElement('schmancy-sheet-header')\nexport default class SchmancySheetHeader extends TailwindElement(css`\n\t:host {\n\t\tinset: 0;\n\t\tdisplay: block;\n\t\tpadding-bottom: 16px;\n\t}\n`) {\n\t@property() title: string\n\trender() {\n\t\tconst classes = {\n\t\t\tabsolute: this.title.length === 0,\n\t\t\trelative: this.title.length > 0,\n\t\t}\n\t\treturn html`\n\t\t\t<schmancy-grid class=\"${this.classMap(classes)}\" align=\"center\" justify=\"stretch\" cols=\"auto 1fr auto\">\n\t\t\t\t<slot name=\"back\">\n\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\t\t\tnew CustomEvent('dismiss', {\n\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span class=\"text-[24px]\">&#8592; </span>\n\t\t\t\t\t</schmancy-button>\n\t\t\t\t</slot>\n\t\t\t\t<schmancy-typography transform=\"capitalize\" type=\"headline\" token=\"lg\"> ${this.title} </schmancy-typography>\n\t\t\t\t<slot name=\"actions\">\n\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\t\t\tnew CustomEvent('dismiss', {\n\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span class=\"text-[24px]\">✕</span>\n\t\t\t\t\t</schmancy-button>\n\t\t\t\t</slot>\n\t\t\t</schmancy-grid>\n\t\t`\n\t}\n}\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet-header': SchmancySheetHeader\n\t}\n}\n","// @watch decorator\n//\n// Runs when an observed property changes, e.g. @property or @state, but before the component updates.\n//\n// To wait for an update to complete after a change occurs, use `await this.updateComplete` in the handler. To start\n// watching after the initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.\n//\n// Usage:\n//\n// @watch('propName')\n// handlePropChange(oldValue, newValue) {\n// ...\n// }\n//\ninterface WatchOptions {\n waitUntilFirstUpdate?: boolean\n}\n\nexport function hook(propName: string, options?: WatchOptions) {\n return (protoOrDescriptor: any, name: string): any => {\n const { willUpdate } = protoOrDescriptor\n\n options = Object.assign({ waitUntilFirstUpdate: false }, options) as WatchOptions\n\n protoOrDescriptor.willUpdate = function (changedProps: Map<string, any>) {\n willUpdate.call(this, changedProps)\n\n if (changedProps.has(propName)) {\n const oldValue = changedProps.get(propName)\n const newValue = this[propName]\n\n if (oldValue !== newValue) {\n if (!options?.waitUntilFirstUpdate || this.hasUpdated) {\n this[name].call(this, oldValue, newValue)\n }\n }\n }\n }\n }\n}\n","import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\n@customElement('schmancy-sheet-content')\nexport default class SchmancySheetContent extends TailwindElement() {\n\trender() {\n\t\treturn html`\n\t\t\t<div tabindex=\"0\">\n\t\t\t\t<slot></slot>\n\t\t\t</div>\n\t\t`\n\t}\n}\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet-content': SchmancySheetContent\n\t}\n}\n","import {\n\tdefaultIfEmpty,\n\tdelay,\n\tfilter,\n\tforkJoin,\n\tfromEvent,\n\tmap,\n\tmergeMap,\n\tof,\n\tSubject,\n\tswitchMap,\n\ttake,\n\ttakeUntil,\n\ttap,\n\ttimer,\n} from 'rxjs'\nimport SchmancySheet from './sheet'\n\nexport enum SchmancySheetPosition {\n\tSide = 'side',\n\tBottom = 'bottom',\n\t/**\n\t * @deprecated use bottom instead\n\t */\n\tBottomCenter = 'bottom-center',\n\t/**\n\t * @deprecated use side instead\n\t */\n\tTopRight = 'top-right',\n\t/**\n\t * @deprecated use side instead\n\t */\n\tBottomRight = 'bottom-right',\n}\n\ntype BottomSheeetTarget = {\n\tcomponent: HTMLElement\n\tuid?: string\n\tposition?: SchmancySheetPosition\n\tpersist?: boolean\n\tclose?: () => void\n\tallowOverlyDismiss?: boolean\n\ttitle?: string\n\theader?: 'hidden' | 'visible'\n}\n\n// Events for communication between bottom-sheet component and bottom-sheet.service\nexport type SheetWhereAreYouRickyEvent = CustomEvent<{\n\tuid: string\n}>\nexport const SheetWhereAreYouRicky = 'are-you-there-sheet'\n\nexport type SheetHereMortyEvent = CustomEvent<{\n\tsheet: SchmancySheet\n}>\nexport const SheetHereMorty = 'yes-here'\nclass BottomSheetService {\n\tbottomSheet = new Subject<BottomSheeetTarget>()\n\t$dismiss = new Subject<string>()\n\tconstructor() {\n\t\tthis.bottomSheet\n\t\t\t.pipe(\n\t\t\t\tswitchMap(target =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<SheetHereMortyEvent>(window, SheetHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(0)),\n\t\t\t\t\t\t\tmap(e => e.detail.sheet),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(target).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(SheetWhereAreYouRicky, {\n\t\t\t\t\t\t\t\t\t\tdetail: { uid: target.uid ?? target.component.tagName },\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\tmap(([sheet, target]) => {\n\t\t\t\t\tconsole.log(sheet, target)\n\t\t\t\t\tif (!sheet) {\n\t\t\t\t\t\t// if sheet is not found, create it\n\t\t\t\t\t\tsheet = document.createElement('schmancy-sheet')\n\t\t\t\t\t\tdocument.body.appendChild(sheet)\n\t\t\t\t\t}\n\t\t\t\t\tsheet.setAttribute('uid', target.uid ?? target.component.tagName)\n\t\t\t\t\tsheet.setAttribute('position', target.position ?? SchmancySheetPosition.Bottom)\n\t\t\t\t\tsheet.setAttribute('allowOverlyDismiss', target.allowOverlyDismiss === false ? 'false' : 'true')\n\t\t\t\t\ttarget.title && sheet.setAttribute('title', target.title)\n\t\t\t\t\ttarget.persist && sheet.setAttribute('persist', target.persist ?? false)\n\t\t\t\t\ttarget.header && sheet.setAttribute('header', target.header)\n\t\t\t\t\tdocument.body.style.overflow = 'hidden' // lock the scroll of the host\n\t\t\t\t\treturn { target, sheet }\n\t\t\t\t}),\n\t\t\t\tdelay(20),\n\t\t\t\tfilter(({ target, sheet }) => {\n\t\t\t\t\t// if the sheet has already the component, just show it\n\t\t\t\t\tif (\n\t\t\t\t\t\ttarget.persist &&\n\t\t\t\t\t\tsheet?.shadowRoot\n\t\t\t\t\t\t\t?.querySelector('slot')\n\t\t\t\t\t\t\t?.assignedElements()\n\t\t\t\t\t\t\t.find(e => e.tagName === target.component.tagName)\n\t\t\t\t\t) {\n\t\t\t\t\t\tsheet?.setAttribute('open', 'true')\n\t\t\t\t\t\treturn false\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn true // if the sheet does not have the component, continue to the next step\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttap(({ target, sheet }) => {\n\t\t\t\t\tsheet?.appendChild(target.component)\n\t\t\t\t}),\n\t\t\t\tdelay(1),\n\t\t\t\ttap(({ sheet }) => {\n\t\t\t\t\tsheet?.setAttribute('open', 'true')\n\t\t\t\t}),\n\t\t\t\ttap(({ sheet }) => {\n\t\t\t\t\tfromEvent<CustomEvent>(sheet, 'close')\n\t\t\t\t\t\t.pipe(take(1))\n\t\t\t\t\t\t.pipe(delay(300))\n\t\t\t\t\t\t.subscribe(e => {\n\t\t\t\t\t\t\tconst target = e.target as SchmancySheet\n\t\t\t\t\t\t\tconsole.log(target)\n\n\t\t\t\t\t\t\tif (!target?.persist) target?.remove()\n\t\t\t\t\t\t\tdocument.body.style.overflow = 'auto' // unlock the scroll of the host\n\t\t\t\t\t\t})\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\n\t\tthis.$dismiss\n\t\t\t.pipe(\n\t\t\t\tmergeMap(uid =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<SheetHereMortyEvent>(window, SheetHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)), // Some people say why 10? I say why not?\n\t\t\t\t\t\t\tmap(e => e.detail.sheet),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(uid).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new CustomEvent(SheetWhereAreYouRicky, { detail: { uid } }))\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\ttap(([sheet]) => {\n\t\t\t\t\tsheet?.closeSheet()\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\tdismiss(uid: string) {\n\t\tthis.$dismiss.next(uid)\n\t}\n\n\topen(target: BottomSheeetTarget) {\n\t\tthis.bottomSheet.next(target)\n\t}\n}\nexport const sheet = new BottomSheetService()\n","import { $LitElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, property, query, queryAssignedElements } from 'lit/decorators.js'\nimport { fromEvent, merge, takeUntil, tap } from 'rxjs'\nimport { hook } from './hook'\nimport style from './sheet.scss?inline'\nimport {\n\tSchmancySheetPosition,\n\tSheetHereMorty,\n\tSheetWhereAreYouRicky,\n\tSheetWhereAreYouRickyEvent,\n\tsheet,\n} from './sheet.service'\n\n@customElement('schmancy-sheet')\nexport default class SchmancySheet extends $LitElement(style) {\n\t@property({ type: String, reflect: true }) uid!: string\n\t@property({ type: Boolean, reflect: true }) open = false\n\t@property({ type: String, reflect: true }) header: 'hidden' | 'visible' = 'visible'\n\t@property({ type: String, reflect: true }) position: SchmancySheetPosition = SchmancySheetPosition.Side\n\t@property({ type: Boolean, reflect: true }) persist = false\n\t@property({ type: Boolean, reflect: true }) allowOverlayDismiss = true\n\t@property({ type: String, reflect: true }) title = ''\n\n\t@query('.sheet') private sheet!: HTMLElement\n\t@queryAssignedElements({ flatten: true }) private assignedElements!: HTMLElement[]\n\n\t@property() focusAttribute = 'autofocus'\n\tprivate lastFocusedElement: HTMLElement | null = null\n\n\t@hook('open')\n\tonOpenChange(_oldValue: boolean, newValue: boolean) {\n\t\tthis.setIsSheetShown(newValue)\n\n\t\tif (newValue) {\n\t\t\tthis.lastFocusedElement = document.activeElement as HTMLElement\n\t\t\tthis.addFocusTrap()\n\t\t\tthis.focus()\n\t\t} else {\n\t\t\tthis.removeFocusTrap()\n\t\t\tthis.lastFocusedElement?.focus()\n\t\t\tthis.lastFocusedElement = null\n\t\t}\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tthis.setupEventListeners()\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis.disconnecting.next(true)\n\t}\n\n\tprivate setupEventListeners() {\n\t\t// Handle browser back button\n\t\tconst popState$ = fromEvent<PopStateEvent>(window, 'popstate').pipe(\n\t\t\ttap(e => {\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.closeSheet()\n\t\t\t}),\n\t\t)\n\n\t\t// Handle ESC key\n\t\tconst keyUp$ = fromEvent<KeyboardEvent>(window, 'keyup').pipe(\n\t\t\ttap(event => {\n\t\t\t\tif (event.key === 'Escape' && !this.sheetContainsFocus()) {\n\t\t\t\t\tsheet.dismiss(this.uid)\n\t\t\t\t}\n\t\t\t}),\n\t\t)\n\n\t\t// Handle inter-component communication\n\t\tconst rickyComm$ = fromEvent<SheetWhereAreYouRickyEvent>(window, SheetWhereAreYouRicky).pipe(\n\t\t\ttap(e => {\n\t\t\t\tif (e.detail.uid === this.uid) this.announcePresence()\n\t\t\t}),\n\t\t)\n\n\t\tmerge(popState$, keyUp$, rickyComm$).pipe(takeUntil(this.disconnecting)).subscribe()\n\t}\n\n\tprivate sheetContainsFocus(): boolean {\n\t\treturn this.sheet?.contains(document.activeElement) ?? false\n\t}\n\n\tprivate announcePresence() {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(SheetHereMorty, {\n\t\t\t\tdetail: { sheet: this },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\tprivate addFocusTrap() {\n\t\tdocument.addEventListener('focusin', this.handleFocusIn)\n\t}\n\n\tprivate removeFocusTrap() {\n\t\tdocument.removeEventListener('focusin', this.handleFocusIn)\n\t}\n\n\tprivate handleFocusIn = (e: Event) => {\n\t\tif (!this.sheet?.contains(e.target as Node)) {\n\t\t\tthis.focus()\n\t\t}\n\t}\n\n\tsetIsSheetShown(isShown: boolean) {\n\t\tthis.sheet?.setAttribute('aria-hidden', String(!isShown))\n\t\tthis.sheet?.setAttribute('aria-modal', String(isShown))\n\t}\n\n\tcloseSheet() {\n\t\tthis.open = false\n\t\tthis.dispatchEvent(new CustomEvent('close'))\n\t}\n\n\tprivate getFocusElement(): HTMLElement | null {\n\t\tconst selector = `[${this.focusAttribute}]`\n\t\treturn (this.assignedElements.find(el => el.matches(selector) || el.querySelector(selector)) as HTMLElement) ?? null\n\t}\n\n\toverride focus() {\n\t\tthis.getFocusElement()?.focus()\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<schmancy-theme>\n\t\t\t\t<div class=\"sheet\" role=\"dialog\" aria-labelledby=\"sheet-title\" aria-hidden=\"true\" aria-modal=\"false\">\n\t\t\t\t\t<div class=\"overlay\" @click=${() => this.allowOverlayDismiss && sheet.dismiss(this.uid)}></div>\n\n\t\t\t\t\t<schmancy-scroll\n\t\t\t\t\t\t><schmancy-sheet-content class=\"content\" data-position=${this.position}>\n\t\t\t\t\t\t\t<schmancy-sheet-header\n\t\t\t\t\t\t\t\t@dismiss=${(e: CustomEvent) => {\n\t\t\t\t\t\t\t\t\te.stopPropagation()\n\t\t\t\t\t\t\t\t\tsheet.dismiss(this.uid)\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tid=\"sheet-title\"\n\t\t\t\t\t\t\t\t.hidden=${this.header === 'hidden'}\n\t\t\t\t\t\t\t\ttitle=${this.title}\n\t\t\t\t\t\t\t></schmancy-sheet-header>\n\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t</schmancy-sheet-content>\n\t\t\t\t\t</schmancy-scroll>\n\t\t\t\t</div>\n\t\t\t</schmancy-theme>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet': SchmancySheet\n\t}\n}\n"],"names":["SchmancySheetHeader","TailwindElement","css","classes","absolute","this","title","length","relative","html","classMap","dispatchEvent","CustomEvent","bubbles","composed","hook","propName","options","protoOrDescriptor","name","willUpdate","Object","assign","waitUntilFirstUpdate","changedProps","call","has","oldValue","get","newValue","hasUpdated","__decorateClass","property","prototype","customElement","SchmancySheetContent","SchmancySheetPosition","SheetWhereAreYouRicky","SheetHereMorty","sheet","bottomSheet","Subject","$dismiss","pipe","switchMap","forkJoin","fromEvent","window","takeUntil","timer","map","e","detail","defaultIfEmpty","undefined","of","target","tap","uid","component","tagName","document","createElement","body","appendChild","setAttribute","position","allowOverlyDismiss","persist","header","style","overflow","delay","filter","shadowRoot","querySelector","assignedElements","find","take","subscribe","remove","mergeMap","closeSheet","next","SchmancySheet","$LitElement","super","arguments","open","Side","allowOverlayDismiss","focusAttribute","lastFocusedElement","handleFocusIn","contains","focus","_oldValue","setIsSheetShown","activeElement","addFocusTrap","removeFocusTrap","connectedCallback","setupEventListeners","disconnectedCallback","disconnecting","popState$","preventDefault","keyUp$","event","key","sheetContainsFocus","dismiss","rickyComm$","announcePresence","merge","addEventListener","removeEventListener","isShown","String","selector","el","matches","getFocusElement","stopPropagation","type","reflect","Boolean","query","queryAssignedElements","flatten"],"mappings":"icAKA,IAAqBA,EAArB,cAAiDC,EAAAA,gBAAgBC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAQhE,CAAA,CAAA,SACC,MAAMC,EAAU,CACfC,SAAUC,KAAKC,MAAMC,SAAW,EAChCC,SAAUH,KAAKC,MAAMC,OAAS,CAExB,EAAA,OAAAE,EAAAA;AAAAA,2BACkBJ,KAAKK,SAASP,CAAAA,CAAAA;AAAAA;AAAAA;AAAAA,eAG1B,IACHE,CAAAA,KAAAM,cACJ,IAAIC,YAAY,UAAW,CAC1BC,QAAAA,GACAC,SAAAA,EAEF,CAAA,CAAA,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AAA,EAVL7C,CAAAA,CAAAA,EAAAA,EAU8BnD,UAAA,mBAAA,CAAA,EAEtCF,EAAA,CAAXC,EAASA,SAAAA,CAAAA,EAZUoD,EAYRnD,UAAA,iBAAA,CAIZF,EAAAA,EAAA,CADChB,EAAK,SAfcqE,EAgBpBnD,UAAA,eAAA,CAAA,EAhBoBmD,EAArBrD,EAAA,CADCG,EAAAA,cAAc,gBACMkD,CAAAA,EAAAA,CAAAA"}
package/dist/sheet.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./sheet-CUTDrhww.cjs");exports.SchmancySheetPosition=e.SchmancySheetPosition,exports.SheetHereMorty=e.SheetHereMorty,exports.SheetWhereAreYouRicky=e.SheetWhereAreYouRicky,exports.hook=e.hook,exports.sheet=e.sheet;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./sheet-VJBIc1zb.cjs");exports.SchmancySheetPosition=e.SchmancySheetPosition,exports.SheetHereMorty=e.SheetHereMorty,exports.SheetWhereAreYouRicky=e.SheetWhereAreYouRicky,exports.hook=e.hook,exports.sheet=e.sheet;
2
2
  //# sourceMappingURL=sheet.cjs.map
package/dist/sheet.js CHANGED
@@ -1,4 +1,4 @@
1
- import { S as o, b as s, a, h as t, s as r } from "./sheet-DQxsDc4a.js";
1
+ import { S as o, b as s, a, h as t, s as r } from "./sheet-D8-zxp3n.js";
2
2
  export {
3
3
  o as SchmancySheetPosition,
4
4
  s as SheetHereMorty,
package/dist/teleport.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./teleport.component-DeXpYHXV.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-90QAnife.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
@@ -1,4 +1,4 @@
1
- "use strict";const h=require("lit"),c=require("lit/decorators.js"),n=require("rxjs");require("./animated-text-VuDSGmJu.cjs");const q=require("./area.component-qqTF9Cwv.cjs");require("./autocomplete-B0fc_Nh_.cjs"),require("./spinner-vK7ZLqSI.cjs"),require("./icon-button-BnakhpuT.cjs"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const S=require("./tailwind.mixin-bRVZL2lY.cjs"),O=require("./theme.interface-Xg5Zi46a.cjs");require("./checkbox-CFRY_WA9.cjs"),require("./chips-DK1t1fX8.cjs"),require("./payment-card-form-DT2MgPCZ.cjs");const d=require("./types.cjs"),l=require("./provide-_VUNOf1R.cjs"),u=require("./litElement.mixin-BGFFSTo6.cjs"),p=require("./consume-Di0U0iBU.cjs");require("./date-range-ojNc9Onw.cjs"),require("./delay-BdpZfHDc.cjs");const b=require("./ripple-C2BHbhcS.cjs");require("./divider-_i9O2PBo.cjs"),require("./form-CqnEVlhB.cjs"),require("./icon-CpZBVkRH.cjs"),require("./input-B2rV3JCi.cjs"),require("./scroll-CD1V-q-_.cjs"),require("./list-DOnYlCys.cjs"),require("./menu-BZyh3Omd.cjs");const z=require("lit/directives/when.js");require("./outlet-B1D2BYCl.cjs"),require("./option-DC1BiTB1.cjs"),require("./radio-group-WV66V12S.cjs"),require("./index-DyJ0oDpR.cjs"),require("./select-BP6OE_lC.cjs");const I=require("./sheet-CUTDrhww.cjs");require("./slider-BEGG7odV.cjs"),require("./surface-pByMeeQt.cjs"),require("./table-DduFFvUh.cjs"),require("./tabs-group-BBByN_wj.cjs"),require("./textarea-DnIefaLe.cjs"),require("./theme.component-CbQ3s3hX.cjs"),require("./theme-button-B0kxPZka.cjs"),require("./tree-BKd26LdC.cjs"),require("./typewriter-jklG56Kf.cjs"),require("./typography-D5hY_euh.cjs");const j=require("rxjs/operators");var B=Object.defineProperty,Y=Object.getOwnPropertyDescriptor;let X=class extends S.TailwindElement(h.css`
1
+ "use strict";const h=require("lit"),c=require("lit/decorators.js"),n=require("rxjs");require("./animated-text-VuDSGmJu.cjs");const q=require("./area.component-qqTF9Cwv.cjs");require("./autocomplete-B0fc_Nh_.cjs"),require("./spinner-vK7ZLqSI.cjs"),require("./icon-button-BnakhpuT.cjs"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const S=require("./tailwind.mixin-bRVZL2lY.cjs"),O=require("./theme.interface-Xg5Zi46a.cjs");require("./checkbox-CFRY_WA9.cjs"),require("./chips-DK1t1fX8.cjs"),require("./payment-card-form-DT2MgPCZ.cjs");const d=require("./types.cjs"),l=require("./provide-_VUNOf1R.cjs"),u=require("./litElement.mixin-BGFFSTo6.cjs"),p=require("./consume-Di0U0iBU.cjs");require("./date-range-ojNc9Onw.cjs"),require("./delay-BdpZfHDc.cjs");const b=require("./ripple-C2BHbhcS.cjs");require("./divider-_i9O2PBo.cjs"),require("./form-CqnEVlhB.cjs"),require("./icon-CpZBVkRH.cjs"),require("./input-B2rV3JCi.cjs"),require("./scroll-CD1V-q-_.cjs"),require("./list-DOnYlCys.cjs"),require("./menu-BZyh3Omd.cjs");const z=require("lit/directives/when.js");require("./outlet-B1D2BYCl.cjs"),require("./option-DC1BiTB1.cjs"),require("./radio-group-WV66V12S.cjs"),require("./index-DyJ0oDpR.cjs"),require("./select-BP6OE_lC.cjs");const I=require("./sheet-VJBIc1zb.cjs");require("./slider-BEGG7odV.cjs"),require("./surface-pByMeeQt.cjs"),require("./table-DduFFvUh.cjs"),require("./tabs-group-BBByN_wj.cjs"),require("./textarea-DnIefaLe.cjs"),require("./theme.component-CbQ3s3hX.cjs"),require("./theme-button-B0kxPZka.cjs"),require("./tree-BKd26LdC.cjs"),require("./typewriter-jklG56Kf.cjs"),require("./typography-D5hY_euh.cjs");const j=require("rxjs/operators");var B=Object.defineProperty,Y=Object.getOwnPropertyDescriptor;let X=class extends S.TailwindElement(h.css`
2
2
  :host {
3
3
  display: block;
4
4
  }
@@ -141,4 +141,4 @@
141
141
  class="${this.classMap({"fixed inset-0 z-49 hidden":!0})}"
142
142
  ></div>
143
143
  `}},w([p.c({context:N,subscribe:!0}),c.state()],exports.SchmancyNavigationDrawerSidebar.prototype,"mode",2),w([p.c({context:W,subscribe:!0}),c.state()],exports.SchmancyNavigationDrawerSidebar.prototype,"state",2),w([c.query("#overlay")],exports.SchmancyNavigationDrawerSidebar.prototype,"overlay",2),w([c.query("nav")],exports.SchmancyNavigationDrawerSidebar.prototype,"nav",2),w([c.property({type:String})],exports.SchmancyNavigationDrawerSidebar.prototype,"width",2),exports.SchmancyNavigationDrawerSidebar=w([c.customElement("schmancy-nav-drawer-navbar")],exports.SchmancyNavigationDrawerSidebar);const U="whereAreYouRicky",H="hereMorty",f=new class{constructor(){this.activeTeleportations=new Map,this.flipRequests=new n.Subject,this.find=e=>n.zip([n.fromEvent(window,H).pipe(n.filter(t=>!!t.detail.component.uuid&&!!e.id&&t.detail.component.id===e.id&&t.detail.component.uuid!==e.uuid),n.map(t=>t.detail.component),n.take(1)),n.of(e).pipe(n.tap(()=>{window.dispatchEvent(new CustomEvent(U,{detail:{id:e.id,callerID:e.uuid}}))}))]).pipe(n.map(([t])=>t),n.timeout(0)),this.flip=e=>{const{from:t,to:s}=e,i=s.element.style.zIndex;s.element.style.transformOrigin="top left",s.element.style.setProperty("visibility","visible"),s.element.style.zIndex="1000";const a=[{transform:`translate(${t.rect.left-s.rect.left}px, ${t.rect.top-s.rect.top}px) scale(${t.rect.width/s.rect.width}, ${t.rect.height/s.rect.height})`},{transform:"translate(0, 0) scale(1, 1)"}];s.element.animate(a,{duration:250,delay:10,easing:"cubic-bezier(0.455, 0.03, 0.515, 0.955)"}).onfinish=()=>{s.element.style.zIndex=i,s.element.style.transformOrigin=""}},this.flipRequests.pipe(n.bufferTime(1),n.map(e=>e.map(({from:t,to:s,host:i},a)=>({from:t,to:s,host:i,i:a}))),n.concatMap(e=>n.zip(e.map(t=>n.of(this.flip(t)))))).subscribe()}};function L(e){return n.interval(50).pipe(j.map(()=>e.getBoundingClientRect()),j.distinctUntilChanged((t,s)=>t.width===s.width&&t.height===s.height&&t.top===s.top&&t.right===s.right&&t.bottom===s.bottom&&t.left===s.left),j.take(1))}var ue=Object.defineProperty,we=Object.getOwnPropertyDescriptor,x=(e,t,s,i)=>{for(var a,r=i>1?void 0:i?we(t,s):t,o=e.length-1;o>=0;o--)(a=e[o])&&(r=(i?a(t,s,r):a(r))||r);return i&&r&&ue(t,s,r),r};exports.SchmancyTeleportation=class extends u.$LitElement(h.css``){constructor(){super(...arguments),this.uuid=Math.floor(Math.random()*Date.now()),this.delay=0,this.debugging=!1}get _slottedChildren(){return this.shadowRoot.querySelector("slot").assignedElements({flatten:!0})}connectedCallback(){if(this.id===void 0)throw new Error("id is required");super.connectedCallback(),n.merge(n.fromEvent(window,q.FINDING_MORTIES).pipe(n.tap({next:()=>{this.dispatchEvent(new CustomEvent(q.HERE_RICKY,{detail:{component:this},bubbles:!0,composed:!0}))}})),n.fromEvent(window,U).pipe(n.tap({next:e=>{e.detail.id===this.id&&this.uuid&&e.detail.callerID!==this.uuid&&this.dispatchEvent(new CustomEvent(H,{detail:{component:this},bubbles:!0,composed:!0}))}}))).pipe(n.takeUntil(this.disconnecting)).subscribe()}async firstUpdated(){n.of(f.activeTeleportations.get(this.id)).pipe(n.filter(e=>!!e),n.takeUntil(this.disconnecting),n.throwIfEmpty()).subscribe({next:e=>{this.style.setProperty("visibility","hidden"),L(this).pipe(n.takeUntil(this.disconnecting)).subscribe({next:t=>{f.activeTeleportations.set(this.id,t),f.flipRequests.next({from:{rect:e},to:{rect:t,element:this._slottedChildren[0]},host:this})}})},error:()=>{this.style.setProperty("visibility","visible"),L(this).pipe(n.takeUntil(this.disconnecting)).subscribe({next:e=>{f.activeTeleportations.set(this.id,e)}})},complete:()=>{}})}render(){return h.html`<slot></slot>`}},x([c.property({type:Number,reflect:!0})],exports.SchmancyTeleportation.prototype,"uuid",2),x([c.property({type:String})],exports.SchmancyTeleportation.prototype,"id",2),x([c.property({type:Number})],exports.SchmancyTeleportation.prototype,"delay",2),exports.SchmancyTeleportation=x([c.customElement("schmancy-teleport")],exports.SchmancyTeleportation),exports.HereMorty=H,exports.SchmancyContentDrawerID=R,exports.SchmancyContentDrawerMaxHeight=M,exports.SchmancyContentDrawerMinWidth=k,exports.SchmancyContentDrawerSheetMode=$,exports.SchmancyContentDrawerSheetState=A,exports.SchmancyDrawerNavbarMode=N,exports.SchmancyDrawerNavbarState=W,exports.WhereAreYouRicky=U,exports.schmancyContentDrawer=Z,exports.schmancyNavDrawer=ae,exports.teleport=f;
144
- //# sourceMappingURL=teleport.component-DeXpYHXV.cjs.map
144
+ //# sourceMappingURL=teleport.component-90QAnife.cjs.map