@mhmo91/schmancy 0.2.165 → 0.2.166
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/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- 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/dropdown-content-CgwaiBpw.cjs +65 -0
- package/dist/dropdown-content-CgwaiBpw.cjs.map +1 -0
- package/dist/dropdown-content-DmqNgUQQ.js +153 -0
- package/dist/dropdown-content-DmqNgUQQ.js.map +1 -0
- package/dist/dropdown.cjs +1 -1
- package/dist/dropdown.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/nav-drawer.cjs +1 -1
- package/dist/nav-drawer.js +1 -1
- package/dist/teleport.cjs +1 -1
- package/dist/{teleport.component-BYnumidn.cjs → teleport.component-CnDx2oti.cjs} +2 -2
- package/dist/{teleport.component-BYnumidn.cjs.map → teleport.component-CnDx2oti.cjs.map} +1 -1
- package/dist/{teleport.component-BQoWidXp.js → teleport.component-DfjivpLV.js} +2 -2
- package/dist/{teleport.component-BQoWidXp.js.map → teleport.component-DfjivpLV.js.map} +1 -1
- package/dist/teleport.js +1 -1
- package/package.json +1 -1
- package/types/src/dropdown/dropdown-component.d.ts +12 -2
- package/dist/dropdown-content-Db639XJB.cjs +0 -53
- package/dist/dropdown-content-Db639XJB.cjs.map +0 -1
- package/dist/dropdown-content-aNqgmuB9.js +0 -124
- package/dist/dropdown-content-aNqgmuB9.js.map +0 -1
package/dist/badge.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-CnDx2oti.cjs");Object.defineProperty(exports,"SchmancyBadgeV2",{enumerable:!0,get:()=>e.SchmancyBadgeV2});
|
|
2
2
|
//# sourceMappingURL=badge.cjs.map
|
package/dist/badge.js
CHANGED
package/dist/card.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";require("./teleport.component-
|
|
1
|
+
"use strict";require("./teleport.component-CnDx2oti.cjs");
|
|
2
2
|
//# sourceMappingURL=card.cjs.map
|
package/dist/card.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "./teleport.component-
|
|
1
|
+
import "./teleport.component-DfjivpLV.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-CnDx2oti.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 { f as n, c as t, g as r, d as c, e as h, h as o, a as S, b as s, s as m } from "./teleport.component-
|
|
1
|
+
import { f as n, c as t, g as r, d as c, e as h, h as o, a as S, b as s, s as m } from "./teleport.component-DfjivpLV.js";
|
|
2
2
|
export {
|
|
3
3
|
n as SchmancyContentDrawer,
|
|
4
4
|
t as SchmancyContentDrawerID,
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";const l=require("@floating-ui/dom"),c=require("rxjs");require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const m=require("./litElement.mixin-BDAc5mMz.cjs"),y=require("./tailwind.mixin-CAvg5VIG.cjs"),h=require("lit"),n=require("lit/decorators.js");var u=Object.defineProperty,g=Object.getOwnPropertyDescriptor,a=(t,e,s,r)=>{for(var i,o=r>1?void 0:r?g(e,s):e,p=t.length-1;p>=0;p--)(i=t[p])&&(o=(r?i(e,s,o):i(o))||o);return r&&o&&u(e,s,o),o};exports.SchmancyDropdown=class extends m.$LitElement(h.css`
|
|
2
|
+
:host {
|
|
3
|
+
display: inline-block;
|
|
4
|
+
position: relative;
|
|
5
|
+
}
|
|
6
|
+
`){constructor(){super(...arguments),this.open=!1,this.placement="bottom-start",this.distance=8,this.portal=null}connectedCallback(){super.connectedCallback(),this.setupPortal(),c.fromEvent(document,"click").pipe(c.filter(t=>this.open&&!this.isEventFromSelf(t)),c.takeUntil(this.disconnecting)).subscribe(()=>{this.open=!1}),c.fromEvent(document,"keydown").pipe(c.filter(t=>this.open&&t.key==="Escape"),c.takeUntil(this.disconnecting)).subscribe(()=>{this.open=!1})}setupPortal(){let t=document.getElementById("schmancy-portal-container");t||(t=document.createElement("div"),t.id="schmancy-portal-container",t.style.position="fixed",t.style.zIndex="10000",t.style.top="0",t.style.left="0",t.style.pointerEvents="none",document.body.appendChild(t));const e=document.createElement("div");e.className="schmancy-dropdown-portal",e.style.position="absolute",e.style.pointerEvents="auto",e.style.display="none",t.appendChild(e),this.portal=e}isEventFromSelf(t){return t.composedPath().some(e=>e===this)}disconnectedCallback(){var t;(t=this.cleanupPositioner)==null||t.call(this),this.portal&&(this.portal.remove(),this.portal=null),super.disconnectedCallback()}toggle(){this.open=!this.open}updated(t){var e;super.updated(t),t.has("open")&&(this.open?this.setupPositioner():((e=this.cleanupPositioner)==null||e.call(this),this.portal&&(this.portal.style.display="none",this.portal.innerHTML="")))}setupPositioner(){this.triggerContainer&&this.portal&&(this.portal.style.display="block",this.teleportContentToPortal(),this.cleanupPositioner=l.autoUpdate(this.triggerContainer,this.portal,()=>{l.computePosition(this.triggerContainer,this.portal,{placement:this.placement,middleware:[l.offset(this.distance),l.flip({fallbackPlacements:["top-start","bottom-start"]}),l.shift({padding:0})]}).then(({x:t,y:e})=>{Object.assign(this.portal.style,{left:`${t}px`,top:e-8+"px"})})}))}teleportContentToPortal(){this.portal&&(this.portal.innerHTML="",this.contentElements.forEach(t=>{var s;const e=t.cloneNode(!0);t.tagName.toLowerCase()==="schmancy-dropdown-content"&&e.addEventListener("slotchange",()=>{var i;const r=(i=e.shadowRoot)==null?void 0:i.querySelector('[part="content"]');r&&r.classList.add("schmancy-dropdown-content")}),(s=this.portal)==null||s.appendChild(e)}))}handleTriggerClick(t){t.stopPropagation(),this.toggle()}render(){return h.html`
|
|
7
|
+
<div class="trigger-container" @click=${this.handleTriggerClick}>
|
|
8
|
+
<slot name="trigger"></slot>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div class="dropdown-content-container" ?hidden=${!this.open}>
|
|
12
|
+
<slot
|
|
13
|
+
@slotchange=${()=>{this.open&&(this.teleportContentToPortal(),this.setupPositioner())}}
|
|
14
|
+
></slot>
|
|
15
|
+
</div>
|
|
16
|
+
`}},a([n.property({type:Boolean,reflect:!0})],exports.SchmancyDropdown.prototype,"open",2),a([n.property({type:String})],exports.SchmancyDropdown.prototype,"placement",2),a([n.property({type:Number})],exports.SchmancyDropdown.prototype,"distance",2),a([n.query(".trigger-container")],exports.SchmancyDropdown.prototype,"triggerContainer",2),a([n.query(".dropdown-content-container")],exports.SchmancyDropdown.prototype,"contentContainer",2),a([n.queryAssignedElements({flatten:!0})],exports.SchmancyDropdown.prototype,"contentElements",2),a([n.state()],exports.SchmancyDropdown.prototype,"portal",2),a([n.queryAssignedElements({slot:"trigger",flatten:!0})],exports.SchmancyDropdown.prototype,"triggerElements",2),exports.SchmancyDropdown=a([n.customElement("schmancy-dropdown")],exports.SchmancyDropdown);var w=Object.defineProperty,f=Object.getOwnPropertyDescriptor,d=(t,e,s,r)=>{for(var i,o=r>1?void 0:r?f(e,s):e,p=t.length-1;p>=0;p--)(i=t[p])&&(o=(r?i(e,s,o):i(o))||o);return r&&o&&w(e,s,o),o};exports.SchmancyDropdownContent=class extends y.TailwindElement(h.css`
|
|
17
|
+
:host {
|
|
18
|
+
display: block;
|
|
19
|
+
position: absolute;
|
|
20
|
+
z-index: 1000;
|
|
21
|
+
min-width: 10rem;
|
|
22
|
+
padding: 0.5rem 0;
|
|
23
|
+
margin: 0;
|
|
24
|
+
text-align: left;
|
|
25
|
+
list-style: none;
|
|
26
|
+
background-color: var(--schmancy-sys-color-surface-container);
|
|
27
|
+
background-clip: padding-box;
|
|
28
|
+
border-radius: 0.375rem;
|
|
29
|
+
box-shadow: var(--schmancy-sys-elevation-3);
|
|
30
|
+
will-change: transform;
|
|
31
|
+
transform-origin: top left;
|
|
32
|
+
animation: dropdownAnimation 0.1s ease-out forwards;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:host([hidden]) {
|
|
36
|
+
display: none;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@keyframes dropdownAnimation {
|
|
40
|
+
from {
|
|
41
|
+
opacity: 0;
|
|
42
|
+
transform: scale(0.95);
|
|
43
|
+
}
|
|
44
|
+
to {
|
|
45
|
+
opacity: 1;
|
|
46
|
+
transform: scale(1);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Apply styles to content both in the component and when teleported to the portal */
|
|
51
|
+
.schmancy-dropdown-content {
|
|
52
|
+
background-color: var(--schmancy-sys-color-surface-container);
|
|
53
|
+
border-radius: 0.375rem;
|
|
54
|
+
box-shadow: var(--schmancy-sys-elevation-3);
|
|
55
|
+
padding: 0.5rem 0;
|
|
56
|
+
will-change: transform;
|
|
57
|
+
transform-origin: top left;
|
|
58
|
+
animation: dropdownAnimation 0.1s ease-out forwards;
|
|
59
|
+
}
|
|
60
|
+
`){constructor(){super(...arguments),this.width="auto",this.maxHeight="80vh",this.shadow=!0,this.radius="md"}render(){const t={"schmancy-dropdown-content":!0,"overflow-auto":!0,"shadow-none":!this.shadow,"rounded-none":this.radius==="none","rounded-sm":this.radius==="sm","rounded-md":this.radius==="md","rounded-lg":this.radius==="lg","rounded-full":this.radius==="full"},e={width:this.width,maxHeight:this.maxHeight};return h.html`
|
|
61
|
+
<div class=${this.classMap(t)} style=${this.styleMap(e)} part="content">
|
|
62
|
+
<slot></slot>
|
|
63
|
+
</div>
|
|
64
|
+
`}},d([n.property({type:String})],exports.SchmancyDropdownContent.prototype,"width",2),d([n.property({type:String})],exports.SchmancyDropdownContent.prototype,"maxHeight",2),d([n.property({type:Boolean})],exports.SchmancyDropdownContent.prototype,"shadow",2),d([n.property({type:String})],exports.SchmancyDropdownContent.prototype,"radius",2),exports.SchmancyDropdownContent=d([n.customElement("schmancy-dropdown-content")],exports.SchmancyDropdownContent);
|
|
65
|
+
//# sourceMappingURL=dropdown-content-CgwaiBpw.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown-content-CgwaiBpw.cjs","sources":["../src/dropdown/dropdown-component.ts","../src/dropdown/dropdown-content.ts"],"sourcesContent":["import { autoUpdate, computePosition, flip, offset, shift } from '@floating-ui/dom'\nimport { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property, query, queryAssignedElements, state } from 'lit/decorators.js'\nimport { filter, fromEvent, takeUntil } from 'rxjs'\n\n/**\n * A dropdown component that displays content when triggered.\n *\n * @element schmancy-dropdown\n * @slot trigger - The element that triggers the dropdown\n * @slot - Default slot for the dropdown content\n */\n@customElement('schmancy-dropdown')\nexport class SchmancyDropdown extends $LitElement(css`\n\t:host {\n\t\tdisplay: inline-block;\n\t\tposition: relative;\n\t}\n`) {\n\t/**\n\t * Whether the dropdown is currently open\n\t */\n\t@property({ type: Boolean, reflect: true })\n\topen = false\n\n\t/**\n\t * Placement of the dropdown relative to the trigger\n\t */\n\t@property({ type: String })\n\tplacement:\n\t\t| 'top'\n\t\t| 'top-start'\n\t\t| 'top-end'\n\t\t| 'right'\n\t\t| 'right-start'\n\t\t| 'right-end'\n\t\t| 'bottom'\n\t\t| 'bottom-start'\n\t\t| 'bottom-end'\n\t\t| 'left'\n\t\t| 'left-start'\n\t\t| 'left-end' = 'bottom-start'\n\n\t/**\n\t * Offset distance in pixels\n\t */\n\t@property({ type: Number })\n\tdistance = 8\n\n\t@query('.trigger-container') triggerContainer!: HTMLElement\n\t@query('.dropdown-content-container') contentContainer!: HTMLElement\n\t@queryAssignedElements({ flatten: true }) contentElements!: HTMLElement[]\n\t@state() private portal: HTMLElement | null = null\n\n\t@queryAssignedElements({ slot: 'trigger', flatten: true })\n\ttriggerElements!: Array<HTMLElement>\n\n\tprivate cleanupPositioner?: () => void\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\n\t\t// Create portal container for teleporting content to document body\n\t\tthis.setupPortal()\n\n\t\t// Listen for document clicks to close dropdown when clicking outside\n\t\tfromEvent<MouseEvent>(document, 'click')\n\t\t\t.pipe(\n\t\t\t\tfilter(event => this.open && !this.isEventFromSelf(event)),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.open = false\n\t\t\t})\n\n\t\t// Listen for escape key to close dropdown\n\t\tfromEvent<KeyboardEvent>(document, 'keydown')\n\t\t\t.pipe(\n\t\t\t\tfilter(event => this.open && event.key === 'Escape'),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.open = false\n\t\t\t})\n\t}\n\n\t/**\n\t * Set up the portal element for teleporting content\n\t */\n\tprivate setupPortal() {\n\t\t// Check if portal container exists\n\t\tlet portalContainer = document.getElementById('schmancy-portal-container')\n\n\t\t// Create portal container if it doesn't exist\n\t\tif (!portalContainer) {\n\t\t\tportalContainer = document.createElement('div')\n\t\t\tportalContainer.id = 'schmancy-portal-container'\n\t\t\tportalContainer.style.position = 'fixed'\n\t\t\tportalContainer.style.zIndex = '10000'\n\t\t\tportalContainer.style.top = '0'\n\t\t\tportalContainer.style.left = '0'\n\t\t\tportalContainer.style.pointerEvents = 'none'\n\t\t\tdocument.body.appendChild(portalContainer)\n\t\t}\n\n\t\t// Create portal for this specific dropdown\n\t\tconst portal = document.createElement('div')\n\t\tportal.className = 'schmancy-dropdown-portal'\n\t\tportal.style.position = 'absolute'\n\t\tportal.style.pointerEvents = 'auto'\n\t\tportal.style.display = 'none'\n\t\tportalContainer.appendChild(portal)\n\n\t\tthis.portal = portal\n\t}\n\n\t/**\n\t * Check if an event originated from within this component\n\t */\n\tprivate isEventFromSelf(event: Event): boolean {\n\t\treturn event.composedPath().some(el => el === this)\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.cleanupPositioner?.()\n\n\t\t// Remove portal when component is disconnected\n\t\tif (this.portal) {\n\t\t\tthis.portal.remove()\n\t\t\tthis.portal = null\n\t\t}\n\n\t\tsuper.disconnectedCallback()\n\t}\n\n\t/**\n\t * Toggle the dropdown open state\n\t */\n\ttoggle() {\n\t\tthis.open = !this.open\n\t}\n\n\tupdated(changedProps: Map<string, any>) {\n\t\tsuper.updated(changedProps)\n\n\t\tif (changedProps.has('open')) {\n\t\t\tif (this.open) {\n\t\t\t\tthis.setupPositioner()\n\t\t\t} else {\n\t\t\t\tthis.cleanupPositioner?.()\n\n\t\t\t\t// Hide portal when dropdown is closed\n\t\t\t\tif (this.portal) {\n\t\t\t\t\tthis.portal.style.display = 'none'\n\t\t\t\t\tthis.portal.innerHTML = ''\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Setup floating UI positioning with teleportation\n\t */\n\tprivate setupPositioner() {\n\t\tif (!this.triggerContainer || !this.portal) return\n\n\t\t// Show the portal\n\t\tthis.portal.style.display = 'block'\n\n\t\t// Move content to portal\n\t\tthis.teleportContentToPortal()\n\n\t\t// Setup positioning\n\t\tthis.cleanupPositioner = autoUpdate(this.triggerContainer, this.portal, () => {\n\t\t\tcomputePosition(this.triggerContainer, this.portal, {\n\t\t\t\tplacement: this.placement,\n\t\t\t\tmiddleware: [\n\t\t\t\t\toffset(this.distance),\n\t\t\t\t\tflip({\n\t\t\t\t\t\tfallbackPlacements: ['top-start', 'bottom-start'],\n\t\t\t\t\t}),\n\t\t\t\t\tshift({ padding: 0 }),\n\t\t\t\t],\n\t\t\t}).then(({ x, y }) => {\n\t\t\t\t// Update portal position\n\t\t\t\tObject.assign(this.portal.style, {\n\t\t\t\t\tleft: `${x}px`,\n\t\t\t\t\ttop: `${y - 8}px`,\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Move slotted content to the portal\n\t */\n\tprivate teleportContentToPortal() {\n\t\tif (!this.portal) return\n\n\t\t// Clear existing content\n\t\tthis.portal.innerHTML = ''\n\n\t\t// Clone and move slotted content to portal\n\t\tthis.contentElements.forEach(element => {\n\t\t\t// Get computed styles to ensure portal content matches original styling\n\t\t\tconst clonedElement = element.cloneNode(true) as HTMLElement\n\n\t\t\t// Ensure dropdown-content elements maintain their styles when teleported\n\t\t\tif (element.tagName.toLowerCase() === 'schmancy-dropdown-content') {\n\t\t\t\tclonedElement.addEventListener('slotchange', () => {\n\t\t\t\t\t// Propagate any slot changes to class changes on children\n\t\t\t\t\tconst contentDiv = clonedElement.shadowRoot?.querySelector('[part=\"content\"]')\n\t\t\t\t\tif (contentDiv) {\n\t\t\t\t\t\tcontentDiv.classList.add('schmancy-dropdown-content')\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tthis.portal?.appendChild(clonedElement)\n\t\t})\n\t}\n\n\t/**\n\t * Handle trigger click to toggle dropdown\n\t */\n\tprivate handleTriggerClick(e: Event) {\n\t\te.stopPropagation()\n\t\tthis.toggle()\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<div class=\"trigger-container\" @click=${this.handleTriggerClick}>\n\t\t\t\t<slot name=\"trigger\"></slot>\n\t\t\t</div>\n\n\t\t\t<div class=\"dropdown-content-container\" ?hidden=${!this.open}>\n\t\t\t\t<slot\n\t\t\t\t\t@slotchange=${() => {\n\t\t\t\t\t\tif (this.open) {\n\t\t\t\t\t\t\tthis.teleportContentToPortal()\n\t\t\t\t\t\t\tthis.setupPositioner()\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t></slot>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-dropdown': SchmancyDropdown\n\t}\n}\n","import { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\n/**\n * Content container for the schmancy-dropdown component.\n *\n * @element schmancy-dropdown-content\n * @slot - Default slot for dropdown content\n */\n@customElement('schmancy-dropdown-content')\nexport class SchmancyDropdownContent extends TailwindElement(css`\n\t:host {\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\tz-index: 1000;\n\t\tmin-width: 10rem;\n\t\tpadding: 0.5rem 0;\n\t\tmargin: 0;\n\t\ttext-align: left;\n\t\tlist-style: none;\n\t\tbackground-color: var(--schmancy-sys-color-surface-container);\n\t\tbackground-clip: padding-box;\n\t\tborder-radius: 0.375rem;\n\t\tbox-shadow: var(--schmancy-sys-elevation-3);\n\t\twill-change: transform;\n\t\ttransform-origin: top left;\n\t\tanimation: dropdownAnimation 0.1s ease-out forwards;\n\t}\n\n\t:host([hidden]) {\n\t\tdisplay: none;\n\t}\n\n\t@keyframes dropdownAnimation {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t\ttransform: scale(0.95);\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t\ttransform: scale(1);\n\t\t}\n\t}\n\n\t/* Apply styles to content both in the component and when teleported to the portal */\n\t.schmancy-dropdown-content {\n\t\tbackground-color: var(--schmancy-sys-color-surface-container);\n\t\tborder-radius: 0.375rem;\n\t\tbox-shadow: var(--schmancy-sys-elevation-3);\n\t\tpadding: 0.5rem 0;\n\t\twill-change: transform;\n\t\ttransform-origin: top left;\n\t\tanimation: dropdownAnimation 0.1s ease-out forwards;\n\t}\n`) {\n\t/**\n\t * Width of the dropdown content\n\t */\n\t@property({ type: String })\n\twidth: string = 'auto'\n\n\t/**\n\t * Maximum height of the dropdown content\n\t */\n\t@property({ type: String })\n\tmaxHeight: string = '80vh'\n\n\t/**\n\t * Whether to render with a shadow\n\t */\n\t@property({ type: Boolean })\n\tshadow: boolean = true\n\n\t/**\n\t * Border radius style\n\t */\n\t@property({ type: String })\n\tradius: 'none' | 'sm' | 'md' | 'lg' | 'full' = 'md'\n\n\trender() {\n\t\tconst classes = {\n\t\t\t'schmancy-dropdown-content': true,\n\t\t\t'overflow-auto': true,\n\t\t\t'shadow-none': !this.shadow,\n\t\t\t'rounded-none': this.radius === 'none',\n\t\t\t'rounded-sm': this.radius === 'sm',\n\t\t\t'rounded-md': this.radius === 'md',\n\t\t\t'rounded-lg': this.radius === 'lg',\n\t\t\t'rounded-full': this.radius === 'full',\n\t\t}\n\n\t\tconst styles = {\n\t\t\twidth: this.width,\n\t\t\tmaxHeight: this.maxHeight,\n\t\t}\n\n\t\treturn html`\n\t\t\t<div class=${this.classMap(classes)} style=${this.styleMap(styles)} part=\"content\">\n\t\t\t\t<slot></slot>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-dropdown-content': SchmancyDropdownContent\n\t}\n}\n"],"names":["SchmancyDropdown","$LitElement","css","super","arguments","this","open","placement","distance","portal","connectedCallback","setupPortal","fromEvent","document","pipe","filter","isEventFromSelf","event","takeUntil","disconnecting","subscribe","key","portalContainer","getElementById","createElement","id","style","position","zIndex","top","left","pointerEvents","body","appendChild","className","display","composedPath","some","el","cleanupPositioner","remove","disconnectedCallback","changedProps","updated","has","setupPositioner","innerHTML","triggerContainer","teleportContentToPortal","autoUpdate","computePosition","middleware","offset","flip","fallbackPlacements","shift","padding","then","x","y","Object","assign","contentElements","forEach","element","clonedElement","cloneNode","tagName","toLowerCase","addEventListener","contentDiv","shadowRoot","querySelector","classList","add","e","stopPropagation","toggle","html","handleTriggerClick","__decorateClass","property","type","Boolean","reflect","prototype","String","Number","query","queryAssignedElements","flatten","state","slot","customElement","SchmancyDropdownContent","TailwindElement","constructor","width","maxHeight","shadow","radius","classes","styles","classMap","styleMap"],"mappings":"+dAcaA,QAAAA,iBAAN,cAA+BC,EAAAA,YAAYC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAA3C,CAAA,CAAA,cAAAC,MAAAC,GAAAA,SAAAA,EAUCC,KAAAC,KAAAA,GAkBSD,KAAAE,UAAA,eAMLF,KAAAG,SAAA,EAKFH,KAAQI,OAA6B,IAAA,CAO9C,mBAAAC,CACCP,MAAMO,kBAAAA,EAGNL,KAAKM,YAGiBC,EAAAA,YAAAC,SAAU,SAC9BC,KACAC,YAAgBV,KAAKC,MAASD,CAAAA,KAAKW,gBAAgBC,CAAAA,CAAAA,EACnDC,EAAAA,UAAUb,KAAKc,aAEfC,CAAAA,EAAAA,UAAU,KACVf,KAAKC,KAAAA,EAAO,CAAA,EAIWM,YAAAC,SAAU,SACjCC,EAAAA,KACAC,SAAgBE,GAAAZ,KAAKC,MAAQW,EAAMI,MAAQ,QAARA,EACnCH,EAAAA,UAAUb,KAAKc,aAEfC,CAAAA,EAAAA,UAAU,IACVf,CAAAA,KAAKC,OAAO,CAAA,CACZ,CAMK,cAEH,IAAAgB,EAAkBT,SAASU,eAAe,2BAAA,EAGzCD,IACcA,EAAAT,SAASW,cAAc,KAAA,E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AMC,EAAU,CACf,4BAA6B,GAC7B,gBAAiB,GACjB,cAAgBhG,CAAAA,KAAK8F,OACrB,eAAgB9F,KAAK+F,SAAW,OAChC,aAAc/F,KAAK+F,SAAW,KAC9B,aAAc/F,KAAK+F,SAAW,KAC9B,aAAc/F,KAAK+F,SAAW,KAC9B,eAAgB/F,KAAK+F,SAAW,MAAXA,EAGhBE,EAAS,CACdL,MAAO5F,KAAK4F,MACZC,UAAW7F,KAAK6F,SAAAA,EAGV,OAAApB,EAAAA;AAAAA,gBACOzE,KAAKkG,SAASF,CAAkBhG,CAAAA,UAAAA,KAAKmG,SAASF,CAAAA,CAAAA;AAAAA;AAAAA;AAAAA,GAAO,CAtCpEtB,EAAAA,EAAA,CADCC,WAAS,CAAEC,KAAMI,MAhDNQ,CAAAA,CAAAA,EAAAA,gCAiDZT,UAAA,QAAA,CAAA,EAMAL,EAAA,CADCC,WAAS,CAAEC,KAAMI,MAAAA,CAAAA,CAAAA,EAtDNQ,gCAuDZT,UAAA,YAAA,CAMAL,EAAAA,EAAA,CADCC,WAAS,CAAEC,KAAMC,OA5DNW,CAAAA,CAAAA,EAAAA,gCA6DZT,UAAA,SAAA,CAAA,EAMAL,EAAA,CADCC,WAAS,CAAEC,KAAMI,UAlENQ,gCAmEZT,UAAA,SAAA,CAnEYS,EAAAA,QAANA,wBAAAd,EAAA,CADNa,EAAAA,cAAc,2BAAA,CAAA,EACFC"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { autoUpdate as v, computePosition as k, offset as P, flip as x, shift as C } from "@floating-ui/dom";
|
|
2
|
+
import { fromEvent as h, filter as m, takeUntil as y } from "rxjs";
|
|
3
|
+
import "lit/directives/class-map.js";
|
|
4
|
+
import "lit/directives/style-map.js";
|
|
5
|
+
import { $ as E } from "./litElement.mixin-DamySMT5.js";
|
|
6
|
+
import { T as S } from "./tailwind.mixin-CgdpQXVy.js";
|
|
7
|
+
import { css as f, html as w } from "lit";
|
|
8
|
+
import { property as l, query as u, queryAssignedElements as g, state as T, customElement as b } from "lit/decorators.js";
|
|
9
|
+
var $ = Object.defineProperty, O = Object.getOwnPropertyDescriptor, i = (t, e, s, n) => {
|
|
10
|
+
for (var r, o = n > 1 ? void 0 : n ? O(e, s) : e, p = t.length - 1; p >= 0; p--) (r = t[p]) && (o = (n ? r(e, s, o) : r(o)) || o);
|
|
11
|
+
return n && o && $(e, s, o), o;
|
|
12
|
+
};
|
|
13
|
+
let a = class extends E(f`
|
|
14
|
+
:host {
|
|
15
|
+
display: inline-block;
|
|
16
|
+
position: relative;
|
|
17
|
+
}
|
|
18
|
+
`) {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments), this.open = !1, this.placement = "bottom-start", this.distance = 8, this.portal = null;
|
|
21
|
+
}
|
|
22
|
+
connectedCallback() {
|
|
23
|
+
super.connectedCallback(), this.setupPortal(), h(document, "click").pipe(m((t) => this.open && !this.isEventFromSelf(t)), y(this.disconnecting)).subscribe(() => {
|
|
24
|
+
this.open = !1;
|
|
25
|
+
}), h(document, "keydown").pipe(m((t) => this.open && t.key === "Escape"), y(this.disconnecting)).subscribe(() => {
|
|
26
|
+
this.open = !1;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
setupPortal() {
|
|
30
|
+
let t = document.getElementById("schmancy-portal-container");
|
|
31
|
+
t || (t = document.createElement("div"), t.id = "schmancy-portal-container", t.style.position = "fixed", t.style.zIndex = "10000", t.style.top = "0", t.style.left = "0", t.style.pointerEvents = "none", document.body.appendChild(t));
|
|
32
|
+
const e = document.createElement("div");
|
|
33
|
+
e.className = "schmancy-dropdown-portal", e.style.position = "absolute", e.style.pointerEvents = "auto", e.style.display = "none", t.appendChild(e), this.portal = e;
|
|
34
|
+
}
|
|
35
|
+
isEventFromSelf(t) {
|
|
36
|
+
return t.composedPath().some((e) => e === this);
|
|
37
|
+
}
|
|
38
|
+
disconnectedCallback() {
|
|
39
|
+
var t;
|
|
40
|
+
(t = this.cleanupPositioner) == null || t.call(this), this.portal && (this.portal.remove(), this.portal = null), super.disconnectedCallback();
|
|
41
|
+
}
|
|
42
|
+
toggle() {
|
|
43
|
+
this.open = !this.open;
|
|
44
|
+
}
|
|
45
|
+
updated(t) {
|
|
46
|
+
var e;
|
|
47
|
+
super.updated(t), t.has("open") && (this.open ? this.setupPositioner() : ((e = this.cleanupPositioner) == null || e.call(this), this.portal && (this.portal.style.display = "none", this.portal.innerHTML = "")));
|
|
48
|
+
}
|
|
49
|
+
setupPositioner() {
|
|
50
|
+
this.triggerContainer && this.portal && (this.portal.style.display = "block", this.teleportContentToPortal(), this.cleanupPositioner = v(this.triggerContainer, this.portal, () => {
|
|
51
|
+
k(this.triggerContainer, this.portal, { placement: this.placement, middleware: [P(this.distance), x({ fallbackPlacements: ["top-start", "bottom-start"] }), C({ padding: 0 })] }).then(({ x: t, y: e }) => {
|
|
52
|
+
Object.assign(this.portal.style, { left: `${t}px`, top: e - 8 + "px" });
|
|
53
|
+
});
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
teleportContentToPortal() {
|
|
57
|
+
this.portal && (this.portal.innerHTML = "", this.contentElements.forEach((t) => {
|
|
58
|
+
var s;
|
|
59
|
+
const e = t.cloneNode(!0);
|
|
60
|
+
t.tagName.toLowerCase() === "schmancy-dropdown-content" && e.addEventListener("slotchange", () => {
|
|
61
|
+
var r;
|
|
62
|
+
const n = (r = e.shadowRoot) == null ? void 0 : r.querySelector('[part="content"]');
|
|
63
|
+
n && n.classList.add("schmancy-dropdown-content");
|
|
64
|
+
}), (s = this.portal) == null || s.appendChild(e);
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
handleTriggerClick(t) {
|
|
68
|
+
t.stopPropagation(), this.toggle();
|
|
69
|
+
}
|
|
70
|
+
render() {
|
|
71
|
+
return w`
|
|
72
|
+
<div class="trigger-container" @click=${this.handleTriggerClick}>
|
|
73
|
+
<slot name="trigger"></slot>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<div class="dropdown-content-container" ?hidden=${!this.open}>
|
|
77
|
+
<slot
|
|
78
|
+
@slotchange=${() => {
|
|
79
|
+
this.open && (this.teleportContentToPortal(), this.setupPositioner());
|
|
80
|
+
}}
|
|
81
|
+
></slot>
|
|
82
|
+
</div>
|
|
83
|
+
`;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
i([l({ type: Boolean, reflect: !0 })], a.prototype, "open", 2), i([l({ type: String })], a.prototype, "placement", 2), i([l({ type: Number })], a.prototype, "distance", 2), i([u(".trigger-container")], a.prototype, "triggerContainer", 2), i([u(".dropdown-content-container")], a.prototype, "contentContainer", 2), i([g({ flatten: !0 })], a.prototype, "contentElements", 2), i([T()], a.prototype, "portal", 2), i([g({ slot: "trigger", flatten: !0 })], a.prototype, "triggerElements", 2), a = i([b("schmancy-dropdown")], a);
|
|
87
|
+
var j = Object.defineProperty, H = Object.getOwnPropertyDescriptor, c = (t, e, s, n) => {
|
|
88
|
+
for (var r, o = n > 1 ? void 0 : n ? H(e, s) : e, p = t.length - 1; p >= 0; p--) (r = t[p]) && (o = (n ? r(e, s, o) : r(o)) || o);
|
|
89
|
+
return n && o && j(e, s, o), o;
|
|
90
|
+
};
|
|
91
|
+
let d = class extends S(f`
|
|
92
|
+
:host {
|
|
93
|
+
display: block;
|
|
94
|
+
position: absolute;
|
|
95
|
+
z-index: 1000;
|
|
96
|
+
min-width: 10rem;
|
|
97
|
+
padding: 0.5rem 0;
|
|
98
|
+
margin: 0;
|
|
99
|
+
text-align: left;
|
|
100
|
+
list-style: none;
|
|
101
|
+
background-color: var(--schmancy-sys-color-surface-container);
|
|
102
|
+
background-clip: padding-box;
|
|
103
|
+
border-radius: 0.375rem;
|
|
104
|
+
box-shadow: var(--schmancy-sys-elevation-3);
|
|
105
|
+
will-change: transform;
|
|
106
|
+
transform-origin: top left;
|
|
107
|
+
animation: dropdownAnimation 0.1s ease-out forwards;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
:host([hidden]) {
|
|
111
|
+
display: none;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@keyframes dropdownAnimation {
|
|
115
|
+
from {
|
|
116
|
+
opacity: 0;
|
|
117
|
+
transform: scale(0.95);
|
|
118
|
+
}
|
|
119
|
+
to {
|
|
120
|
+
opacity: 1;
|
|
121
|
+
transform: scale(1);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* Apply styles to content both in the component and when teleported to the portal */
|
|
126
|
+
.schmancy-dropdown-content {
|
|
127
|
+
background-color: var(--schmancy-sys-color-surface-container);
|
|
128
|
+
border-radius: 0.375rem;
|
|
129
|
+
box-shadow: var(--schmancy-sys-elevation-3);
|
|
130
|
+
padding: 0.5rem 0;
|
|
131
|
+
will-change: transform;
|
|
132
|
+
transform-origin: top left;
|
|
133
|
+
animation: dropdownAnimation 0.1s ease-out forwards;
|
|
134
|
+
}
|
|
135
|
+
`) {
|
|
136
|
+
constructor() {
|
|
137
|
+
super(...arguments), this.width = "auto", this.maxHeight = "80vh", this.shadow = !0, this.radius = "md";
|
|
138
|
+
}
|
|
139
|
+
render() {
|
|
140
|
+
const t = { "schmancy-dropdown-content": !0, "overflow-auto": !0, "shadow-none": !this.shadow, "rounded-none": this.radius === "none", "rounded-sm": this.radius === "sm", "rounded-md": this.radius === "md", "rounded-lg": this.radius === "lg", "rounded-full": this.radius === "full" }, e = { width: this.width, maxHeight: this.maxHeight };
|
|
141
|
+
return w`
|
|
142
|
+
<div class=${this.classMap(t)} style=${this.styleMap(e)} part="content">
|
|
143
|
+
<slot></slot>
|
|
144
|
+
</div>
|
|
145
|
+
`;
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
c([l({ type: String })], d.prototype, "width", 2), c([l({ type: String })], d.prototype, "maxHeight", 2), c([l({ type: Boolean })], d.prototype, "shadow", 2), c([l({ type: String })], d.prototype, "radius", 2), d = c([b("schmancy-dropdown-content")], d);
|
|
149
|
+
export {
|
|
150
|
+
a as S,
|
|
151
|
+
d as a
|
|
152
|
+
};
|
|
153
|
+
//# sourceMappingURL=dropdown-content-DmqNgUQQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown-content-DmqNgUQQ.js","sources":["../src/dropdown/dropdown-component.ts","../src/dropdown/dropdown-content.ts"],"sourcesContent":["import { autoUpdate, computePosition, flip, offset, shift } from '@floating-ui/dom'\nimport { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property, query, queryAssignedElements, state } from 'lit/decorators.js'\nimport { filter, fromEvent, takeUntil } from 'rxjs'\n\n/**\n * A dropdown component that displays content when triggered.\n *\n * @element schmancy-dropdown\n * @slot trigger - The element that triggers the dropdown\n * @slot - Default slot for the dropdown content\n */\n@customElement('schmancy-dropdown')\nexport class SchmancyDropdown extends $LitElement(css`\n\t:host {\n\t\tdisplay: inline-block;\n\t\tposition: relative;\n\t}\n`) {\n\t/**\n\t * Whether the dropdown is currently open\n\t */\n\t@property({ type: Boolean, reflect: true })\n\topen = false\n\n\t/**\n\t * Placement of the dropdown relative to the trigger\n\t */\n\t@property({ type: String })\n\tplacement:\n\t\t| 'top'\n\t\t| 'top-start'\n\t\t| 'top-end'\n\t\t| 'right'\n\t\t| 'right-start'\n\t\t| 'right-end'\n\t\t| 'bottom'\n\t\t| 'bottom-start'\n\t\t| 'bottom-end'\n\t\t| 'left'\n\t\t| 'left-start'\n\t\t| 'left-end' = 'bottom-start'\n\n\t/**\n\t * Offset distance in pixels\n\t */\n\t@property({ type: Number })\n\tdistance = 8\n\n\t@query('.trigger-container') triggerContainer!: HTMLElement\n\t@query('.dropdown-content-container') contentContainer!: HTMLElement\n\t@queryAssignedElements({ flatten: true }) contentElements!: HTMLElement[]\n\t@state() private portal: HTMLElement | null = null\n\n\t@queryAssignedElements({ slot: 'trigger', flatten: true })\n\ttriggerElements!: Array<HTMLElement>\n\n\tprivate cleanupPositioner?: () => void\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\n\t\t// Create portal container for teleporting content to document body\n\t\tthis.setupPortal()\n\n\t\t// Listen for document clicks to close dropdown when clicking outside\n\t\tfromEvent<MouseEvent>(document, 'click')\n\t\t\t.pipe(\n\t\t\t\tfilter(event => this.open && !this.isEventFromSelf(event)),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.open = false\n\t\t\t})\n\n\t\t// Listen for escape key to close dropdown\n\t\tfromEvent<KeyboardEvent>(document, 'keydown')\n\t\t\t.pipe(\n\t\t\t\tfilter(event => this.open && event.key === 'Escape'),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.open = false\n\t\t\t})\n\t}\n\n\t/**\n\t * Set up the portal element for teleporting content\n\t */\n\tprivate setupPortal() {\n\t\t// Check if portal container exists\n\t\tlet portalContainer = document.getElementById('schmancy-portal-container')\n\n\t\t// Create portal container if it doesn't exist\n\t\tif (!portalContainer) {\n\t\t\tportalContainer = document.createElement('div')\n\t\t\tportalContainer.id = 'schmancy-portal-container'\n\t\t\tportalContainer.style.position = 'fixed'\n\t\t\tportalContainer.style.zIndex = '10000'\n\t\t\tportalContainer.style.top = '0'\n\t\t\tportalContainer.style.left = '0'\n\t\t\tportalContainer.style.pointerEvents = 'none'\n\t\t\tdocument.body.appendChild(portalContainer)\n\t\t}\n\n\t\t// Create portal for this specific dropdown\n\t\tconst portal = document.createElement('div')\n\t\tportal.className = 'schmancy-dropdown-portal'\n\t\tportal.style.position = 'absolute'\n\t\tportal.style.pointerEvents = 'auto'\n\t\tportal.style.display = 'none'\n\t\tportalContainer.appendChild(portal)\n\n\t\tthis.portal = portal\n\t}\n\n\t/**\n\t * Check if an event originated from within this component\n\t */\n\tprivate isEventFromSelf(event: Event): boolean {\n\t\treturn event.composedPath().some(el => el === this)\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.cleanupPositioner?.()\n\n\t\t// Remove portal when component is disconnected\n\t\tif (this.portal) {\n\t\t\tthis.portal.remove()\n\t\t\tthis.portal = null\n\t\t}\n\n\t\tsuper.disconnectedCallback()\n\t}\n\n\t/**\n\t * Toggle the dropdown open state\n\t */\n\ttoggle() {\n\t\tthis.open = !this.open\n\t}\n\n\tupdated(changedProps: Map<string, any>) {\n\t\tsuper.updated(changedProps)\n\n\t\tif (changedProps.has('open')) {\n\t\t\tif (this.open) {\n\t\t\t\tthis.setupPositioner()\n\t\t\t} else {\n\t\t\t\tthis.cleanupPositioner?.()\n\n\t\t\t\t// Hide portal when dropdown is closed\n\t\t\t\tif (this.portal) {\n\t\t\t\t\tthis.portal.style.display = 'none'\n\t\t\t\t\tthis.portal.innerHTML = ''\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Setup floating UI positioning with teleportation\n\t */\n\tprivate setupPositioner() {\n\t\tif (!this.triggerContainer || !this.portal) return\n\n\t\t// Show the portal\n\t\tthis.portal.style.display = 'block'\n\n\t\t// Move content to portal\n\t\tthis.teleportContentToPortal()\n\n\t\t// Setup positioning\n\t\tthis.cleanupPositioner = autoUpdate(this.triggerContainer, this.portal, () => {\n\t\t\tcomputePosition(this.triggerContainer, this.portal, {\n\t\t\t\tplacement: this.placement,\n\t\t\t\tmiddleware: [\n\t\t\t\t\toffset(this.distance),\n\t\t\t\t\tflip({\n\t\t\t\t\t\tfallbackPlacements: ['top-start', 'bottom-start'],\n\t\t\t\t\t}),\n\t\t\t\t\tshift({ padding: 0 }),\n\t\t\t\t],\n\t\t\t}).then(({ x, y }) => {\n\t\t\t\t// Update portal position\n\t\t\t\tObject.assign(this.portal.style, {\n\t\t\t\t\tleft: `${x}px`,\n\t\t\t\t\ttop: `${y - 8}px`,\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Move slotted content to the portal\n\t */\n\tprivate teleportContentToPortal() {\n\t\tif (!this.portal) return\n\n\t\t// Clear existing content\n\t\tthis.portal.innerHTML = ''\n\n\t\t// Clone and move slotted content to portal\n\t\tthis.contentElements.forEach(element => {\n\t\t\t// Get computed styles to ensure portal content matches original styling\n\t\t\tconst clonedElement = element.cloneNode(true) as HTMLElement\n\n\t\t\t// Ensure dropdown-content elements maintain their styles when teleported\n\t\t\tif (element.tagName.toLowerCase() === 'schmancy-dropdown-content') {\n\t\t\t\tclonedElement.addEventListener('slotchange', () => {\n\t\t\t\t\t// Propagate any slot changes to class changes on children\n\t\t\t\t\tconst contentDiv = clonedElement.shadowRoot?.querySelector('[part=\"content\"]')\n\t\t\t\t\tif (contentDiv) {\n\t\t\t\t\t\tcontentDiv.classList.add('schmancy-dropdown-content')\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tthis.portal?.appendChild(clonedElement)\n\t\t})\n\t}\n\n\t/**\n\t * Handle trigger click to toggle dropdown\n\t */\n\tprivate handleTriggerClick(e: Event) {\n\t\te.stopPropagation()\n\t\tthis.toggle()\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<div class=\"trigger-container\" @click=${this.handleTriggerClick}>\n\t\t\t\t<slot name=\"trigger\"></slot>\n\t\t\t</div>\n\n\t\t\t<div class=\"dropdown-content-container\" ?hidden=${!this.open}>\n\t\t\t\t<slot\n\t\t\t\t\t@slotchange=${() => {\n\t\t\t\t\t\tif (this.open) {\n\t\t\t\t\t\t\tthis.teleportContentToPortal()\n\t\t\t\t\t\t\tthis.setupPositioner()\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t></slot>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-dropdown': SchmancyDropdown\n\t}\n}\n","import { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\n/**\n * Content container for the schmancy-dropdown component.\n *\n * @element schmancy-dropdown-content\n * @slot - Default slot for dropdown content\n */\n@customElement('schmancy-dropdown-content')\nexport class SchmancyDropdownContent extends TailwindElement(css`\n\t:host {\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\tz-index: 1000;\n\t\tmin-width: 10rem;\n\t\tpadding: 0.5rem 0;\n\t\tmargin: 0;\n\t\ttext-align: left;\n\t\tlist-style: none;\n\t\tbackground-color: var(--schmancy-sys-color-surface-container);\n\t\tbackground-clip: padding-box;\n\t\tborder-radius: 0.375rem;\n\t\tbox-shadow: var(--schmancy-sys-elevation-3);\n\t\twill-change: transform;\n\t\ttransform-origin: top left;\n\t\tanimation: dropdownAnimation 0.1s ease-out forwards;\n\t}\n\n\t:host([hidden]) {\n\t\tdisplay: none;\n\t}\n\n\t@keyframes dropdownAnimation {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t\ttransform: scale(0.95);\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t\ttransform: scale(1);\n\t\t}\n\t}\n\n\t/* Apply styles to content both in the component and when teleported to the portal */\n\t.schmancy-dropdown-content {\n\t\tbackground-color: var(--schmancy-sys-color-surface-container);\n\t\tborder-radius: 0.375rem;\n\t\tbox-shadow: var(--schmancy-sys-elevation-3);\n\t\tpadding: 0.5rem 0;\n\t\twill-change: transform;\n\t\ttransform-origin: top left;\n\t\tanimation: dropdownAnimation 0.1s ease-out forwards;\n\t}\n`) {\n\t/**\n\t * Width of the dropdown content\n\t */\n\t@property({ type: String })\n\twidth: string = 'auto'\n\n\t/**\n\t * Maximum height of the dropdown content\n\t */\n\t@property({ type: String })\n\tmaxHeight: string = '80vh'\n\n\t/**\n\t * Whether to render with a shadow\n\t */\n\t@property({ type: Boolean })\n\tshadow: boolean = true\n\n\t/**\n\t * Border radius style\n\t */\n\t@property({ type: String })\n\tradius: 'none' | 'sm' | 'md' | 'lg' | 'full' = 'md'\n\n\trender() {\n\t\tconst classes = {\n\t\t\t'schmancy-dropdown-content': true,\n\t\t\t'overflow-auto': true,\n\t\t\t'shadow-none': !this.shadow,\n\t\t\t'rounded-none': this.radius === 'none',\n\t\t\t'rounded-sm': this.radius === 'sm',\n\t\t\t'rounded-md': this.radius === 'md',\n\t\t\t'rounded-lg': this.radius === 'lg',\n\t\t\t'rounded-full': this.radius === 'full',\n\t\t}\n\n\t\tconst styles = {\n\t\t\twidth: this.width,\n\t\t\tmaxHeight: this.maxHeight,\n\t\t}\n\n\t\treturn html`\n\t\t\t<div class=${this.classMap(classes)} style=${this.styleMap(styles)} part=\"content\">\n\t\t\t\t<slot></slot>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-dropdown-content': SchmancyDropdownContent\n\t}\n}\n"],"names":["SchmancyDropdown","$LitElement","css","super","arguments","this","open","placement","distance","portal","connectedCallback","setupPortal","fromEvent","document","pipe","filter","isEventFromSelf","event","takeUntil","disconnecting","subscribe","key","portalContainer","getElementById","createElement","id","style","position","zIndex","top","left","pointerEvents","body","appendChild","className","display","composedPath","some","el","cleanupPositioner","remove","disconnectedCallback","changedProps","updated","has","setupPositioner","innerHTML","triggerContainer","teleportContentToPortal","autoUpdate","computePosition","middleware","offset","flip","fallbackPlacements","shift","padding","then","x","y","Object","assign","contentElements","forEach","element","clonedElement","cloneNode","tagName","toLowerCase","addEventListener","contentDiv","shadowRoot","querySelector","classList","add","e","stopPropagation","toggle","render","html","handleTriggerClick","__decorateClass","property","type","Boolean","reflect","prototype","String","Number","query","queryAssignedElements","flatten","state","slot","customElement","SchmancyDropdownContent","TailwindElement","constructor","width","maxHeight","shadow","radius","classes","styles","classMap","styleMap"],"mappings":";;;;;;;;;;;;AAca,IAAAA,IAAN,cAA+BC,EAAYC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAA3C,EAAA;AAAA,EAAA,cAAAC;AAAAA,UAAAA,GAAAC,SAUCC,GAAAA,KAAAC,WAkBSD,KAAAE,YAAA,gBAMLF,KAAAG,WAAA,GAKFH,KAAQI,SAA6B;AAAA,EAAA;AAAA,EAO9C,oBACCN;AAAAA,UAA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AAAA,GAtDNQ,EAuDZT,WAAA,aAAA,CAMAL,GAAAA,EAAA,CADCC,EAAS,EAAEC,MAAMC,QAAAA,CAAAA,CAAAA,GA5DNW,EA6DZT,WAAA,UAAA,IAMAL,EAAA,CADCC,EAAS,EAAEC,MAAMI,YAlENQ,EAmEZT,WAAA,UAAA,CAnEYS,GAAAA,IAANd,EAAA,CADNa,EAAc,2BACFC,CAAAA,GAAAA,CAAAA;"}
|
package/dist/dropdown.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./dropdown-content-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./dropdown-content-CgwaiBpw.cjs");Object.defineProperty(exports,"SchmancyDropdown",{enumerable:!0,get:()=>e.SchmancyDropdown}),Object.defineProperty(exports,"SchmancyDropdownContent",{enumerable:!0,get:()=>e.SchmancyDropdownContent});
|
|
2
2
|
//# sourceMappingURL=dropdown.cjs.map
|
package/dist/dropdown.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("./animated-text-DykevNAQ.cjs");const c=require("./area.component-DAzIOTvX.cjs");require("./autocomplete-DB1BIFBS.cjs");const r=require("./teleport.component-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("./animated-text-DykevNAQ.cjs");const c=require("./area.component-DAzIOTvX.cjs");require("./autocomplete-DB1BIFBS.cjs");const r=require("./teleport.component-CnDx2oti.cjs");require("./spinner-DJUPKRaj.cjs");const l=require("./icon-button-DPm9yazs.cjs"),g=require("./checkbox-9PyWz5FJ.cjs");require("./chips-Bv2hdmMK.cjs");const f=require("./payment-card-form-DxD9nGB0.cjs"),C=require("./date-range-Dpvip0Kf.cjs"),h=require("./delay-D0Np7OmS.cjs"),S=require("./ripple-C2BHbhcS.cjs");require("./divider-B56pVfQK.cjs");const u=require("./timezone-BxvSIDGa.cjs");require("./form-DYaROiIF.cjs"),require("./icon-D5bKkv2u.cjs"),require("./input-DxJNIkJF.cjs");const a=require("./flex-Crv0q1Ni.cjs"),y=require("./list-BSiDxGZM.cjs");require("./menu-DO4J9xKl.cjs");const n=require("./notification-service-BFepRkx9.cjs");require("./option-DzxWSiKo.cjs");const O=require("./radio-group-ujiKRIzu.cjs"),D=require("./rxjs-utils.cjs");require("rxjs"),require("./index-DyJ0oDpR.cjs");const P=require("./select-8C2C6mqT.cjs"),o=require("./sheet-5NN9kqLw.cjs"),b=require("./slider-zbnPbKrH.cjs"),i=require("./schmancy-steps-container-C0r65UXb.cjs"),t=require("./context-object-CP7HbDFQ.cjs"),e=require("./selector-hook-wEJh3oTm.cjs"),p=require("./surface-B0EP0wlI.cjs"),s=require("./table-DSg5xpqj.cjs");require("./tabs-group-Dd-mfajz.cjs"),require("./textarea-znssoPdJ.cjs");const m=require("./theme.component-CJDShQ7P.cjs"),j=require("./theme.interface-Xg5Zi46a.cjs");require("./theme-button-BMe6kTMr.cjs");const q=require("./tooltip-BU1ScbI9.cjs"),w=require("./tree-DJ0dLSbg.cjs"),T=require("./types.cjs"),M=require("./typewriter-a5uyOTf4.cjs"),I=require("./typography-BbsRPqla.cjs"),N=require("./intersection-CVvaDv96.cjs"),d=require("./dropdown-content-CgwaiBpw.cjs");exports.FINDING_MORTIES=c.FINDING_MORTIES,exports.HERE_RICKY=c.HERE_RICKY,exports.HISTORY_STRATEGY=c.HISTORY_STRATEGY,Object.defineProperty(exports,"SchmancyArea",{enumerable:!0,get:()=>c.SchmancyArea}),exports.area=c.area,exports.routerHistory=c.routerHistory,exports.$drawer=r.$drawer,exports.HereMorty=r.HereMorty,Object.defineProperty(exports,"SchmancyBadgeV2",{enumerable:!0,get:()=>r.SchmancyBadgeV2}),Object.defineProperty(exports,"SchmancyContentDrawer",{enumerable:!0,get:()=>r.SchmancyContentDrawer}),exports.SchmancyContentDrawerID=r.SchmancyContentDrawerID,Object.defineProperty(exports,"SchmancyContentDrawerMain",{enumerable:!0,get:()=>r.SchmancyContentDrawerMain}),exports.SchmancyContentDrawerMaxHeight=r.SchmancyContentDrawerMaxHeight,exports.SchmancyContentDrawerMinWidth=r.SchmancyContentDrawerMinWidth,Object.defineProperty(exports,"SchmancyContentDrawerSheet",{enumerable:!0,get:()=>r.SchmancyContentDrawerSheet}),exports.SchmancyContentDrawerSheetMode=r.SchmancyContentDrawerSheetMode,exports.SchmancyContentDrawerSheetState=r.SchmancyContentDrawerSheetState,Object.defineProperty(exports,"SchmancyDrawerAppbar",{enumerable:!0,get:()=>r.SchmancyDrawerAppbar}),exports.SchmancyDrawerNavbarMode=r.SchmancyDrawerNavbarMode,exports.SchmancyDrawerNavbarState=r.SchmancyDrawerNavbarState,Object.defineProperty(exports,"SchmancyNavigationDrawer",{enumerable:!0,get:()=>r.SchmancyNavigationDrawer}),Object.defineProperty(exports,"SchmancyNavigationDrawerContent",{enumerable:!0,get:()=>r.SchmancyNavigationDrawerContent}),Object.defineProperty(exports,"SchmancyNavigationDrawerSidebar",{enumerable:!0,get:()=>r.SchmancyNavigationDrawerSidebar}),Object.defineProperty(exports,"SchmancyTeleportation",{enumerable:!0,get:()=>r.SchmancyTeleportation}),exports.WhereAreYouRicky=r.WhereAreYouRicky,exports.schmancyContentDrawer=r.schmancyContentDrawer,exports.schmancyNavDrawer=r.schmancyNavDrawer,exports.teleport=r.teleport,Object.defineProperty(exports,"SchmancyButton",{enumerable:!0,get:()=>l.SchmancyButton}),Object.defineProperty(exports,"SchmnacyIconButton",{enumerable:!0,get:()=>l.SchmnacyIconButton}),Object.defineProperty(exports,"SchmancyCheckbox",{enumerable:!0,get:()=>g.SchmancyCheckbox}),Object.defineProperty(exports,"SchmancyPaymentCardForm",{enumerable:!0,get:()=>f.SchmancyPaymentCardForm}),Object.defineProperty(exports,"SchmancyDateRange",{enumerable:!0,get:()=>C.SchmancyDateRange}),Object.defineProperty(exports,"SchmancyDelay",{enumerable:!0,get:()=>h.SchmancyDelay}),exports.delayContext=h.delayContext,exports.color=S.color,exports.fullHeight=S.fullHeight,exports.ripple=S.ripple,Object.defineProperty(exports,"SchmancyCountriesSelect",{enumerable:!0,get:()=>u.SchmancyCountriesSelect}),Object.defineProperty(exports,"SchmancyTimezonesSelect",{enumerable:!0,get:()=>u.SchmancyTimezonesSelect}),Object.defineProperty(exports,"SchmancyFlex",{enumerable:!0,get:()=>a.SchmancyFlex}),Object.defineProperty(exports,"SchmancyFlexV2",{enumerable:!0,get:()=>a.SchmancyFlexV2}),Object.defineProperty(exports,"SchmancyGrid",{enumerable:!0,get:()=>a.SchmancyGrid}),Object.defineProperty(exports,"SchmancyScroll",{enumerable:!0,get:()=>a.SchmancyScroll}),Object.defineProperty(exports,"List",{enumerable:!0,get:()=>y.List}),Object.defineProperty(exports,"SchmancyListItem",{enumerable:!0,get:()=>y.SchmancyListItem}),exports.SchmancyListTypeContext=y.SchmancyListTypeContext,exports.$notify=n.$notify,exports.NotificationAudioService=n.NotificationAudioService,Object.defineProperty(exports,"SchmancyNotification",{enumerable:!0,get:()=>n.SchmancyNotification}),Object.defineProperty(exports,"SchmancyNotificationContainer",{enumerable:!0,get:()=>n.SchmancyNotificationContainer}),Object.defineProperty(exports,"RadioGroup",{enumerable:!0,get:()=>O.RadioGroup}),exports.mutationObserver=D.mutationObserver,Object.defineProperty(exports,"SchmancySelect",{enumerable:!0,get:()=>P.SchmancySelect}),exports.SchmancySheetPosition=o.SchmancySheetPosition,exports.SheetHereMorty=o.SheetHereMorty,exports.SheetWhereAreYouRicky=o.SheetWhereAreYouRicky,exports.sheet=o.sheet,Object.defineProperty(exports,"SchmancySlide",{enumerable:!0,get:()=>b.SchmancySlide}),Object.defineProperty(exports,"SchmancySlider",{enumerable:!0,get:()=>b.SchmancySlider}),Object.defineProperty(exports,"SchmancyStep",{enumerable:!0,get:()=>i.SchmancyStep}),Object.defineProperty(exports,"SchmancyStepsContainer",{enumerable:!0,get:()=>i.SchmancyStepsContainer}),exports.StepsController=i.StepsController,exports.stepsContext=i.stepsContext,exports.BaseStore=t.BaseStore,exports.IndexedDBStorageManager=t.IndexedDBStorageManager,exports.LocalStorageManager=t.LocalStorageManager,exports.MemoryStorageManager=t.MemoryStorageManager,exports.SchmancyArrayStore=t.SchmancyArrayStore,exports.SchmancyStoreObject=t.SchmancyStoreObject,exports.SessionStorageManager=t.SessionStorageManager,exports.StoreError=t.StoreError,exports.createStorageManager=t.createStorageManager,exports.compareValues=e.compareValues,exports.createArrayContext=e.createArrayContext,exports.createCollectionSelector=e.createCollectionSelector,exports.createCompoundSelector=e.createCompoundSelector,exports.createContext=e.createContext,exports.createCountSelector=e.createCountSelector,exports.createEntriesSelector=e.createEntriesSelector,exports.createFilterSelector=e.createFilterSelector,exports.createFindSelector=e.createFindSelector,exports.createItemSelector=e.createItemSelector,exports.createItemsSelector=e.createItemsSelector,exports.createKeysSelector=e.createKeysSelector,exports.createMapSelector=e.createMapSelector,exports.createOptimizedSelector=e.createOptimizedSelector,exports.createSelector=e.createSelector,exports.createSortSelector=e.createSortSelector,exports.createTestArrayContext=e.createTestArrayContext,exports.filterArray=e.filterArray,exports.filterArrayItems=e.filterArrayItems,exports.filterMap=e.filterMap,exports.filterMapItems=e.filterMapItems,exports.getFieldValue=e.getFieldValue,exports.isArray=e.isArray,exports.isDate=e.isDate,exports.isIterable=e.isIterable,exports.isMap=e.isMap,exports.isNil=e.isNil,exports.isNumber=e.isNumber,exports.isPlainObject=e.isPlainObject,exports.isSet=e.isSet,exports.isString=e.isString,exports.select=e.select,exports.selectItem=e.selectItem,Object.defineProperty(exports,"SchmancySurface",{enumerable:!0,get:()=>p.SchmancySurface}),exports.SchmancySurfaceTypeContext=p.SchmancySurfaceTypeContext,Object.defineProperty(exports,"SchmancyDataTable",{enumerable:!0,get:()=>s.SchmancyDataTable}),Object.defineProperty(exports,"SchmancyTableRow",{enumerable:!0,get:()=>s.SchmancyTableRow}),Object.defineProperty(exports,"SchmancyThemeComponent",{enumerable:!0,get:()=>m.SchmancyThemeComponent}),exports.formateTheme=m.formateTheme,exports.tailwindStyles=m.tailwindStyles,exports.SchmancyTheme=j.SchmancyTheme,Object.defineProperty(exports,"SchmancyTooltip",{enumerable:!0,get:()=>q.SchmancyTooltip}),Object.defineProperty(exports,"SchmancyTree",{enumerable:!0,get:()=>w.SchmancyTree}),exports.SchmancyEvents=T.SchmancyEvents,Object.defineProperty(exports,"TypewriterElement",{enumerable:!0,get:()=>M.TypewriterElement}),Object.defineProperty(exports,"SchmancyTypography",{enumerable:!0,get:()=>I.SchmancyTypography}),exports.intersection$=N.intersection$,Object.defineProperty(exports,"SchmancyDropdown",{enumerable:!0,get:()=>d.SchmancyDropdown}),Object.defineProperty(exports,"SchmancyDropdownContent",{enumerable:!0,get:()=>d.SchmancyDropdownContent});
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./animated-text-lA1qYOb3.js";
|
|
2
2
|
import { F as C, H as d, b as D, S as w, a as g, r as b } from "./area.component-DbLTnRuW.js";
|
|
3
3
|
import "./autocomplete-VHq-wIav.js";
|
|
4
|
-
import { $ as T, H as u, S as I, f as N, c as A, g as R, d as v, e as E, h as F, a as H, b as B, j as L, l as O, m as k, n as G, k as Y, o as $, p as j, W as V, s as W, i as z, t as P } from "./teleport.component-
|
|
4
|
+
import { $ as T, H as u, S as I, f as N, c as A, g as R, d as v, e as E, h as F, a as H, b as B, j as L, l as O, m as k, n as G, k as Y, o as $, p as j, W as V, s as W, i as z, t as P } from "./teleport.component-DfjivpLV.js";
|
|
5
5
|
import "./spinner-BA-AdJft.js";
|
|
6
6
|
import { S as K, a as q } from "./icon-button-iP7bvDh9.js";
|
|
7
7
|
import { S as Q } from "./checkbox-D2X1Yff3.js";
|
|
@@ -43,7 +43,7 @@ import { SchmancyEvents as Ue } from "./types.js";
|
|
|
43
43
|
import { T as Ze } from "./typewriter-BhxAnEeh.js";
|
|
44
44
|
import { S as er } from "./typography-agkJjhZH.js";
|
|
45
45
|
import { i as tr } from "./intersection-CJxzz8c-.js";
|
|
46
|
-
import { S as cr, a as sr } from "./dropdown-content-
|
|
46
|
+
import { S as cr, a as sr } from "./dropdown-content-DmqNgUQQ.js";
|
|
47
47
|
export {
|
|
48
48
|
T as $drawer,
|
|
49
49
|
ga as $notify,
|
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-CnDx2oti.cjs");exports.$drawer=e.$drawer,Object.defineProperty(exports,"SchmancyDrawerAppbar",{enumerable:!0,get:()=>e.SchmancyDrawerAppbar}),exports.SchmancyDrawerNavbarMode=e.SchmancyDrawerNavbarMode,exports.SchmancyDrawerNavbarState=e.SchmancyDrawerNavbarState,Object.defineProperty(exports,"SchmancyNavigationDrawer",{enumerable:!0,get:()=>e.SchmancyNavigationDrawer}),Object.defineProperty(exports,"SchmancyNavigationDrawerContent",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerContent}),Object.defineProperty(exports,"SchmancyNavigationDrawerSidebar",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerSidebar}),exports.schmancyNavDrawer=e.schmancyNavDrawer;
|
|
2
2
|
//# sourceMappingURL=nav-drawer.cjs.map
|
package/dist/nav-drawer.js
CHANGED
package/dist/teleport.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-CnDx2oti.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 l=require("lit"),c=require("lit/decorators.js"),s=require("rxjs");require("./animated-text-DykevNAQ.cjs");const O=require("./area.component-DAzIOTvX.cjs");require("./autocomplete-DB1BIFBS.cjs"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const S=require("./tailwind.mixin-CAvg5VIG.cjs"),b=require("./ripple-C2BHbhcS.cjs");require("./spinner-DJUPKRaj.cjs"),require("./icon-button-DPm9yazs.cjs");const h=require("./theme.interface-Xg5Zi46a.cjs");require("./checkbox-9PyWz5FJ.cjs"),require("./chips-Bv2hdmMK.cjs"),require("./payment-card-form-DxD9nGB0.cjs");const m=require("./types.cjs"),d=require("./provide-BGGp1Iks.cjs"),v=require("./litElement.mixin-BDAc5mMz.cjs"),p=require("./consume-uKrSupzs.cjs");require("./date-range-Dpvip0Kf.cjs"),require("./delay-D0Np7OmS.cjs"),require("./divider-B56pVfQK.cjs"),require("./timezone-BxvSIDGa.cjs"),require("./form-DYaROiIF.cjs"),require("./icon-D5bKkv2u.cjs"),require("./input-DxJNIkJF.cjs"),require("./flex-Crv0q1Ni.cjs"),require("./list-BSiDxGZM.cjs"),require("./menu-DO4J9xKl.cjs");const A=require("lit/directives/when.js");require("./notification-service-BFepRkx9.cjs"),require("./option-DzxWSiKo.cjs"),require("./radio-group-ujiKRIzu.cjs"),require("./index-DyJ0oDpR.cjs"),require("./select-8C2C6mqT.cjs");const U=require("./sheet-5NN9kqLw.cjs");require("./slider-zbnPbKrH.cjs"),require("./schmancy-steps-container-C0r65UXb.cjs"),require("./context-object-CP7HbDFQ.cjs");const W=require("rxjs/operators");require("./surface-B0EP0wlI.cjs"),require("./table-DSg5xpqj.cjs"),require("./tabs-group-Dd-mfajz.cjs"),require("./textarea-znssoPdJ.cjs"),require("./theme.component-CJDShQ7P.cjs"),require("./theme-button-BMe6kTMr.cjs"),require("./tooltip-BU1ScbI9.cjs"),require("./tree-DJ0dLSbg.cjs"),require("./typewriter-a5uyOTf4.cjs"),require("./typography-BbsRPqla.cjs"),require("./dropdown-content-
|
|
1
|
+
"use strict";const l=require("lit"),c=require("lit/decorators.js"),s=require("rxjs");require("./animated-text-DykevNAQ.cjs");const O=require("./area.component-DAzIOTvX.cjs");require("./autocomplete-DB1BIFBS.cjs"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const S=require("./tailwind.mixin-CAvg5VIG.cjs"),b=require("./ripple-C2BHbhcS.cjs");require("./spinner-DJUPKRaj.cjs"),require("./icon-button-DPm9yazs.cjs");const h=require("./theme.interface-Xg5Zi46a.cjs");require("./checkbox-9PyWz5FJ.cjs"),require("./chips-Bv2hdmMK.cjs"),require("./payment-card-form-DxD9nGB0.cjs");const m=require("./types.cjs"),d=require("./provide-BGGp1Iks.cjs"),v=require("./litElement.mixin-BDAc5mMz.cjs"),p=require("./consume-uKrSupzs.cjs");require("./date-range-Dpvip0Kf.cjs"),require("./delay-D0Np7OmS.cjs"),require("./divider-B56pVfQK.cjs"),require("./timezone-BxvSIDGa.cjs"),require("./form-DYaROiIF.cjs"),require("./icon-D5bKkv2u.cjs"),require("./input-DxJNIkJF.cjs"),require("./flex-Crv0q1Ni.cjs"),require("./list-BSiDxGZM.cjs"),require("./menu-DO4J9xKl.cjs");const A=require("lit/directives/when.js");require("./notification-service-BFepRkx9.cjs"),require("./option-DzxWSiKo.cjs"),require("./radio-group-ujiKRIzu.cjs"),require("./index-DyJ0oDpR.cjs"),require("./select-8C2C6mqT.cjs");const U=require("./sheet-5NN9kqLw.cjs");require("./slider-zbnPbKrH.cjs"),require("./schmancy-steps-container-C0r65UXb.cjs"),require("./context-object-CP7HbDFQ.cjs");const W=require("rxjs/operators");require("./surface-B0EP0wlI.cjs"),require("./table-DSg5xpqj.cjs"),require("./tabs-group-Dd-mfajz.cjs"),require("./textarea-znssoPdJ.cjs"),require("./theme.component-CJDShQ7P.cjs"),require("./theme-button-BMe6kTMr.cjs"),require("./tooltip-BU1ScbI9.cjs"),require("./tree-DJ0dLSbg.cjs"),require("./typewriter-a5uyOTf4.cjs"),require("./typography-BbsRPqla.cjs"),require("./dropdown-content-CgwaiBpw.cjs");var Y=Object.defineProperty,F=Object.getOwnPropertyDescriptor,u=(e,t,n,i)=>{for(var a,r=i>1?void 0:i?F(t,n):t,o=e.length-1;o>=0;o--)(a=e[o])&&(r=(i?a(t,n,r):a(r))||r);return i&&r&&Y(t,n,r),r};exports.SchmancyBadgeV2=class extends S.TailwindElement(l.css`
|
|
2
2
|
:host {
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
}
|
|
@@ -203,4 +203,4 @@
|
|
|
203
203
|
class="${this.classMap({"fixed inset-0 z-49 hidden":!0})}"
|
|
204
204
|
></div>
|
|
205
205
|
`}},w([p.c({context:j,subscribe:!0}),c.state()],exports.SchmancyNavigationDrawerSidebar.prototype,"mode",2),w([p.c({context:z,subscribe:!0}),c.state()],exports.SchmancyNavigationDrawerSidebar.prototype,"drawerState",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),w([c.state()],exports.SchmancyNavigationDrawerSidebar.prototype,"_initialized",2),exports.SchmancyNavigationDrawerSidebar=w([c.customElement("schmancy-nav-drawer-navbar")],exports.SchmancyNavigationDrawerSidebar);const _="whereAreYouRicky",B="hereMorty",D=new class{constructor(){this.activeTeleportations=new Map,this.flipRequests=new s.Subject,this.find=e=>s.zip([s.fromEvent(window,B).pipe(s.filter(t=>!!t.detail.component.uuid&&!!e.id&&t.detail.component.id===e.id&&t.detail.component.uuid!==e.uuid),s.map(t=>t.detail.component),s.take(1)),s.of(e).pipe(s.tap(()=>{window.dispatchEvent(new CustomEvent(_,{detail:{id:e.id,callerID:e.uuid}}))}))]).pipe(s.map(([t])=>t),s.timeout(0)),this.flip=e=>{const{from:t,to:n}=e,i=n.element.style.zIndex;n.element.style.transformOrigin="top left",n.element.style.setProperty("visibility","visible"),n.element.style.zIndex="1000";const a=[{transform:`translate(${t.rect.left-n.rect.left}px, ${t.rect.top-n.rect.top}px) scale(${t.rect.width/n.rect.width}, ${t.rect.height/n.rect.height})`},{transform:"translate(0, 0) scale(1, 1)"}];n.element.animate(a,{duration:250,delay:10,easing:"cubic-bezier(0.455, 0.03, 0.515, 0.955)"}).onfinish=()=>{n.element.style.zIndex=i,n.element.style.transformOrigin=""}},this.flipRequests.pipe(s.bufferTime(1),s.map(e=>e.map(({from:t,to:n,host:i},a)=>({from:t,to:n,host:i,i:a}))),s.concatMap(e=>s.zip(e.map(t=>s.of(this.flip(t)))))).subscribe()}};function L(e){return s.interval(50).pipe(W.map(()=>e.getBoundingClientRect()),W.distinctUntilChanged((t,n)=>t.width===n.width&&t.height===n.height&&t.top===n.top&&t.right===n.right&&t.bottom===n.bottom&&t.left===n.left),W.take(1))}var we=Object.defineProperty,be=Object.getOwnPropertyDescriptor,$=(e,t,n,i)=>{for(var a,r=i>1?void 0:i?be(t,n):t,o=e.length-1;o>=0;o--)(a=e[o])&&(r=(i?a(t,n,r):a(r))||r);return i&&r&&we(t,n,r),r};exports.SchmancyTeleportation=class extends v.$LitElement(l.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(),s.merge(s.fromEvent(window,O.FINDING_MORTIES).pipe(s.tap({next:()=>{this.dispatchEvent(new CustomEvent(O.HERE_RICKY,{detail:{component:this},bubbles:!0,composed:!0}))}})),s.fromEvent(window,_).pipe(s.tap({next:e=>{e.detail.id===this.id&&this.uuid&&e.detail.callerID!==this.uuid&&this.dispatchEvent(new CustomEvent(B,{detail:{component:this},bubbles:!0,composed:!0}))}}))).pipe(s.takeUntil(this.disconnecting)).subscribe()}async firstUpdated(){s.of(D.activeTeleportations.get(this.id)).pipe(s.filter(e=>!!e),s.takeUntil(this.disconnecting),s.throwIfEmpty()).subscribe({next:e=>{this.style.setProperty("visibility","hidden"),L(this).pipe(s.takeUntil(this.disconnecting)).subscribe({next:t=>{D.activeTeleportations.set(this.id,t),D.flipRequests.next({from:{rect:e},to:{rect:t,element:this._slottedChildren[0]},host:this})}})},error:()=>{this.style.setProperty("visibility","visible"),L(this).pipe(s.takeUntil(this.disconnecting)).subscribe({next:e=>{D.activeTeleportations.set(this.id,e)}})},complete:()=>{}})}render(){return l.html`<slot></slot>`}},$([c.property({type:Number,reflect:!0})],exports.SchmancyTeleportation.prototype,"uuid",2),$([c.property({type:String})],exports.SchmancyTeleportation.prototype,"id",2),$([c.property({type:Number})],exports.SchmancyTeleportation.prototype,"delay",2),exports.SchmancyTeleportation=$([c.customElement("schmancy-teleport")],exports.SchmancyTeleportation),exports.$drawer=he,exports.HereMorty=B,exports.SchmancyContentDrawerID=X,exports.SchmancyContentDrawerMaxHeight=k,exports.SchmancyContentDrawerMinWidth=N,exports.SchmancyContentDrawerSheetMode=M,exports.SchmancyContentDrawerSheetState=R,exports.SchmancyDrawerNavbarMode=j,exports.SchmancyDrawerNavbarState=z,exports.WhereAreYouRicky=_,exports.schmancyContentDrawer=re,exports.schmancyNavDrawer=K,exports.teleport=D;
|
|
206
|
-
//# sourceMappingURL=teleport.component-
|
|
206
|
+
//# sourceMappingURL=teleport.component-CnDx2oti.cjs.map
|