@mhmo91/schmancy 0.2.26 → 0.2.27
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 +1 -1
- package/dist/card.js +1 -1
- package/dist/content-drawer.cjs +1 -1
- package/dist/content-drawer.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +24 -25
- package/dist/nav-drawer.cjs +1 -1
- package/dist/nav-drawer.js +1 -1
- package/dist/sheet-B7UZL0S4.cjs +45 -0
- package/dist/sheet-B7UZL0S4.cjs.map +1 -0
- package/dist/{sheet-Dt3siMhI.js → sheet-Qm3DILOR.js} +65 -79
- package/dist/sheet-Qm3DILOR.js.map +1 -0
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.js +5 -6
- package/dist/teleport.cjs +1 -1
- package/dist/{teleport.component--U4504z0.cjs → teleport.component-BXIGP3Vs.cjs} +2 -2
- package/dist/{teleport.component--U4504z0.cjs.map → teleport.component-BXIGP3Vs.cjs.map} +1 -1
- package/dist/{teleport.component-DW6Kqmit.js → teleport.component-Cn1e_GQp.js} +2 -2
- package/dist/{teleport.component-DW6Kqmit.js.map → teleport.component-Cn1e_GQp.js.map} +1 -1
- package/dist/teleport.js +1 -1
- package/package.json +1 -1
- package/types/src/sheet/hook.d.ts +1 -1
- package/types/src/sheet/index.d.ts +0 -2
- package/dist/sheet-DOtLsAs_.cjs +0 -46
- package/dist/sheet-DOtLsAs_.cjs.map +0 -1
- package/dist/sheet-Dt3siMhI.js.map +0 -1
package/dist/card.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";require("./teleport.component
|
|
1
|
+
"use strict";require("./teleport.component-BXIGP3Vs.cjs");
|
|
2
2
|
//# sourceMappingURL=card.cjs.map
|
package/dist/card.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "./teleport.component-
|
|
1
|
+
import "./teleport.component-Cn1e_GQp.js";
|
|
2
2
|
//# sourceMappingURL=card.js.map
|
package/dist/content-drawer.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./teleport.component
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./teleport.component-BXIGP3Vs.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
|
package/dist/content-drawer.js
CHANGED
|
@@ -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-
|
|
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-Cn1e_GQp.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-C5zM-91H.cjs");const r=require("./area.component-DCLLi1YA.cjs");require("./autocomplete-Dfq-Rhjy.cjs"),require("./spinner-8GhT-bLm.cjs");const o=require("./icon-button-DHiO0w8J.cjs"),e=require("./teleport.component
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("./animated-text-C5zM-91H.cjs");const r=require("./area.component-DCLLi1YA.cjs");require("./autocomplete-Dfq-Rhjy.cjs"),require("./spinner-8GhT-bLm.cjs");const o=require("./icon-button-DHiO0w8J.cjs"),e=require("./teleport.component-BXIGP3Vs.cjs"),S=require("./checkbox-BdsGj_z6.cjs");require("./chips-Z8e_rQtM.cjs");const u=require("./payment-card-form-B7tV2ttW.cjs");require("./date-range-CDX0VlcK.cjs");const y=require("./delay-DsFVHHw2.cjs"),n=require("./ripple-C2BHbhcS.cjs");require("./divider-CjgOM462.cjs"),require("./form-DyYGOlOR.cjs"),require("./icon-DPN7kWO0.cjs"),require("./input-2kqgsr0S.cjs");const c=require("./scroll-DnAxN1uS.cjs"),m=require("./list-Cq9RDYF_.cjs");require("./menu-ifiBMg-F.cjs");const a=require("./outlet-u1_Qa8Li.cjs");require("./option-DOBWmGE5.cjs");const b=require("./radio-group-m5Swl5cq.cjs"),l=require("./rxjs-utils.cjs");require("rxjs"),require("./index-DyJ0oDpR.cjs"),require("./select-Bzf5TEob.cjs");const t=require("./sheet-B7UZL0S4.cjs"),h=require("./slider-ds6hnN7n.cjs"),d=require("./surface-BzSJT7y7.cjs");require("./table-BDIhXdSA.cjs"),require("./tabs-group-CHAAr7Wl.cjs"),require("./textarea-CJhi4hDu.cjs");const i=require("./theme.component-Dhm3MpVW.cjs"),p=require("./theme.interface-Xg5Zi46a.cjs");require("./theme-button-DoIFEVSv.cjs");const g=require("./tree-BkhYPaz6.cjs"),f=require("./types.cjs"),q=require("./typewriter-DGIW1V_b.cjs"),D=require("./typography-DQHpwRFR.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.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-BrPf
|
|
|
3
3
|
import "./autocomplete-CcDfKbfJ.js";
|
|
4
4
|
import "./spinner-zxOxMm7j.js";
|
|
5
5
|
import { S as v, a as I } from "./icon-button-CbEs8eyS.js";
|
|
6
|
-
import { H as g, e as E, b as
|
|
6
|
+
import { H as g, e as E, b as A, f as Y, c as k, d as F, g as G, S as O, a as W, i as 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-Cn1e_GQp.js";
|
|
7
7
|
import { S as V } from "./checkbox-DV8tPYX0.js";
|
|
8
8
|
import "./chips-Ca-SY6mg.js";
|
|
9
9
|
import { S as Z } from "./payment-card-form-CTZsSGOB.js";
|
|
@@ -24,19 +24,19 @@ import { mutationObserver as Ta } from "./rxjs-utils.js";
|
|
|
24
24
|
import "rxjs";
|
|
25
25
|
import "./index-CuY8m6ta.js";
|
|
26
26
|
import "./select-CR2mQf_Q.js";
|
|
27
|
-
import { S as ua, b as Na, a as Ha,
|
|
28
|
-
import { S as
|
|
29
|
-
import { S as
|
|
27
|
+
import { S as ua, b as Na, a as Ha, s as Ra } from "./sheet-Qm3DILOR.js";
|
|
28
|
+
import { S as Ia, a as Ma } from "./slider-FTwWTvKi.js";
|
|
29
|
+
import { S as Ea } from "./surface-DdbqvBbW.js";
|
|
30
30
|
import "./table-6bRKgCJ9.js";
|
|
31
31
|
import "./tabs-group-DBybIi8n.js";
|
|
32
32
|
import "./textarea-BchwVUAo.js";
|
|
33
|
-
import { S as Ya, f as
|
|
34
|
-
import { S as
|
|
33
|
+
import { S as Ya, f as ka, t as Fa } from "./theme.component-DwZx0sdk.js";
|
|
34
|
+
import { S as Oa } from "./theme.interface-C5Kj6WjD.js";
|
|
35
35
|
import "./theme-button-dxTV0k03.js";
|
|
36
|
-
import { S as
|
|
37
|
-
import { SchmancyEvents as
|
|
38
|
-
import { T as
|
|
39
|
-
import { S as
|
|
36
|
+
import { S as La } from "./tree-C7GnGCWU.js";
|
|
37
|
+
import { SchmancyEvents as Ba } from "./types.js";
|
|
38
|
+
import { T as $a } from "./typewriter-DfOKVMWh.js";
|
|
39
|
+
import { S as Ka } from "./typography-En0tk2d5.js";
|
|
40
40
|
export {
|
|
41
41
|
xa as $notify,
|
|
42
42
|
d as FINDING_MORTIES,
|
|
@@ -48,9 +48,9 @@ export {
|
|
|
48
48
|
u as SchmancyArea,
|
|
49
49
|
V as SchmancyCheckbox,
|
|
50
50
|
E as SchmancyContentDrawer,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
A as SchmancyContentDrawerID,
|
|
52
|
+
Y as SchmancyContentDrawerMain,
|
|
53
|
+
k as SchmancyContentDrawerMaxHeight,
|
|
54
54
|
F as SchmancyContentDrawerMinWidth,
|
|
55
55
|
G as SchmancyContentDrawerSheet,
|
|
56
56
|
O as SchmancyContentDrawerSheetMode,
|
|
@@ -59,7 +59,7 @@ export {
|
|
|
59
59
|
L as SchmancyDrawerAppbar,
|
|
60
60
|
_ as SchmancyDrawerNavbarMode,
|
|
61
61
|
B as SchmancyDrawerNavbarState,
|
|
62
|
-
|
|
62
|
+
Ba as SchmancyEvents,
|
|
63
63
|
sa as SchmancyFlex,
|
|
64
64
|
Sa as SchmancyGrid,
|
|
65
65
|
pa as SchmancyListItem,
|
|
@@ -71,33 +71,32 @@ export {
|
|
|
71
71
|
Z as SchmancyPaymentCardForm,
|
|
72
72
|
ha as SchmancyScroll,
|
|
73
73
|
ua as SchmancySheetPosition,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
Ia as SchmancySlide,
|
|
75
|
+
Ma as SchmancySlider,
|
|
76
|
+
Ea as SchmancySurface,
|
|
77
77
|
K as SchmancyTeleportation,
|
|
78
|
-
|
|
78
|
+
Oa as SchmancyTheme,
|
|
79
79
|
Ya as SchmancyThemeComponent,
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
La as SchmancyTree,
|
|
81
|
+
Ka as SchmancyTypography,
|
|
82
82
|
v as SchmnacyButton,
|
|
83
83
|
I as SchmnacyIconButton,
|
|
84
84
|
Na as SheetHereMorty,
|
|
85
85
|
Ha as SheetWhereAreYouRicky,
|
|
86
|
-
|
|
86
|
+
$a as TypewriterElement,
|
|
87
87
|
q as WhereAreYouRicky,
|
|
88
88
|
N as area,
|
|
89
89
|
oa as color,
|
|
90
90
|
ea as delayContext,
|
|
91
|
-
|
|
91
|
+
ka as formateTheme,
|
|
92
92
|
ma as fullHeight,
|
|
93
|
-
Ra as hook,
|
|
94
93
|
Ta as mutationObserver,
|
|
95
94
|
ca as ripple,
|
|
96
95
|
H as routerHistory,
|
|
97
96
|
z as schmancyContentDrawer,
|
|
98
97
|
J as schmancyNavDrawer,
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
Ra as sheet,
|
|
99
|
+
Fa as tailwindStyles,
|
|
101
100
|
Q as teleport
|
|
102
101
|
};
|
|
103
102
|
//# sourceMappingURL=index.js.map
|
package/dist/nav-drawer.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./teleport.component
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./teleport.component-BXIGP3Vs.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
|
package/dist/nav-drawer.js
CHANGED
|
@@ -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-
|
|
1
|
+
import { i as c, k as n, l as e, m, j as h, n as i, h as s } from "./teleport.component-Cn1e_GQp.js";
|
|
2
2
|
export {
|
|
3
3
|
c as SchmancyDrawerAppbar,
|
|
4
4
|
n as SchmancyDrawerNavbarMode,
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";const s=require("rxjs");require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const w=require("./tailwind.mixin-_mD_GeAp.cjs"),v=require("lit"),r=require("lit/decorators.js"),E=require("./litElement.mixin-DWxwPXWQ.cjs");var S=Object.defineProperty,k=Object.getOwnPropertyDescriptor,g=(t,e,i,o)=>{for(var c,n=o>1?void 0:o?k(e,i):e,l=t.length-1;l>=0;l--)(c=t[l])&&(n=(o?c(e,i,n):c(n))||n);return o&&n&&S(e,i,n),n};let b=class extends w.TailwindElement(v.css`
|
|
2
|
+
:host {
|
|
3
|
+
inset: 0;
|
|
4
|
+
display: block;
|
|
5
|
+
padding-bottom: 16px;
|
|
6
|
+
}
|
|
7
|
+
`){render(){const t={absolute:this.title.length===0,relative:this.title.length>0};return v.html`
|
|
8
|
+
<schmancy-grid class="${this.classMap(t)}" align="center" justify="stretch" cols="auto 1fr auto">
|
|
9
|
+
<slot name="back">
|
|
10
|
+
<schmancy-button
|
|
11
|
+
@click=${()=>{this.dispatchEvent(new CustomEvent("dismiss",{bubbles:!0,composed:!0}))}}
|
|
12
|
+
>
|
|
13
|
+
<span class="text-[24px]">← </span>
|
|
14
|
+
</schmancy-button>
|
|
15
|
+
</slot>
|
|
16
|
+
<schmancy-typography transform="capitalize" type="headline" token="lg"> ${this.title} </schmancy-typography>
|
|
17
|
+
<slot name="actions">
|
|
18
|
+
<schmancy-icon-button
|
|
19
|
+
variant="outlined"
|
|
20
|
+
@click=${()=>{this.dispatchEvent(new CustomEvent("dismiss",{bubbles:!0,composed:!0}))}}
|
|
21
|
+
>
|
|
22
|
+
close
|
|
23
|
+
</schmancy-icon-button>
|
|
24
|
+
</slot>
|
|
25
|
+
</schmancy-grid>
|
|
26
|
+
`}};g([r.property()],b.prototype,"title",2),b=g([r.customElement("schmancy-sheet-header")],b);var f=(t=>(t.Side="side",t.Bottom="bottom",t.BottomCenter="bottom-center",t.TopRight="top-right",t.BottomRight="bottom-right",t))(f||{});const m="are-you-there-sheet",y="yes-here",u=new class{constructor(){this.bottomSheet=new s.Subject,this.$dismiss=new s.Subject,this.bottomSheet.pipe(s.switchMap(t=>s.forkJoin([s.fromEvent(window,y).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(m,{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,o;return!t.persist||!((o=(i=e==null?void 0:e.shadowRoot)==null?void 0:i.querySelector("slot"))!=null&&o.assignedElements().find(c=>c.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,y).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(m,{detail:{uid:t}}))}))])),s.tap(([t])=>{t==null||t.closeSheet()})).subscribe()}dismiss(t){this.$dismiss.next(t)}open(t){this.bottomSheet.next(t)}};var x=Object.defineProperty,C=Object.getOwnPropertyDescriptor,h=(t,e,i,o)=>{for(var c,n=o>1?void 0:o?C(e,i):e,l=t.length-1;l>=0;l--)(c=t[l])&&(n=(o?c(e,i,n):c(n))||n);return o&&n&&x(e,i,n),n};let a=class extends E.$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:.8;transition:opacity var(--transition-duration) ease-in-out}.content{z-index:1;transition:transform var(--transition-duration) ease-in-out}.content[data-position=side]{height:100%;margin-left:auto;min-width:320px;max-width:90vw;width:fit-content}.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=f.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(o=>{o.preventDefault(),this.closeSheet()})),e=s.fromEvent(window,"keyup").pipe(s.tap(o=>{o.key!=="Escape"||this.sheetContainsFocus()||u.dismiss(this.uid)})),i=s.fromEvent(window,m).pipe(s.tap(o=>{o.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(y,{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 v.html`
|
|
27
|
+
<div class="sheet" role="dialog" aria-labelledby="sheet-title" aria-hidden="true" aria-modal="false">
|
|
28
|
+
<div
|
|
29
|
+
class="overlay"
|
|
30
|
+
@click=${t=>{t.stopPropagation(),this.allowOverlayDismiss&&u.dismiss(this.uid)}}
|
|
31
|
+
></div>
|
|
32
|
+
<section class="content" data-position=${this.position}>
|
|
33
|
+
<schmancy-sheet-header
|
|
34
|
+
@dismiss=${t=>{t.stopPropagation(),u.dismiss(this.uid)}}
|
|
35
|
+
id="sheet-title"
|
|
36
|
+
.hidden=${this.header==="hidden"}
|
|
37
|
+
title=${this.title}
|
|
38
|
+
></schmancy-sheet-header>
|
|
39
|
+
<schmancy-surface fill type="surface" tabindex="0">
|
|
40
|
+
<slot></slot>
|
|
41
|
+
</schmancy-surface>
|
|
42
|
+
</section>
|
|
43
|
+
</div>
|
|
44
|
+
`}};var d,p;h([r.property({type:String,reflect:!0})],a.prototype,"uid",2),h([r.property({type:Boolean,reflect:!0})],a.prototype,"open",2),h([r.property({type:String,reflect:!0})],a.prototype,"header",2),h([r.property({type:String,reflect:!0})],a.prototype,"position",2),h([r.property({type:Boolean,reflect:!0})],a.prototype,"persist",2),h([r.property({type:Boolean,reflect:!0})],a.prototype,"allowOverlayDismiss",2),h([r.property({type:String,reflect:!0})],a.prototype,"title",2),h([r.query(".sheet")],a.prototype,"sheet",2),h([r.queryAssignedElements({flatten:!0})],a.prototype,"assignedElements",2),h([r.property()],a.prototype,"focusAttribute",2),h([(d="open",(t,e)=>{const{willUpdate:i}=t;p=Object.assign({waitUntilFirstUpdate:!1},p),t.willUpdate=function(o){if(i.call(this,o),o.has(d)){const c=o.get(d),n=this[d];c!==n&&(p!=null&&p.waitUntilFirstUpdate&&!this.hasUpdated||this[e].call(this,c,n))}}})],a.prototype,"onOpenChange",1),a=h([r.customElement("schmancy-sheet")],a),exports.SchmancySheetPosition=f,exports.SheetHereMorty=y,exports.SheetWhereAreYouRicky=m,exports.sheet=u;
|
|
45
|
+
//# sourceMappingURL=sheet-B7UZL0S4.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet-B7UZL0S4.cjs","sources":["../src/sheet/header.ts","../src/sheet/sheet.service.ts","../src/sheet/sheet.ts","../src/sheet/hook.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]\">← </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-icon-button\n\t\t\t\t\t\tvariant=\"outlined\"\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\tclose\n\t\t\t\t\t</schmancy-icon-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","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 style from './sheet.scss?inline'\nimport {\n\tSchmancySheetPosition,\n\tSheetHereMorty,\n\tSheetWhereAreYouRicky,\n\tSheetWhereAreYouRickyEvent,\n\tsheet,\n} from './sheet.service'\nimport { on } from './hook'\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@on('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<div class=\"sheet\" role=\"dialog\" aria-labelledby=\"sheet-title\" aria-hidden=\"true\" aria-modal=\"false\">\n\t\t\t\t<div\n\t\t\t\t\tclass=\"overlay\"\n\t\t\t\t\t@click=${(e: Event) => {\n\t\t\t\t\t\te.stopPropagation()\n\t\t\t\t\t\tif (this.allowOverlayDismiss) sheet.dismiss(this.uid)\n\t\t\t\t\t}}\n\t\t\t\t></div>\n\t\t\t\t<section class=\"content\" data-position=${this.position}>\n\t\t\t\t\t<schmancy-sheet-header\n\t\t\t\t\t\t@dismiss=${(e: CustomEvent) => {\n\t\t\t\t\t\t\te.stopPropagation()\n\t\t\t\t\t\t\tsheet.dismiss(this.uid)\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tid=\"sheet-title\"\n\t\t\t\t\t\t.hidden=${this.header === 'hidden'}\n\t\t\t\t\t\ttitle=${this.title}\n\t\t\t\t\t></schmancy-sheet-header>\n\t\t\t\t\t<schmancy-surface fill type=\"surface\" tabindex=\"0\">\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t</schmancy-surface>\n\t\t\t\t</section>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet': SchmancySheet\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\twaitUntilFirstUpdate?: boolean\n}\n\nexport function on(propName: string, options?: WatchOptions) {\n\treturn (protoOrDescriptor: any, name: string): any => {\n\t\tconst { willUpdate } = protoOrDescriptor\n\n\t\toptions = Object.assign({ waitUntilFirstUpdate: false }, options) as WatchOptions\n\n\t\tprotoOrDescriptor.willUpdate = function (changedProps: Map<string, any>) {\n\t\t\twillUpdate.call(this, changedProps)\n\n\t\t\tif (changedProps.has(propName)) {\n\t\t\t\tconst oldValue = changedProps.get(propName)\n\t\t\t\tconst newValue = this[propName]\n\n\t\t\t\tif (oldValue !== newValue) {\n\t\t\t\t\tif (!options?.waitUntilFirstUpdate || this.hasUpdated) {\n\t\t\t\t\t\tthis[name].call(this, oldValue, newValue)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":["SchmancySheetHeader","TailwindElement","css","classes","absolute","this","title","length","relative","html","classMap","dispatchEvent","CustomEvent","bubbles","composed","__decorateClass","property","prototype","customElement","SchmancySheetPosition","SheetWhereAreYouRicky","SheetHereMorty","sheet","constructor","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","newValue","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","propName","options","type","reflect","Boolean","query","queryAssignedElements","flatten","protoOrDescriptor","name","willUpdate","Object","assign","waitUntilFirstUpdate","changedProps","call","has","oldValue","get","hasUpdated"],"mappings":"icAKA,IAAqBA,EAArB,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AUU,OAAOC,OAAO,CAAEC,qBAAAA,IAA+BZ,CAEvCO,EAAAA,EAAAE,WAAa,SAAUI,EAAAA,CAGpC,GAFOJ,EAAAK,KAAKvH,KAAMsH,GAElBA,EAAaE,IAAIhB,GAAW,CACzB,MAAAiB,EAAWH,EAAaI,IAAIlB,GAC5B5B,EAAW5E,KAAKwG,GAElBiB,IAAa7C,IACX6B,GAAAA,MAAAA,EAASY,sBAAwBrH,CAAAA,KAAK2H,YAC1C3H,KAAKiH,CAAAA,EAAMM,KAAKvH,KAAMyH,EAAU7C,CAAAA,EAElC,CAEF,CAAA,EAAA,EDtBmBb,EAgBpBnD,UAAA,eAAA,GAhBoBmD,EAArBrD,EAAA,CADCG,EAAAA,cAAc,gBAAA,CAAA,EACMkD"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Subject as
|
|
1
|
+
import { Subject as E, switchMap as D, forkJoin as S, fromEvent as d, takeUntil as f, timer as x, map as m, defaultIfEmpty as C, of as F, tap as h, delay as y, filter as U, take as j, mergeMap as P, merge as B } from "rxjs";
|
|
2
2
|
import "lit/directives/class-map.js";
|
|
3
3
|
import "lit/directives/style-map.js";
|
|
4
|
-
import { T
|
|
5
|
-
import { css as
|
|
6
|
-
import { property as
|
|
7
|
-
import { $ as
|
|
8
|
-
var N = Object.defineProperty, M = Object.getOwnPropertyDescriptor, k = (t, e, s,
|
|
9
|
-
for (var
|
|
10
|
-
return
|
|
4
|
+
import { T } from "./tailwind.mixin-DtR4DQvn.js";
|
|
5
|
+
import { css as I, html as A } from "lit";
|
|
6
|
+
import { property as c, customElement as O, query as q, queryAssignedElements as z } from "lit/decorators.js";
|
|
7
|
+
import { $ as L } from "./litElement.mixin-CjxO_zfv.js";
|
|
8
|
+
var N = Object.defineProperty, M = Object.getOwnPropertyDescriptor, k = (t, e, s, i) => {
|
|
9
|
+
for (var a, o = i > 1 ? void 0 : i ? M(e, s) : e, l = t.length - 1; l >= 0; l--) (a = t[l]) && (o = (i ? a(e, s, o) : a(o)) || o);
|
|
10
|
+
return i && o && N(e, s, o), o;
|
|
11
11
|
};
|
|
12
|
-
let
|
|
12
|
+
let b = class extends T(I`
|
|
13
13
|
:host {
|
|
14
14
|
inset: 0;
|
|
15
15
|
display: block;
|
|
@@ -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
|
|
21
|
+
return A`
|
|
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
|
|
@@ -31,64 +31,40 @@ let m = class extends $(T`
|
|
|
31
31
|
</slot>
|
|
32
32
|
<schmancy-typography transform="capitalize" type="headline" token="lg"> ${this.title} </schmancy-typography>
|
|
33
33
|
<slot name="actions">
|
|
34
|
-
<schmancy-button
|
|
34
|
+
<schmancy-icon-button
|
|
35
|
+
variant="outlined"
|
|
35
36
|
@click=${() => {
|
|
36
37
|
this.dispatchEvent(new CustomEvent("dismiss", { bubbles: !0, composed: !0 }));
|
|
37
38
|
}}
|
|
38
39
|
>
|
|
39
|
-
|
|
40
|
-
</schmancy-button>
|
|
40
|
+
close
|
|
41
|
+
</schmancy-icon-button>
|
|
41
42
|
</slot>
|
|
42
43
|
</schmancy-grid>
|
|
43
44
|
`;
|
|
44
45
|
}
|
|
45
46
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
e = Object.assign({ waitUntilFirstUpdate: !1 }, e), s.willUpdate = function(i) {
|
|
50
|
-
if (n.call(this, i), i.has(t)) {
|
|
51
|
-
const a = i.get(t), E = this[t];
|
|
52
|
-
a !== E && (e != null && e.waitUntilFirstUpdate && !this.hasUpdated || this[o].call(this, a, E));
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
k([h()], m.prototype, "title", 2), m = k([w("schmancy-sheet-header")], m);
|
|
58
|
-
var J = Object.defineProperty, Y = Object.getOwnPropertyDescriptor;
|
|
59
|
-
let A = class extends $() {
|
|
60
|
-
render() {
|
|
61
|
-
return f`
|
|
62
|
-
<div tabindex="0">
|
|
63
|
-
<slot></slot>
|
|
64
|
-
</div>
|
|
65
|
-
`;
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
A = ((t, e, s, o) => {
|
|
69
|
-
for (var n, i = o > 1 ? void 0 : o ? Y(e, s) : e, a = t.length - 1; a >= 0; a--) (n = t[a]) && (i = (o ? n(e, s, i) : n(i)) || i);
|
|
70
|
-
return o && i && J(e, s, i), i;
|
|
71
|
-
})([w("schmancy-sheet-content")], A);
|
|
72
|
-
var P = ((t) => (t.Side = "side", t.Bottom = "bottom", t.BottomCenter = "bottom-center", t.TopRight = "top-right", t.BottomRight = "bottom-right", t))(P || {});
|
|
73
|
-
const v = "are-you-there-sheet", g = "yes-here", y = new class {
|
|
47
|
+
k([c()], b.prototype, "title", 2), b = k([O("schmancy-sheet-header")], b);
|
|
48
|
+
var $ = ((t) => (t.Side = "side", t.Bottom = "bottom", t.BottomCenter = "bottom-center", t.TopRight = "top-right", t.BottomRight = "bottom-right", t))($ || {});
|
|
49
|
+
const g = "are-you-there-sheet", w = "yes-here", v = new class {
|
|
74
50
|
constructor() {
|
|
75
|
-
this.bottomSheet = new
|
|
76
|
-
window.dispatchEvent(new CustomEvent(
|
|
77
|
-
}))])),
|
|
78
|
-
var s,
|
|
79
|
-
return !t.persist || !((
|
|
80
|
-
}),
|
|
51
|
+
this.bottomSheet = new E(), this.$dismiss = new E(), this.bottomSheet.pipe(D((t) => S([d(window, w).pipe(f(x(0)), m((e) => e.detail.sheet), C(void 0)), F(t).pipe(h(() => {
|
|
52
|
+
window.dispatchEvent(new CustomEvent(g, { detail: { uid: t.uid ?? t.component.tagName } }));
|
|
53
|
+
}))])), m(([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 })), y(20), U(({ target: t, sheet: e }) => {
|
|
54
|
+
var s, i;
|
|
55
|
+
return !t.persist || !((i = (s = e == null ? void 0 : e.shadowRoot) == null ? void 0 : s.querySelector("slot")) != null && i.assignedElements().find((a) => a.tagName === t.component.tagName)) || (e == null || e.setAttribute("open", "true"), !1);
|
|
56
|
+
}), h(({ target: t, sheet: e }) => {
|
|
81
57
|
e == null || e.appendChild(t.component);
|
|
82
|
-
}),
|
|
58
|
+
}), y(1), h(({ sheet: t }) => {
|
|
83
59
|
t == null || t.setAttribute("open", "true");
|
|
84
|
-
}),
|
|
85
|
-
d(t, "close").pipe(
|
|
60
|
+
}), h(({ sheet: t }) => {
|
|
61
|
+
d(t, "close").pipe(j(1)).pipe(y(300)).subscribe((e) => {
|
|
86
62
|
const s = e.target;
|
|
87
63
|
s != null && s.persist || (s == null || s.remove()), document.body.style.overflow = "auto";
|
|
88
64
|
});
|
|
89
|
-
})).subscribe(), this.$dismiss.pipe(
|
|
90
|
-
window.dispatchEvent(new CustomEvent(
|
|
91
|
-
}))])),
|
|
65
|
+
})).subscribe(), this.$dismiss.pipe(P((t) => S([d(window, w).pipe(f(x(100)), m((e) => e.detail.sheet), C(void 0)), F(t).pipe(h(() => {
|
|
66
|
+
window.dispatchEvent(new CustomEvent(g, { detail: { uid: t } }));
|
|
67
|
+
}))])), h(([t]) => {
|
|
92
68
|
t == null || t.closeSheet();
|
|
93
69
|
})).subscribe();
|
|
94
70
|
}
|
|
@@ -99,13 +75,13 @@ const v = "are-you-there-sheet", g = "yes-here", y = new class {
|
|
|
99
75
|
this.bottomSheet.next(t);
|
|
100
76
|
}
|
|
101
77
|
}();
|
|
102
|
-
var
|
|
103
|
-
for (var
|
|
104
|
-
return
|
|
78
|
+
var R = Object.defineProperty, J = Object.getOwnPropertyDescriptor, r = (t, e, s, i) => {
|
|
79
|
+
for (var a, o = i > 1 ? void 0 : i ? J(e, s) : e, l = t.length - 1; l >= 0; l--) (a = t[l]) && (o = (i ? a(e, s, o) : a(o)) || o);
|
|
80
|
+
return i && o && R(e, s, o), o;
|
|
105
81
|
};
|
|
106
|
-
let
|
|
82
|
+
let n = class extends L(":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:.8;transition:opacity var(--transition-duration) ease-in-out}.content{z-index:1;transition:transform var(--transition-duration) ease-in-out}.content[data-position=side]{height:100%;margin-left:auto;min-width:320px;max-width:90vw;width:fit-content}.content[data-position=bottom]{width:100%;margin-top:auto;border-radius:16px 16px 0 0;max-height:90vh}") {
|
|
107
83
|
constructor() {
|
|
108
|
-
super(...arguments), this.open = !1, this.header = "visible", this.position =
|
|
84
|
+
super(...arguments), this.open = !1, this.header = "visible", this.position = $.Side, this.persist = !1, this.allowOverlayDismiss = !0, this.title = "", this.focusAttribute = "autofocus", this.lastFocusedElement = null, this.handleFocusIn = (t) => {
|
|
109
85
|
var e;
|
|
110
86
|
(e = this.sheet) != null && e.contains(t.target) || this.focus();
|
|
111
87
|
};
|
|
@@ -121,21 +97,21 @@ let r = class extends z(":host{--overlay-color: var(--schmancy-sys-color-surface
|
|
|
121
97
|
super.disconnectedCallback(), this.disconnecting.next(!0);
|
|
122
98
|
}
|
|
123
99
|
setupEventListeners() {
|
|
124
|
-
const t = d(window, "popstate").pipe(
|
|
125
|
-
|
|
126
|
-
})), e = d(window, "keyup").pipe(
|
|
127
|
-
|
|
128
|
-
})), s = d(window,
|
|
129
|
-
|
|
100
|
+
const t = d(window, "popstate").pipe(h((i) => {
|
|
101
|
+
i.preventDefault(), this.closeSheet();
|
|
102
|
+
})), e = d(window, "keyup").pipe(h((i) => {
|
|
103
|
+
i.key !== "Escape" || this.sheetContainsFocus() || v.dismiss(this.uid);
|
|
104
|
+
})), s = d(window, g).pipe(h((i) => {
|
|
105
|
+
i.detail.uid === this.uid && this.announcePresence();
|
|
130
106
|
}));
|
|
131
|
-
|
|
107
|
+
B(t, e, s).pipe(f(this.disconnecting)).subscribe();
|
|
132
108
|
}
|
|
133
109
|
sheetContainsFocus() {
|
|
134
110
|
var t;
|
|
135
111
|
return ((t = this.sheet) == null ? void 0 : t.contains(document.activeElement)) ?? !1;
|
|
136
112
|
}
|
|
137
113
|
announcePresence() {
|
|
138
|
-
this.dispatchEvent(new CustomEvent(
|
|
114
|
+
this.dispatchEvent(new CustomEvent(w, { detail: { sheet: this }, bubbles: !0, composed: !0 }));
|
|
139
115
|
}
|
|
140
116
|
addFocusTrap() {
|
|
141
117
|
document.addEventListener("focusin", this.handleFocusIn);
|
|
@@ -159,35 +135,45 @@ let r = class extends z(":host{--overlay-color: var(--schmancy-sys-color-surface
|
|
|
159
135
|
(t = this.getFocusElement()) == null || t.focus();
|
|
160
136
|
}
|
|
161
137
|
render() {
|
|
162
|
-
return
|
|
138
|
+
return A`
|
|
163
139
|
<div class="sheet" role="dialog" aria-labelledby="sheet-title" aria-hidden="true" aria-modal="false">
|
|
164
140
|
<div
|
|
165
141
|
class="overlay"
|
|
166
142
|
@click=${(t) => {
|
|
167
|
-
t.stopPropagation(), this.allowOverlayDismiss &&
|
|
143
|
+
t.stopPropagation(), this.allowOverlayDismiss && v.dismiss(this.uid);
|
|
168
144
|
}}
|
|
169
145
|
></div>
|
|
170
|
-
<
|
|
146
|
+
<section class="content" data-position=${this.position}>
|
|
171
147
|
<schmancy-sheet-header
|
|
172
148
|
@dismiss=${(t) => {
|
|
173
|
-
t.stopPropagation(),
|
|
149
|
+
t.stopPropagation(), v.dismiss(this.uid);
|
|
174
150
|
}}
|
|
175
151
|
id="sheet-title"
|
|
176
152
|
.hidden=${this.header === "hidden"}
|
|
177
153
|
title=${this.title}
|
|
178
154
|
></schmancy-sheet-header>
|
|
179
|
-
<
|
|
180
|
-
|
|
155
|
+
<schmancy-surface fill type="surface" tabindex="0">
|
|
156
|
+
<slot></slot>
|
|
157
|
+
</schmancy-surface>
|
|
158
|
+
</section>
|
|
181
159
|
</div>
|
|
182
160
|
`;
|
|
183
161
|
}
|
|
184
162
|
};
|
|
185
|
-
|
|
163
|
+
var u, p;
|
|
164
|
+
r([c({ type: String, reflect: !0 })], n.prototype, "uid", 2), r([c({ type: Boolean, reflect: !0 })], n.prototype, "open", 2), r([c({ type: String, reflect: !0 })], n.prototype, "header", 2), r([c({ type: String, reflect: !0 })], n.prototype, "position", 2), r([c({ type: Boolean, reflect: !0 })], n.prototype, "persist", 2), r([c({ type: Boolean, reflect: !0 })], n.prototype, "allowOverlayDismiss", 2), r([c({ type: String, reflect: !0 })], n.prototype, "title", 2), r([q(".sheet")], n.prototype, "sheet", 2), r([z({ flatten: !0 })], n.prototype, "assignedElements", 2), r([c()], n.prototype, "focusAttribute", 2), r([(u = "open", (t, e) => {
|
|
165
|
+
const { willUpdate: s } = t;
|
|
166
|
+
p = Object.assign({ waitUntilFirstUpdate: !1 }, p), t.willUpdate = function(i) {
|
|
167
|
+
if (s.call(this, i), i.has(u)) {
|
|
168
|
+
const a = i.get(u), o = this[u];
|
|
169
|
+
a !== o && (p != null && p.waitUntilFirstUpdate && !this.hasUpdated || this[e].call(this, a, o));
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
})], n.prototype, "onOpenChange", 1), n = r([O("schmancy-sheet")], n);
|
|
186
173
|
export {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
y as s
|
|
174
|
+
$ as S,
|
|
175
|
+
g as a,
|
|
176
|
+
w as b,
|
|
177
|
+
v as s
|
|
192
178
|
};
|
|
193
|
-
//# sourceMappingURL=sheet-
|
|
179
|
+
//# sourceMappingURL=sheet-Qm3DILOR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet-Qm3DILOR.js","sources":["../src/sheet/header.ts","../src/sheet/sheet.service.ts","../src/sheet/sheet.ts","../src/sheet/hook.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]\">← </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-icon-button\n\t\t\t\t\t\tvariant=\"outlined\"\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\tclose\n\t\t\t\t\t</schmancy-icon-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","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 style from './sheet.scss?inline'\nimport {\n\tSchmancySheetPosition,\n\tSheetHereMorty,\n\tSheetWhereAreYouRicky,\n\tSheetWhereAreYouRickyEvent,\n\tsheet,\n} from './sheet.service'\nimport { on } from './hook'\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@on('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<div class=\"sheet\" role=\"dialog\" aria-labelledby=\"sheet-title\" aria-hidden=\"true\" aria-modal=\"false\">\n\t\t\t\t<div\n\t\t\t\t\tclass=\"overlay\"\n\t\t\t\t\t@click=${(e: Event) => {\n\t\t\t\t\t\te.stopPropagation()\n\t\t\t\t\t\tif (this.allowOverlayDismiss) sheet.dismiss(this.uid)\n\t\t\t\t\t}}\n\t\t\t\t></div>\n\t\t\t\t<section class=\"content\" data-position=${this.position}>\n\t\t\t\t\t<schmancy-sheet-header\n\t\t\t\t\t\t@dismiss=${(e: CustomEvent) => {\n\t\t\t\t\t\t\te.stopPropagation()\n\t\t\t\t\t\t\tsheet.dismiss(this.uid)\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tid=\"sheet-title\"\n\t\t\t\t\t\t.hidden=${this.header === 'hidden'}\n\t\t\t\t\t\ttitle=${this.title}\n\t\t\t\t\t></schmancy-sheet-header>\n\t\t\t\t\t<schmancy-surface fill type=\"surface\" tabindex=\"0\">\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t</schmancy-surface>\n\t\t\t\t</section>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet': SchmancySheet\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\twaitUntilFirstUpdate?: boolean\n}\n\nexport function on(propName: string, options?: WatchOptions) {\n\treturn (protoOrDescriptor: any, name: string): any => {\n\t\tconst { willUpdate } = protoOrDescriptor\n\n\t\toptions = Object.assign({ waitUntilFirstUpdate: false }, options) as WatchOptions\n\n\t\tprotoOrDescriptor.willUpdate = function (changedProps: Map<string, any>) {\n\t\t\twillUpdate.call(this, changedProps)\n\n\t\t\tif (changedProps.has(propName)) {\n\t\t\t\tconst oldValue = changedProps.get(propName)\n\t\t\t\tconst newValue = this[propName]\n\n\t\t\t\tif (oldValue !== newValue) {\n\t\t\t\t\tif (!options?.waitUntilFirstUpdate || this.hasUpdated) {\n\t\t\t\t\t\tthis[name].call(this, oldValue, newValue)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":["SchmancySheetHeader","TailwindElement","css","classes","absolute","this","title","length","relative","html","classMap","dispatchEvent","CustomEvent","bubbles","composed","__decorateClass","property","prototype","customElement","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","newValue","setIsSheetShown","activeElement","addFocusTrap","removeFocusTrap","connectedCallback","setupEventListeners","disconnectedCallback","disconnecting","popState$","preventDefault","keyUp$","event","key","sheetContainsFocus","dismiss","rickyComm$","announcePresence","merge","addEventListener","removeEventListener","isShown","String","getFocusElement","selector","el","matches","render","stopPropagation","propName","options","type","reflect","Boolean","query","queryAssignedElements","flatten","protoOrDescriptor","name","willUpdate","Object","assign","waitUntilFirstUpdate","changedProps","call","has","oldValue","get","hasUpdated"],"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;AAAAA,eAIpE,MACHD;AAAAA,WAAAM,cACJ,IAAIC,YAAY,WAAW,EAC1BC,SAAAA,IACAC,UAAAA,GAEF,CAAA,CAAA;AAAA,IAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EACA;AAAA;AAjCMC,EAAA,CAAXC,EAPmBhB,CAAAA,GAAAA,EAORiB,WAAA,SAAA,CAAA,GAPQjB,IAArBe,EAAA,CADCG,EAAc,uBACM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ol.toStringTag,{value:"Module"});const e=require("./sheet-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./sheet-B7UZL0S4.cjs");exports.SchmancySheetPosition=e.SchmancySheetPosition,exports.SheetHereMorty=e.SheetHereMorty,exports.SheetWhereAreYouRicky=e.SheetWhereAreYouRicky,exports.sheet=e.sheet;
|
|
2
2
|
//# sourceMappingURL=sheet.cjs.map
|
package/dist/sheet.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { S as
|
|
1
|
+
import { S as t, b as a, a as h, s as o } from "./sheet-Qm3DILOR.js";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
r as sheet
|
|
3
|
+
t as SchmancySheetPosition,
|
|
4
|
+
a as SheetHereMorty,
|
|
5
|
+
h as SheetWhereAreYouRicky,
|
|
6
|
+
o as sheet
|
|
8
7
|
};
|
|
9
8
|
//# sourceMappingURL=sheet.js.map
|