@mhmo91/schmancy 0.4.5 → 0.4.7

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog-content-BUtwJ3HL.js","sources":["../src/dialog/dailog.ts","../src/dialog/dialog.component.ts","../src/dialog/dialog-content.ts"],"sourcesContent":["import { autoUpdate, computePosition, flip, offset, Placement, shift, size, Strategy } from '@floating-ui/dom'\nimport { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { when } from 'lit/directives/when.js'\nimport { fromEvent } from 'rxjs'\nimport { debounceTime } from 'rxjs/operators'\n\n/**\n * A confirm dialog web component with custom content support\n *\n * @element confirm-dialog\n * @slot content - Optional slot for custom content\n */\n@customElement('confirm-dialog')\nexport class ConfirmDialog extends $LitElement(css`\n\t:host {\n\t\tposition: fixed;\n\t\tz-index: 10000;\n\t\tinset: 0;\n\t\tdisplay: none;\n\t\t--dialog-width: 360px;\n\t}\n\n\t:host([active]) {\n\t\tdisplay: block;\n\t}\n\n\t.overlay {\n\t\tposition: fixed;\n\t\tinset: 0;\n\t\tbackground: rgba(0, 0, 0, 0.4);\n\t}\n\n\t.dialog {\n\t\tposition: absolute;\n\t\twidth: var(--dialog-width);\n\t\tmax-height: calc(100vh - 40px); /* Prevent exceeding viewport height */\n\t\toverflow: auto; /* Allow scrolling for oversized content */\n\t}\n\n\t/* Used when centered for initial positioning */\n\t.dialog.centered {\n\t\ttop: 50%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, -55%); /* Slight upward shift looks better */\n\t}\n`) {\n\t/**\n\t * Dialog title\n\t */\n\t@property({ type: String })\n\ttitle = undefined\n\n\t/**\n\t * Dialog subtitle\n\t */\n\t@property({ type: String })\n\tsubtitle = undefined\n\n\t/**\n\t * Dialog message\n\t */\n\t@property({ type: String })\n\tmessage = undefined\n\n\t/**\n\t * Text for confirm button\n\t */\n\t@property({ type: String, attribute: 'confirm-text' })\n\tconfirmText = 'Confirm'\n\n\t/**\n\t * Text for cancel button\n\t */\n\t@property({ type: String, attribute: 'cancel-text' })\n\tcancelText = 'Cancel'\n\n\t/**\n\t * Dialog variant (affects button colors)\n\t */\n\t@property({ type: String })\n\tvariant: 'default' | 'danger' = 'default'\n\n\t/**\n\t * Confirm button color\n\t */\n\t@property({ type: String, attribute: 'confirm-color' })\n\tconfirmColor?: 'primary' | 'error' | 'warning' | 'success'\n\n\t/**\n\t * Current position of the dialog\n\t */\n\tprivate position = { x: 0, y: 0 }\n\n\t/**\n\t * Current active promise resolver\n\t */\n\tprivate resolvePromise?: (value: boolean) => void\n\n\t/**\n\t * Store cleanup function for position auto-updates\n\t */\n\tprivate cleanupAutoUpdate?: () => void\n\n\t/**\n\t * Store resize subscription\n\t */\n\tprivate resizeSubscription?: { unsubscribe: () => void }\n\n\t/**\n\t * Virtual element to use as reference for positioning\n\t */\n\tprivate virtualReference?: {\n\t\tgetBoundingClientRect: () => DOMRect\n\t}\n\n\t/**\n\t * Simple API: Show the dialog at a specific position\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tasync show(positionOrEvent?: { x: number; y: number } | MouseEvent | TouchEvent): Promise<boolean> {\n\t\t// Extract position from event or use direct coordinates\n\t\tlet x: number, y: number\n\n\t\tif (!positionOrEvent) {\n\t\t\t// Default to center of viewport if no position provided\n\t\t\tx = window.innerWidth / 2\n\t\t\ty = window.innerHeight / 2\n\t\t} else if ('clientX' in positionOrEvent) {\n\t\t\t// It's a mouse event\n\t\t\tx = positionOrEvent.clientX\n\t\t\ty = positionOrEvent.clientY\n\t\t} else if ('touches' in positionOrEvent && positionOrEvent.touches.length) {\n\t\t\t// It's a touch event\n\t\t\tx = positionOrEvent.touches[0].clientX\n\t\t\ty = positionOrEvent.touches[0].clientY\n\t\t} else {\n\t\t\t// It's a position object with x,y coordinates\n\t\t\tconst pos = positionOrEvent as { x: number; y: number }\n\t\t\tx = pos.x\n\t\t\ty = pos.y\n\t\t}\n\n\t\t// Store initial position\n\t\tthis.position = { x, y }\n\n\t\t// Create virtual reference element at the provided coordinates\n\t\tthis.virtualReference = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t},\n\t\t}\n\n\t\t// Make dialog active\n\t\tthis.setAttribute('active', '')\n\n\t\t// Return a promise that resolves when the user makes a choice\n\t\treturn new Promise<boolean>(resolve => {\n\t\t\tthis.resolvePromise = resolve\n\t\t})\n\t}\n\n\t/**\n\t * Simple API: Hide the dialog\n\t */\n\thide(confirmed = false) {\n\t\tthis.removeAttribute('active')\n\n\t\t// Clean up any auto-update subscription\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\n\t\t// Resolve any pending promise\n\t\tif (this.resolvePromise) {\n\t\t\tthis.resolvePromise(confirmed)\n\t\t\tthis.resolvePromise = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Set up position auto-updating when dialog content changes or window resizes\n\t */\n\tprivate setupPositioning(dialog: HTMLElement) {\n\t\tconst viewportWidth = window.innerWidth\n\t\tconst viewportHeight = window.innerHeight\n\n\t\t// Check if this is a centered dialog\n\t\tconst isCentered =\n\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\tif (isCentered) {\n\t\t\t// For centered dialogs, use CSS-based centering\n\t\t\tdialog.classList.add('centered')\n\n\t\t\t// Always set up auto-update for content changes, even for centered dialogs\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(\n\t\t\t\tdocument.body, // Use body as reference for centered dialogs\n\t\t\t\tdialog,\n\t\t\t\t() => {\n\t\t\t\t\t// If dialog has the centered class, ensure it stays visible\n\t\t\t\t\t// even when content changes its dimensions\n\t\t\t\t\tif (dialog.classList.contains('centered')) {\n\t\t\t\t\t\t// Adjust max-height to ensure dialog stays within viewport\n\t\t\t\t\t\tconst availableHeight = window.innerHeight - 40\n\t\t\t\t\t\tif (dialog.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tdialog.style.maxHeight = `${availableHeight}px`\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\telementResize: true,\n\t\t\t\t\tancestorScroll: true,\n\t\t\t\t},\n\t\t\t)\n\n\t\t\treturn\n\t\t}\n\n\t\t// Remove centered class if it exists\n\t\tdialog.classList.remove('centered')\n\n\t\t// Use Floating UI's autoUpdate to continually update position\n\t\tif (this.virtualReference) {\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(this.virtualReference, dialog, () => this.updatePosition(dialog), {\n\t\t\t\tancestorScroll: true,\n\t\t\t\tancestorResize: true,\n\t\t\t\telementResize: true,\n\t\t\t\tanimationFrame: true, // Enable continuous updates for smoother repositioning\n\t\t\t})\n\n\t\t\t// Initial positioning\n\t\t\tthis.updatePosition(dialog)\n\t\t}\n\t}\n\n\t/**\n\t * Update dialog position using Floating UI\n\t */\n\tprivate async updatePosition(dialog: HTMLElement) {\n\t\tif (!this.virtualReference) return\n\n\t\t// Force window bounds recalculation on resize\n\t\tif (this.position.x > 0 && this.position.y > 0) {\n\t\t\t// Update virtual reference to consider current window size\n\t\t\tconst viewportWidth = window.innerWidth\n\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t// Ensure position is constrained to current viewport\n\t\t\tconst x = Math.min(this.position.x, viewportWidth - 20)\n\t\t\tconst y = Math.min(this.position.y, viewportHeight - 20)\n\n\t\t\t// Update virtual reference with current viewport-constrained position\n\t\t\tthis.virtualReference = {\n\t\t\t\tgetBoundingClientRect() {\n\t\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\n\t\tconst placement: Placement = 'bottom-start'\n\t\tconst strategy: Strategy = 'absolute'\n\t\tconst margin = 20 // Standard margin from edges\n\n\t\tconst { x, y } = await computePosition(this.virtualReference, dialog, {\n\t\t\tplacement,\n\t\t\tstrategy,\n\t\t\tmiddleware: [\n\t\t\t\t// Offset from the reference point\n\t\t\t\toffset(margin),\n\n\t\t\t\t// Flip to opposite side if no space\n\t\t\t\tflip({\n\t\t\t\t\tfallbackPlacements: ['top-start', 'bottom-end', 'top-end'],\n\t\t\t\t\tfallbackStrategy: 'bestFit',\n\t\t\t\t}),\n\n\t\t\t\t// Shift along the preferred axis to stay in view\n\t\t\t\tshift({\n\t\t\t\t\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\n\t\t\t\t// Resize dialog if needed\n\t\t\t\tsize({\n\t\t\t\t\tapply({ availableWidth, availableHeight, elements }) {\n\t\t\t\t\t\t// If dialog is wider than available space\n\t\t\t\t\t\tif (elements.floating.offsetWidth > availableWidth) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxWidth: `${Math.max(availableWidth - margin * 2, 280)}px`, // Keep at least 280px if possible\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If dialog is taller than available space\n\t\t\t\t\t\tif (elements.floating.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxHeight: `${availableHeight - margin * 2}px`,\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\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\t\t\t],\n\t\t})\n\n\t\t// Apply the computed position\n\t\tObject.assign(dialog.style, {\n\t\t\tleft: `${Math.round(x)}px`,\n\t\t\ttop: `${Math.round(y)}px`,\n\t\t\ttransform: 'none', // Remove any transform that might interfere\n\t\t})\n\t}\n\n\t/**\n\t * Handle component disconnection from DOM\n\t */\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\n\t\t// Clean up subscriptions\n\t\tif (this.resizeSubscription) {\n\t\t\tthis.resizeSubscription.unsubscribe()\n\t\t\tthis.resizeSubscription = undefined\n\t\t}\n\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Handle lifecycle callback when dialog is first rendered\n\t */\n\tfirstUpdated() {\n\t\tconst dialog = this.shadowRoot?.querySelector('.dialog') as HTMLElement\n\t\tif (!dialog) return\n\n\t\t// Set up positioning with Floating UI\n\t\tthis.setupPositioning(dialog)\n\n\t\t// Set up window resize subscription using RxJS with debounce\n\t\tthis.resizeSubscription = fromEvent(window, 'resize')\n\t\t\t.pipe(debounceTime(50)) // Faster response time\n\t\t\t.subscribe(() => {\n\t\t\t\t// Get current viewport dimensions\n\t\t\t\tconst viewportWidth = window.innerWidth\n\t\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t\t// If using CSS centered positioning, ensure it stays centered\n\t\t\t\tconst isCentered =\n\t\t\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\t\t\tif (isCentered) {\n\t\t\t\t\t// Update position to new center\n\t\t\t\t\tthis.position = {\n\t\t\t\t\t\tx: viewportWidth / 2,\n\t\t\t\t\t\ty: viewportHeight / 2,\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Always update position on resize\n\t\t\t\tthis.updatePosition(dialog)\n\t\t\t})\n\t}\n\n\t/**\n\t * Handle confirm action\n\t */\n\tprivate handleConfirm() {\n\t\tthis.hide(true)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('confirm', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Handle cancel action\n\t */\n\tprivate handleCancel() {\n\t\tthis.hide(false)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('cancel', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Get the CSS class for the confirm button based on color\n\t */\n\tprivate getConfirmButtonClass(): string {\n\t\t// Map confirmColor to appropriate CSS classes\n\t\tconst colorMap = {\n\t\t\terror: 'bg-red-600 hover:bg-red-700 text-white',\n\t\t\twarning: 'bg-orange-600 hover:bg-orange-700 text-white',\n\t\t\tsuccess: 'bg-green-600 hover:bg-green-700 text-white',\n\t\t\tprimary: ''\n\t\t}\n\n\t\t// If variant is danger, use error color\n\t\tif (this.variant === 'danger' || this.confirmColor === 'error') {\n\t\t\treturn colorMap.error\n\t\t}\n\n\t\treturn colorMap[this.confirmColor || 'primary'] || ''\n\t}\n\n\trender() {\n\t\t// For initial rendering, use transform-based centering from CSS\n\t\t// firstUpdated will handle precise positioning after measuring\n\t\tconst hasCustomContent = this.querySelectorAll('[slot=\"content\"]').length > 0\n\t\t// Only show buttons if both confirmText and cancelText are non-empty strings\n\t\tconst showButtons =\n\t\t\tthis.confirmText && this.confirmText.trim() !== '' && this.cancelText && this.cancelText.trim() !== ''\n\n\t\treturn html`\n\t\t\t<div class=\"overlay\" @click=${this.handleCancel}></div>\n\n\t\t\t<div class=\"dialog\" role=\"alertdialog\" aria-modal=\"true\">\n\t\t\t\t<schmancy-surface rounded=\"all\" elevation=\"3\" type=\"containerHigh\">\n\t\t\t\t\t<schmancy-form @submit=${this.handleConfirm} class=\"p-4\">\n\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\tthis.title && this.title.trim() !== '',\n\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t<schmancy-typography type=\"title\" token=\"md\" class=\"mb-1\"> ${this.title} </schmancy-typography>\n\t\t\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\t\t\tthis.subtitle && this.subtitle.trim() !== '',\n\t\t\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t\t\t<schmancy-typography type=\"subtitle\" token=\"xs\" class=\"mb-2\">\n\t\t\t\t\t\t\t\t\t\t\t${this.subtitle}\n\t\t\t\t\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t\t\t\t() => html``\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\t${hasCustomContent\n\t\t\t\t\t\t\t? html`<div class=\"${showButtons ? 'mb-4' : ''}\"><slot name=\"content\"></slot></div>`\n\t\t\t\t\t\t\t: when(\n\t\t\t\t\t\t\t\t\tthis.message && this.message.trim() !== '',\n\t\t\t\t\t\t\t\t\t() => html`<schmancy-typography type=\"body\" class=\"mb-4\"> ${this.message} </schmancy-typography>`,\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\tshowButtons,\n\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t<div class=\"flex justify-end gap-3\">\n\t\t\t\t\t\t\t\t\t<schmancy-button variant=\"outlined\" @click=${this.handleCancel}> ${this.cancelText} </schmancy-button>\n\t\t\t\t\t\t\t\t\t<schmancy-button type=\"submit\" variant=\"filled\" class=${this.getConfirmButtonClass()}> ${this.confirmText} </schmancy-button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t)}\n\t\t\t\t\t</schmancy-form>\n\t\t\t\t</schmancy-surface>\n\t\t\t</div>\n\t\t`\n\t}\n\n\t/**\n\t * Static helper for even simpler API\n\t */\n\tstatic async confirm(options: {\n\t\ttitle?: string\n\t\tsubtitle?: string\n\t\tmessage?: string\n\t\tconfirmText?: string\n\t\tcancelText?: string\n\t\tvariant?: 'default' | 'danger'\n\t\tposition?: { x: number; y: number } | MouseEvent | TouchEvent\n\t\twidth?: string\n\t}): Promise<boolean> {\n\t\t// Create dialog if it doesn't exist\n\t\tlet dialog = document.querySelector('confirm-dialog') as ConfirmDialog\n\n\t\tif (!dialog) {\n\t\t\tdialog = document.createElement('confirm-dialog') as ConfirmDialog\n\t\t\tdocument.body.appendChild(dialog)\n\t\t}\n\n\t\t// Set options\n\t\tif (options.title) dialog.title = options.title\n\t\tif (options.subtitle) dialog.subtitle = options.subtitle\n\t\tif (options.message) dialog.message = options.message\n\t\tif (options.confirmText) dialog.confirmText = options.confirmText\n\t\tif (options.cancelText) dialog.cancelText = options.cancelText\n\t\tif (options.variant) dialog.variant = options.variant\n\t\tif (options.width) dialog.style.setProperty('--dialog-width', options.width)\n\n\t\t// Show dialog and return promise\n\t\treturn dialog.show(options.position)\n\t}\n\n\t/**\n\t * Even simpler shorthand method - just pass message and optionally an event\n\t */\n\tstatic async ask(message: string, event?: MouseEvent | TouchEvent): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\tmessage,\n\t\t\tposition: event,\n\t\t})\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'confirm-dialog': ConfirmDialog\n\t}\n}\n","import { autoUpdate, computePosition, flip, offset, Placement, shift, size, Strategy } from '@floating-ui/dom'\nimport { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { fromEvent, tap } from 'rxjs'\nimport { debounceTime } from 'rxjs/operators'\nimport { DialogWhereAreYouRicky, DialogWhereAreYouRickyEvent, DialogHereMorty } from './dialog-events'\n\n/**\n * A basic dialog web component without title or actions\n *\n * @element schmancy-dialog\n * @slot default - Content slot for dialog body\n */\n@customElement('schmancy-dialog')\nexport class SchmancyDialog extends $LitElement(css`\n\t:host {\n\t\tposition: fixed;\n\t\tz-index: 10000;\n\t\tinset: 0;\n\t\tdisplay: none;\n\t\t--dialog-width: 360px;\n\t}\n\n\t:host([active]) {\n\t\tdisplay: block;\n\t}\n\n\t.overlay {\n\t\tposition: fixed;\n\t\tinset: 0;\n\t\tbackground: rgba(0, 0, 0, 0.4);\n\t}\n\n\t.dialog {\n\t\tposition: absolute;\n\t\tmax-width: var(--dialog-width);\n\t\twidth: max-content;\n\t\tmax-height: calc(100vh - 40px); /* Prevent exceeding viewport height */\n\t\toverflow: auto; /* Allow scrolling for oversized content */\n\t}\n\n\t/* Used when centered for initial positioning */\n\t.dialog.centered {\n\t\ttop: 50%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, -55%); /* Slight upward shift looks better */\n\t}\n`) {\n\t/**\n\t * Unique identifier for the dialog instance\n\t */\n\t@property({ type: String, reflect: true }) uid: string\n\n\t/**\n\t * Current position of the dialog\n\t */\n\tprivate position = { x: 0, y: 0 }\n\n\t/**\n\t * Current active promise resolver\n\t */\n\tprivate resolvePromise?: (value: boolean) => void\n\n\t/**\n\t * Store cleanup function for position auto-updates\n\t */\n\tprivate cleanupAutoUpdate?: () => void\n\n\t/**\n\t * Virtual element to use as reference for positioning\n\t */\n\tprivate virtualReference?: {\n\t\tgetBoundingClientRect: () => DOMRect\n\t}\n\n\t/**\n\t * Simple API: Show the dialog at a specific position\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tasync show(positionOrEvent?: { x: number; y: number } | MouseEvent | TouchEvent): Promise<boolean> {\n\t\t// Extract position from event or use direct coordinates\n\t\tlet x: number, y: number\n\n\t\tif (!positionOrEvent) {\n\t\t\t// Default to center of viewport if no position provided\n\t\t\tx = window.innerWidth / 2\n\t\t\ty = window.innerHeight / 2\n\t\t} else if ('clientX' in positionOrEvent) {\n\t\t\t// It's a mouse event\n\t\t\tx = positionOrEvent.clientX\n\t\t\ty = positionOrEvent.clientY\n\t\t} else if ('touches' in positionOrEvent && positionOrEvent.touches.length) {\n\t\t\t// It's a touch event\n\t\t\tx = positionOrEvent.touches[0].clientX\n\t\t\ty = positionOrEvent.touches[0].clientY\n\t\t} else {\n\t\t\t// It's a position object with x,y coordinates\n\t\t\tconst pos = positionOrEvent as { x: number; y: number }\n\t\t\tx = pos.x\n\t\t\ty = pos.y\n\t\t}\n\n\t\t// Store initial position\n\t\tthis.position = { x, y }\n\n\t\t// Create virtual reference element at the provided coordinates\n\t\tthis.virtualReference = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t},\n\t\t}\n\n\t\t// Make dialog active\n\t\tthis.setAttribute('active', '')\n\n\t\t// Return a promise that resolves when the user makes a choice\n\t\treturn new Promise<boolean>(resolve => {\n\t\t\tthis.resolvePromise = resolve\n\t\t})\n\t}\n\n\t/**\n\t * Simple API: Hide the dialog\n\t */\n\thide(result = false) {\n\t\tthis.removeAttribute('active')\n\n\t\t// Clean up any auto-update subscription\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\n\t\t// Resolve any pending promise\n\t\tif (this.resolvePromise) {\n\t\t\tthis.resolvePromise(result)\n\t\t\tthis.resolvePromise = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Set up position auto-updating when dialog content changes or window resizes\n\t */\n\tprivate setupPositioning(dialog: HTMLElement) {\n\t\tconst viewportWidth = window.innerWidth\n\t\tconst viewportHeight = window.innerHeight\n\n\t\t// Check if this is a centered dialog\n\t\tconst isCentered =\n\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\tif (isCentered) {\n\t\t\t// For centered dialogs, use CSS-based centering\n\t\t\tdialog.classList.add('centered')\n\n\t\t\t// Always set up auto-update for content changes, even for centered dialogs\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(\n\t\t\t\tdocument.body, // Use body as reference for centered dialogs\n\t\t\t\tdialog,\n\t\t\t\t() => {\n\t\t\t\t\t// If dialog has the centered class, ensure it stays visible\n\t\t\t\t\t// even when content changes its dimensions\n\t\t\t\t\tif (dialog.classList.contains('centered')) {\n\t\t\t\t\t\t// Adjust max-height to ensure dialog stays within viewport\n\t\t\t\t\t\tconst availableHeight = window.innerHeight - 40\n\t\t\t\t\t\tif (dialog.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tdialog.style.maxHeight = `${availableHeight}px`\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\telementResize: true,\n\t\t\t\t\tancestorScroll: true,\n\t\t\t\t},\n\t\t\t)\n\n\t\t\treturn\n\t\t}\n\n\t\t// Remove centered class if it exists\n\t\tdialog.classList.remove('centered')\n\n\t\t// Use Floating UI's autoUpdate to continually update position\n\t\tif (this.virtualReference) {\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(this.virtualReference, dialog, () => this.updatePosition(dialog), {\n\t\t\t\tancestorScroll: true,\n\t\t\t\tancestorResize: true,\n\t\t\t\telementResize: true,\n\t\t\t\tanimationFrame: true, // Enable continuous updates for smoother repositioning\n\t\t\t})\n\n\t\t\t// Initial positioning\n\t\t\tthis.updatePosition(dialog)\n\t\t}\n\t}\n\n\t/**\n\t * Update dialog position using Floating UI\n\t */\n\tprivate async updatePosition(dialog: HTMLElement) {\n\t\tif (!this.virtualReference) return\n\n\t\t// Force window bounds recalculation on resize\n\t\tif (this.position.x > 0 && this.position.y > 0) {\n\t\t\t// Update virtual reference to consider current window size\n\t\t\tconst viewportWidth = window.innerWidth\n\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t// Ensure position is constrained to current viewport\n\t\t\tconst x = Math.min(this.position.x, viewportWidth - 20)\n\t\t\tconst y = Math.min(this.position.y, viewportHeight - 20)\n\n\t\t\t// Update virtual reference with current viewport-constrained position\n\t\t\tthis.virtualReference = {\n\t\t\t\tgetBoundingClientRect() {\n\t\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\n\t\tconst placement: Placement = 'bottom-start'\n\t\tconst strategy: Strategy = 'absolute'\n\t\tconst margin = 20 // Standard margin from edges\n\n\t\tconst { x, y } = await computePosition(this.virtualReference, dialog, {\n\t\t\tplacement,\n\t\t\tstrategy,\n\t\t\tmiddleware: [\n\t\t\t\t// Offset from the reference point\n\t\t\t\toffset(margin),\n\n\t\t\t\t// Flip to opposite side if no space\n\t\t\t\tflip({\n\t\t\t\t\tfallbackPlacements: ['top-start', 'bottom-end', 'top-end'],\n\t\t\t\t\tfallbackStrategy: 'bestFit',\n\t\t\t\t}),\n\n\t\t\t\t// Shift along the preferred axis to stay in view\n\t\t\t\tshift({\n\t\t\t\t\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\n\t\t\t\t// Resize dialog if needed\n\t\t\t\tsize({\n\t\t\t\t\tapply({ availableWidth, availableHeight, elements }) {\n\t\t\t\t\t\t// If dialog is wider than available space\n\t\t\t\t\t\tif (elements.floating.offsetWidth > availableWidth) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxWidth: `${Math.max(availableWidth - margin * 2, 280)}px`, // Keep at least 280px if possible\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If dialog is taller than available space\n\t\t\t\t\t\tif (elements.floating.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxHeight: `${availableHeight - margin * 2}px`,\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\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\t\t\t],\n\t\t})\n\n\t\t// Apply the computed position\n\t\tObject.assign(dialog.style, {\n\t\t\tleft: `${Math.round(x)}px`,\n\t\t\ttop: `${Math.round(y)}px`,\n\t\t\ttransform: 'none', // Remove any transform that might interfere\n\t\t})\n\t}\n\n\t// Store resize subscription\n\tprivate resizeSubscription?: { unsubscribe: () => void }\n\n\t/**\n\t * Handle component disconnection from DOM\n\t */\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\n\t\t// Clean up subscriptions\n\t\tif (this.resizeSubscription) {\n\t\t\tthis.resizeSubscription.unsubscribe()\n\t\t\tthis.resizeSubscription = undefined\n\t\t}\n\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Handle component connection to DOM\n\t */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\t\n\t\t// Listen for \"where are you ricky\" events\n\t\tfromEvent<DialogWhereAreYouRickyEvent>(window, DialogWhereAreYouRicky).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).subscribe()\n\t}\n\n\t/**\n\t * Announce this dialog's presence to the service\n\t */\n\tprivate announcePresence() {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(DialogHereMorty, {\n\t\t\t\tdetail: { dialog: this },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Handle lifecycle callback when dialog is first rendered\n\t */\n\tfirstUpdated() {\n\t\tconst dialog = this.shadowRoot?.querySelector('.dialog') as HTMLElement\n\t\tif (!dialog) return\n\n\t\t// Set up positioning with Floating UI\n\t\tthis.setupPositioning(dialog)\n\n\t\t// Set up window resize subscription using RxJS with debounce\n\t\tthis.resizeSubscription = fromEvent(window, 'resize')\n\t\t\t.pipe(debounceTime(50)) // Faster response time\n\t\t\t.subscribe(() => {\n\t\t\t\t// Get current viewport dimensions\n\t\t\t\tconst viewportWidth = window.innerWidth\n\t\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t\t// If using CSS centered positioning, ensure it stays centered\n\t\t\t\tconst isCentered =\n\t\t\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\t\t\tif (isCentered) {\n\t\t\t\t\t// Update position to new center\n\t\t\t\t\tthis.position = {\n\t\t\t\t\t\tx: viewportWidth / 2,\n\t\t\t\t\t\ty: viewportHeight / 2,\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Always update position on resize\n\t\t\t\tthis.updatePosition(dialog)\n\t\t\t})\n\t}\n\n\t/**\n\t * Handle close action\n\t */\n\tprivate handleClose() {\n\t\tthis.hide(false)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('close', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<div class=\"overlay\" @click=${this.handleClose}></div>\n\n\t\t\t<div class=\"dialog\" role=\"dialog\" aria-modal=\"true\">\n\t\t\t\t<schmancy-surface rounded=\"all\" elevation=\"3\" type=\"containerHigh\">\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</schmancy-surface>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-dialog': SchmancyDialog\n\t}\n}\n","import { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\n/**\n * A basic dialog content component that doesn't add any padding or styling\n * Used for rendering raw content in a dialog\n *\n * @element schmancy-dialog-content\n * @slot default - Content slot for dialog content without any styling\n */\n@customElement('schmancy-dialog-content')\nexport class SchmancyDialogContent extends $LitElement(css`\n :host {\n display: block;\n width: 100%;\n height: 100%;\n }\n`) {\n render() {\n return html`<slot></slot>`\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'schmancy-dialog-content': SchmancyDialogContent\n }\n}"],"names":["ConfirmDialog","$LitElement","css","super","arguments","this","title","subtitle","message","confirmText","cancelText","variant","position","x","y","show","positionOrEvent","clientX","clientY","touches","length","pos","window","innerWidth","innerHeight","virtualReference","getBoundingClientRect","DOMRect","setAttribute","Promise","resolve","resolvePromise","confirmed","removeAttribute","cleanupAutoUpdate","dialog","viewportWidth","viewportHeight","Math","abs","classList","add","autoUpdate","document","body","contains","availableHeight","offsetHeight","style","maxHeight","elementResize","ancestorScroll","remove","updatePosition","ancestorResize","animationFrame","min","computePosition","placement","strategy","middleware","offset","flip","fallbackPlacements","fallbackStrategy","shift","padding","size","apply","availableWidth","elements","floating","offsetWidth","Object","assign","maxWidth","max","margin","left","round","top","transform","disconnectedCallback","resizeSubscription","unsubscribe","firstUpdated","shadowRoot","querySelector","setupPositioning","fromEvent","pipe","debounceTime","subscribe","handleConfirm","hide","dispatchEvent","CustomEvent","bubbles","composed","getConfirmButtonClass","colorMap","error","warning","success","primary","confirmColor","hasCustomContent","querySelectorAll","showButtons","trim","html","handleCancel","when","options","createElement","appendChild","width","setProperty","event","confirm","__decorateClass","property","type","String","prototype","attribute","customElement","SchmancyDialog","constructor","result","connectedCallback","DialogWhereAreYouRicky","tap","e","detail","uid","announcePresence","DialogHereMorty","handleClose","reflect","SchmancyDialogContent","render"],"mappings":";;;;;;;;;;;;;;;AAea,IAAAA,IAAN,cAA4BC,EAAYC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAAxC,EAAA;AAAA,EAAA,cAAAC;AAAAA,UAAAA,GAAAC,SAqCEC,GAAAA,KAAAC,QAAA,QAMGD,KAAAE,WAAAA,QAMDF,KAAAG,UAAA,QAMIH,KAAAI,cAAA,WAMDJ,KAAAK,aAAA,UAMmBL,KAAAM,UAAA,WAWhCN,KAAQO,WAAW,EAAEC,GAAG,GAAGC,GAAG,EAAA;AAAA,EAAE;AAAA,EA4BhC,MAAMC,KAAKC,GAEV;AAAA,QAAIH,GAAWC;AAEf,QAAKE,EAIL,KAAW,aAAaA,EAEvBH,CAAAA,IAAIG,EAAgBC,SACpBH,IAAIE,EAAgBE;AAAAA,aACV,aAAaF,KAAmBA,EAAgBG,QAAQC,OAE9DP,CAAAA,IAAAG,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,cACP9B;AAAAA,SAAKyF,KAAK,EAAA,GACLzF,KAAA0F,cACJ,IAAIC,YAAY,SAAS,EACxBC,SAAS,IACTC,UAAU,GAAA,CAAA,CAAA;AAAA,EAEZ;AAAA,EAGD,SACQ;AAAA,WAAAY;AAAAA,iCACwBzG,KAAKqI,WAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,EAAW;AA/TLlB;AAAAA,EAAA,CAA1CC,EAAS,EAAEC,MAAMC,QAAQgB,SAAAA,GArCdZ,CAAAA,CAAAA,GAAAA,EAqC+BH,WAAA,OAAA,CArC/BG,GAAAA,IAANP,EAAA,CADNM,EAAc,iBACFC,CAAAA,GAAAA,CAAAA;;ACHA,IAAAa,IAAN,cAAoC3I,EAAYC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;EAOrD,SAAA2I;AACS,WAAA/B;AAAAA,EAAA;;AARE8B;;;GAAN,CADNd,EAAc,yBAAA,CAAA,GACFc;"}
@@ -19,8 +19,7 @@
19
19
 
20
20
  .dialog {
21
21
  position: absolute;
22
- max-width: var(--dialog-width);
23
- width: max-content;
22
+ width: var(--dialog-width);
24
23
  max-height: calc(100vh - 40px); /* Prevent exceeding viewport height */
25
24
  overflow: auto; /* Allow scrolling for oversized content */
26
25
  }
@@ -103,4 +102,4 @@
103
102
  height: 100%;
104
103
  }
105
104
  `){render(){return c.html`<slot></slot>`}},exports.SchmancyDialogContent=((t,e,s,i)=>{for(var n,o=i>1?void 0:i?x(e,s):e,a=t.length-1;a>=0;a--)(n=t[a])&&(o=n(o)||o);return o})([l.customElement("schmancy-dialog-content")],exports.SchmancyDialogContent);
106
- //# sourceMappingURL=dialog-content-C1zsL7VE.cjs.map
105
+ //# sourceMappingURL=dialog-content-SX6qtxGj.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog-content-SX6qtxGj.cjs","sources":["../src/dialog/dailog.ts","../src/dialog/dialog.component.ts","../src/dialog/dialog-content.ts"],"sourcesContent":["import { autoUpdate, computePosition, flip, offset, Placement, shift, size, Strategy } from '@floating-ui/dom'\nimport { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { when } from 'lit/directives/when.js'\nimport { fromEvent } from 'rxjs'\nimport { debounceTime } from 'rxjs/operators'\n\n/**\n * A confirm dialog web component with custom content support\n *\n * @element confirm-dialog\n * @slot content - Optional slot for custom content\n */\n@customElement('confirm-dialog')\nexport class ConfirmDialog extends $LitElement(css`\n\t:host {\n\t\tposition: fixed;\n\t\tz-index: 10000;\n\t\tinset: 0;\n\t\tdisplay: none;\n\t\t--dialog-width: 360px;\n\t}\n\n\t:host([active]) {\n\t\tdisplay: block;\n\t}\n\n\t.overlay {\n\t\tposition: fixed;\n\t\tinset: 0;\n\t\tbackground: rgba(0, 0, 0, 0.4);\n\t}\n\n\t.dialog {\n\t\tposition: absolute;\n\t\twidth: var(--dialog-width);\n\t\tmax-height: calc(100vh - 40px); /* Prevent exceeding viewport height */\n\t\toverflow: auto; /* Allow scrolling for oversized content */\n\t}\n\n\t/* Used when centered for initial positioning */\n\t.dialog.centered {\n\t\ttop: 50%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, -55%); /* Slight upward shift looks better */\n\t}\n`) {\n\t/**\n\t * Dialog title\n\t */\n\t@property({ type: String })\n\ttitle = undefined\n\n\t/**\n\t * Dialog subtitle\n\t */\n\t@property({ type: String })\n\tsubtitle = undefined\n\n\t/**\n\t * Dialog message\n\t */\n\t@property({ type: String })\n\tmessage = undefined\n\n\t/**\n\t * Text for confirm button\n\t */\n\t@property({ type: String, attribute: 'confirm-text' })\n\tconfirmText = 'Confirm'\n\n\t/**\n\t * Text for cancel button\n\t */\n\t@property({ type: String, attribute: 'cancel-text' })\n\tcancelText = 'Cancel'\n\n\t/**\n\t * Dialog variant (affects button colors)\n\t */\n\t@property({ type: String })\n\tvariant: 'default' | 'danger' = 'default'\n\n\t/**\n\t * Confirm button color\n\t */\n\t@property({ type: String, attribute: 'confirm-color' })\n\tconfirmColor?: 'primary' | 'error' | 'warning' | 'success'\n\n\t/**\n\t * Current position of the dialog\n\t */\n\tprivate position = { x: 0, y: 0 }\n\n\t/**\n\t * Current active promise resolver\n\t */\n\tprivate resolvePromise?: (value: boolean) => void\n\n\t/**\n\t * Store cleanup function for position auto-updates\n\t */\n\tprivate cleanupAutoUpdate?: () => void\n\n\t/**\n\t * Store resize subscription\n\t */\n\tprivate resizeSubscription?: { unsubscribe: () => void }\n\n\t/**\n\t * Virtual element to use as reference for positioning\n\t */\n\tprivate virtualReference?: {\n\t\tgetBoundingClientRect: () => DOMRect\n\t}\n\n\t/**\n\t * Simple API: Show the dialog at a specific position\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tasync show(positionOrEvent?: { x: number; y: number } | MouseEvent | TouchEvent): Promise<boolean> {\n\t\t// Extract position from event or use direct coordinates\n\t\tlet x: number, y: number\n\n\t\tif (!positionOrEvent) {\n\t\t\t// Default to center of viewport if no position provided\n\t\t\tx = window.innerWidth / 2\n\t\t\ty = window.innerHeight / 2\n\t\t} else if ('clientX' in positionOrEvent) {\n\t\t\t// It's a mouse event\n\t\t\tx = positionOrEvent.clientX\n\t\t\ty = positionOrEvent.clientY\n\t\t} else if ('touches' in positionOrEvent && positionOrEvent.touches.length) {\n\t\t\t// It's a touch event\n\t\t\tx = positionOrEvent.touches[0].clientX\n\t\t\ty = positionOrEvent.touches[0].clientY\n\t\t} else {\n\t\t\t// It's a position object with x,y coordinates\n\t\t\tconst pos = positionOrEvent as { x: number; y: number }\n\t\t\tx = pos.x\n\t\t\ty = pos.y\n\t\t}\n\n\t\t// Store initial position\n\t\tthis.position = { x, y }\n\n\t\t// Create virtual reference element at the provided coordinates\n\t\tthis.virtualReference = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t},\n\t\t}\n\n\t\t// Make dialog active\n\t\tthis.setAttribute('active', '')\n\n\t\t// Return a promise that resolves when the user makes a choice\n\t\treturn new Promise<boolean>(resolve => {\n\t\t\tthis.resolvePromise = resolve\n\t\t})\n\t}\n\n\t/**\n\t * Simple API: Hide the dialog\n\t */\n\thide(confirmed = false) {\n\t\tthis.removeAttribute('active')\n\n\t\t// Clean up any auto-update subscription\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\n\t\t// Resolve any pending promise\n\t\tif (this.resolvePromise) {\n\t\t\tthis.resolvePromise(confirmed)\n\t\t\tthis.resolvePromise = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Set up position auto-updating when dialog content changes or window resizes\n\t */\n\tprivate setupPositioning(dialog: HTMLElement) {\n\t\tconst viewportWidth = window.innerWidth\n\t\tconst viewportHeight = window.innerHeight\n\n\t\t// Check if this is a centered dialog\n\t\tconst isCentered =\n\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\tif (isCentered) {\n\t\t\t// For centered dialogs, use CSS-based centering\n\t\t\tdialog.classList.add('centered')\n\n\t\t\t// Always set up auto-update for content changes, even for centered dialogs\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(\n\t\t\t\tdocument.body, // Use body as reference for centered dialogs\n\t\t\t\tdialog,\n\t\t\t\t() => {\n\t\t\t\t\t// If dialog has the centered class, ensure it stays visible\n\t\t\t\t\t// even when content changes its dimensions\n\t\t\t\t\tif (dialog.classList.contains('centered')) {\n\t\t\t\t\t\t// Adjust max-height to ensure dialog stays within viewport\n\t\t\t\t\t\tconst availableHeight = window.innerHeight - 40\n\t\t\t\t\t\tif (dialog.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tdialog.style.maxHeight = `${availableHeight}px`\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\telementResize: true,\n\t\t\t\t\tancestorScroll: true,\n\t\t\t\t},\n\t\t\t)\n\n\t\t\treturn\n\t\t}\n\n\t\t// Remove centered class if it exists\n\t\tdialog.classList.remove('centered')\n\n\t\t// Use Floating UI's autoUpdate to continually update position\n\t\tif (this.virtualReference) {\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(this.virtualReference, dialog, () => this.updatePosition(dialog), {\n\t\t\t\tancestorScroll: true,\n\t\t\t\tancestorResize: true,\n\t\t\t\telementResize: true,\n\t\t\t\tanimationFrame: true, // Enable continuous updates for smoother repositioning\n\t\t\t})\n\n\t\t\t// Initial positioning\n\t\t\tthis.updatePosition(dialog)\n\t\t}\n\t}\n\n\t/**\n\t * Update dialog position using Floating UI\n\t */\n\tprivate async updatePosition(dialog: HTMLElement) {\n\t\tif (!this.virtualReference) return\n\n\t\t// Force window bounds recalculation on resize\n\t\tif (this.position.x > 0 && this.position.y > 0) {\n\t\t\t// Update virtual reference to consider current window size\n\t\t\tconst viewportWidth = window.innerWidth\n\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t// Ensure position is constrained to current viewport\n\t\t\tconst x = Math.min(this.position.x, viewportWidth - 20)\n\t\t\tconst y = Math.min(this.position.y, viewportHeight - 20)\n\n\t\t\t// Update virtual reference with current viewport-constrained position\n\t\t\tthis.virtualReference = {\n\t\t\t\tgetBoundingClientRect() {\n\t\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\n\t\tconst placement: Placement = 'bottom-start'\n\t\tconst strategy: Strategy = 'absolute'\n\t\tconst margin = 20 // Standard margin from edges\n\n\t\tconst { x, y } = await computePosition(this.virtualReference, dialog, {\n\t\t\tplacement,\n\t\t\tstrategy,\n\t\t\tmiddleware: [\n\t\t\t\t// Offset from the reference point\n\t\t\t\toffset(margin),\n\n\t\t\t\t// Flip to opposite side if no space\n\t\t\t\tflip({\n\t\t\t\t\tfallbackPlacements: ['top-start', 'bottom-end', 'top-end'],\n\t\t\t\t\tfallbackStrategy: 'bestFit',\n\t\t\t\t}),\n\n\t\t\t\t// Shift along the preferred axis to stay in view\n\t\t\t\tshift({\n\t\t\t\t\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\n\t\t\t\t// Resize dialog if needed\n\t\t\t\tsize({\n\t\t\t\t\tapply({ availableWidth, availableHeight, elements }) {\n\t\t\t\t\t\t// If dialog is wider than available space\n\t\t\t\t\t\tif (elements.floating.offsetWidth > availableWidth) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxWidth: `${Math.max(availableWidth - margin * 2, 280)}px`, // Keep at least 280px if possible\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If dialog is taller than available space\n\t\t\t\t\t\tif (elements.floating.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxHeight: `${availableHeight - margin * 2}px`,\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\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\t\t\t],\n\t\t})\n\n\t\t// Apply the computed position\n\t\tObject.assign(dialog.style, {\n\t\t\tleft: `${Math.round(x)}px`,\n\t\t\ttop: `${Math.round(y)}px`,\n\t\t\ttransform: 'none', // Remove any transform that might interfere\n\t\t})\n\t}\n\n\t/**\n\t * Handle component disconnection from DOM\n\t */\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\n\t\t// Clean up subscriptions\n\t\tif (this.resizeSubscription) {\n\t\t\tthis.resizeSubscription.unsubscribe()\n\t\t\tthis.resizeSubscription = undefined\n\t\t}\n\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Handle lifecycle callback when dialog is first rendered\n\t */\n\tfirstUpdated() {\n\t\tconst dialog = this.shadowRoot?.querySelector('.dialog') as HTMLElement\n\t\tif (!dialog) return\n\n\t\t// Set up positioning with Floating UI\n\t\tthis.setupPositioning(dialog)\n\n\t\t// Set up window resize subscription using RxJS with debounce\n\t\tthis.resizeSubscription = fromEvent(window, 'resize')\n\t\t\t.pipe(debounceTime(50)) // Faster response time\n\t\t\t.subscribe(() => {\n\t\t\t\t// Get current viewport dimensions\n\t\t\t\tconst viewportWidth = window.innerWidth\n\t\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t\t// If using CSS centered positioning, ensure it stays centered\n\t\t\t\tconst isCentered =\n\t\t\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\t\t\tif (isCentered) {\n\t\t\t\t\t// Update position to new center\n\t\t\t\t\tthis.position = {\n\t\t\t\t\t\tx: viewportWidth / 2,\n\t\t\t\t\t\ty: viewportHeight / 2,\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Always update position on resize\n\t\t\t\tthis.updatePosition(dialog)\n\t\t\t})\n\t}\n\n\t/**\n\t * Handle confirm action\n\t */\n\tprivate handleConfirm() {\n\t\tthis.hide(true)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('confirm', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Handle cancel action\n\t */\n\tprivate handleCancel() {\n\t\tthis.hide(false)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('cancel', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Get the CSS class for the confirm button based on color\n\t */\n\tprivate getConfirmButtonClass(): string {\n\t\t// Map confirmColor to appropriate CSS classes\n\t\tconst colorMap = {\n\t\t\terror: 'bg-red-600 hover:bg-red-700 text-white',\n\t\t\twarning: 'bg-orange-600 hover:bg-orange-700 text-white',\n\t\t\tsuccess: 'bg-green-600 hover:bg-green-700 text-white',\n\t\t\tprimary: ''\n\t\t}\n\n\t\t// If variant is danger, use error color\n\t\tif (this.variant === 'danger' || this.confirmColor === 'error') {\n\t\t\treturn colorMap.error\n\t\t}\n\n\t\treturn colorMap[this.confirmColor || 'primary'] || ''\n\t}\n\n\trender() {\n\t\t// For initial rendering, use transform-based centering from CSS\n\t\t// firstUpdated will handle precise positioning after measuring\n\t\tconst hasCustomContent = this.querySelectorAll('[slot=\"content\"]').length > 0\n\t\t// Only show buttons if both confirmText and cancelText are non-empty strings\n\t\tconst showButtons =\n\t\t\tthis.confirmText && this.confirmText.trim() !== '' && this.cancelText && this.cancelText.trim() !== ''\n\n\t\treturn html`\n\t\t\t<div class=\"overlay\" @click=${this.handleCancel}></div>\n\n\t\t\t<div class=\"dialog\" role=\"alertdialog\" aria-modal=\"true\">\n\t\t\t\t<schmancy-surface rounded=\"all\" elevation=\"3\" type=\"containerHigh\">\n\t\t\t\t\t<schmancy-form @submit=${this.handleConfirm} class=\"p-4\">\n\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\tthis.title && this.title.trim() !== '',\n\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t<schmancy-typography type=\"title\" token=\"md\" class=\"mb-1\"> ${this.title} </schmancy-typography>\n\t\t\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\t\t\tthis.subtitle && this.subtitle.trim() !== '',\n\t\t\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t\t\t<schmancy-typography type=\"subtitle\" token=\"xs\" class=\"mb-2\">\n\t\t\t\t\t\t\t\t\t\t\t${this.subtitle}\n\t\t\t\t\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t\t\t\t() => html``\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\t${hasCustomContent\n\t\t\t\t\t\t\t? html`<div class=\"${showButtons ? 'mb-4' : ''}\"><slot name=\"content\"></slot></div>`\n\t\t\t\t\t\t\t: when(\n\t\t\t\t\t\t\t\t\tthis.message && this.message.trim() !== '',\n\t\t\t\t\t\t\t\t\t() => html`<schmancy-typography type=\"body\" class=\"mb-4\"> ${this.message} </schmancy-typography>`,\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\tshowButtons,\n\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t<div class=\"flex justify-end gap-3\">\n\t\t\t\t\t\t\t\t\t<schmancy-button variant=\"outlined\" @click=${this.handleCancel}> ${this.cancelText} </schmancy-button>\n\t\t\t\t\t\t\t\t\t<schmancy-button type=\"submit\" variant=\"filled\" class=${this.getConfirmButtonClass()}> ${this.confirmText} </schmancy-button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t)}\n\t\t\t\t\t</schmancy-form>\n\t\t\t\t</schmancy-surface>\n\t\t\t</div>\n\t\t`\n\t}\n\n\t/**\n\t * Static helper for even simpler API\n\t */\n\tstatic async confirm(options: {\n\t\ttitle?: string\n\t\tsubtitle?: string\n\t\tmessage?: string\n\t\tconfirmText?: string\n\t\tcancelText?: string\n\t\tvariant?: 'default' | 'danger'\n\t\tposition?: { x: number; y: number } | MouseEvent | TouchEvent\n\t\twidth?: string\n\t}): Promise<boolean> {\n\t\t// Create dialog if it doesn't exist\n\t\tlet dialog = document.querySelector('confirm-dialog') as ConfirmDialog\n\n\t\tif (!dialog) {\n\t\t\tdialog = document.createElement('confirm-dialog') as ConfirmDialog\n\t\t\tdocument.body.appendChild(dialog)\n\t\t}\n\n\t\t// Set options\n\t\tif (options.title) dialog.title = options.title\n\t\tif (options.subtitle) dialog.subtitle = options.subtitle\n\t\tif (options.message) dialog.message = options.message\n\t\tif (options.confirmText) dialog.confirmText = options.confirmText\n\t\tif (options.cancelText) dialog.cancelText = options.cancelText\n\t\tif (options.variant) dialog.variant = options.variant\n\t\tif (options.width) dialog.style.setProperty('--dialog-width', options.width)\n\n\t\t// Show dialog and return promise\n\t\treturn dialog.show(options.position)\n\t}\n\n\t/**\n\t * Even simpler shorthand method - just pass message and optionally an event\n\t */\n\tstatic async ask(message: string, event?: MouseEvent | TouchEvent): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\tmessage,\n\t\t\tposition: event,\n\t\t})\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'confirm-dialog': ConfirmDialog\n\t}\n}\n","import { autoUpdate, computePosition, flip, offset, Placement, shift, size, Strategy } from '@floating-ui/dom'\nimport { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { fromEvent, tap } from 'rxjs'\nimport { debounceTime } from 'rxjs/operators'\nimport { DialogWhereAreYouRicky, DialogWhereAreYouRickyEvent, DialogHereMorty } from './dialog-events'\n\n/**\n * A basic dialog web component without title or actions\n *\n * @element schmancy-dialog\n * @slot default - Content slot for dialog body\n */\n@customElement('schmancy-dialog')\nexport class SchmancyDialog extends $LitElement(css`\n\t:host {\n\t\tposition: fixed;\n\t\tz-index: 10000;\n\t\tinset: 0;\n\t\tdisplay: none;\n\t\t--dialog-width: 360px;\n\t}\n\n\t:host([active]) {\n\t\tdisplay: block;\n\t}\n\n\t.overlay {\n\t\tposition: fixed;\n\t\tinset: 0;\n\t\tbackground: rgba(0, 0, 0, 0.4);\n\t}\n\n\t.dialog {\n\t\tposition: absolute;\n\t\tmax-width: var(--dialog-width);\n\t\twidth: max-content;\n\t\tmax-height: calc(100vh - 40px); /* Prevent exceeding viewport height */\n\t\toverflow: auto; /* Allow scrolling for oversized content */\n\t}\n\n\t/* Used when centered for initial positioning */\n\t.dialog.centered {\n\t\ttop: 50%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, -55%); /* Slight upward shift looks better */\n\t}\n`) {\n\t/**\n\t * Unique identifier for the dialog instance\n\t */\n\t@property({ type: String, reflect: true }) uid: string\n\n\t/**\n\t * Current position of the dialog\n\t */\n\tprivate position = { x: 0, y: 0 }\n\n\t/**\n\t * Current active promise resolver\n\t */\n\tprivate resolvePromise?: (value: boolean) => void\n\n\t/**\n\t * Store cleanup function for position auto-updates\n\t */\n\tprivate cleanupAutoUpdate?: () => void\n\n\t/**\n\t * Virtual element to use as reference for positioning\n\t */\n\tprivate virtualReference?: {\n\t\tgetBoundingClientRect: () => DOMRect\n\t}\n\n\t/**\n\t * Simple API: Show the dialog at a specific position\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tasync show(positionOrEvent?: { x: number; y: number } | MouseEvent | TouchEvent): Promise<boolean> {\n\t\t// Extract position from event or use direct coordinates\n\t\tlet x: number, y: number\n\n\t\tif (!positionOrEvent) {\n\t\t\t// Default to center of viewport if no position provided\n\t\t\tx = window.innerWidth / 2\n\t\t\ty = window.innerHeight / 2\n\t\t} else if ('clientX' in positionOrEvent) {\n\t\t\t// It's a mouse event\n\t\t\tx = positionOrEvent.clientX\n\t\t\ty = positionOrEvent.clientY\n\t\t} else if ('touches' in positionOrEvent && positionOrEvent.touches.length) {\n\t\t\t// It's a touch event\n\t\t\tx = positionOrEvent.touches[0].clientX\n\t\t\ty = positionOrEvent.touches[0].clientY\n\t\t} else {\n\t\t\t// It's a position object with x,y coordinates\n\t\t\tconst pos = positionOrEvent as { x: number; y: number }\n\t\t\tx = pos.x\n\t\t\ty = pos.y\n\t\t}\n\n\t\t// Store initial position\n\t\tthis.position = { x, y }\n\n\t\t// Create virtual reference element at the provided coordinates\n\t\tthis.virtualReference = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t},\n\t\t}\n\n\t\t// Make dialog active\n\t\tthis.setAttribute('active', '')\n\n\t\t// Return a promise that resolves when the user makes a choice\n\t\treturn new Promise<boolean>(resolve => {\n\t\t\tthis.resolvePromise = resolve\n\t\t})\n\t}\n\n\t/**\n\t * Simple API: Hide the dialog\n\t */\n\thide(result = false) {\n\t\tthis.removeAttribute('active')\n\n\t\t// Clean up any auto-update subscription\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\n\t\t// Resolve any pending promise\n\t\tif (this.resolvePromise) {\n\t\t\tthis.resolvePromise(result)\n\t\t\tthis.resolvePromise = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Set up position auto-updating when dialog content changes or window resizes\n\t */\n\tprivate setupPositioning(dialog: HTMLElement) {\n\t\tconst viewportWidth = window.innerWidth\n\t\tconst viewportHeight = window.innerHeight\n\n\t\t// Check if this is a centered dialog\n\t\tconst isCentered =\n\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\tif (isCentered) {\n\t\t\t// For centered dialogs, use CSS-based centering\n\t\t\tdialog.classList.add('centered')\n\n\t\t\t// Always set up auto-update for content changes, even for centered dialogs\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(\n\t\t\t\tdocument.body, // Use body as reference for centered dialogs\n\t\t\t\tdialog,\n\t\t\t\t() => {\n\t\t\t\t\t// If dialog has the centered class, ensure it stays visible\n\t\t\t\t\t// even when content changes its dimensions\n\t\t\t\t\tif (dialog.classList.contains('centered')) {\n\t\t\t\t\t\t// Adjust max-height to ensure dialog stays within viewport\n\t\t\t\t\t\tconst availableHeight = window.innerHeight - 40\n\t\t\t\t\t\tif (dialog.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tdialog.style.maxHeight = `${availableHeight}px`\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\telementResize: true,\n\t\t\t\t\tancestorScroll: true,\n\t\t\t\t},\n\t\t\t)\n\n\t\t\treturn\n\t\t}\n\n\t\t// Remove centered class if it exists\n\t\tdialog.classList.remove('centered')\n\n\t\t// Use Floating UI's autoUpdate to continually update position\n\t\tif (this.virtualReference) {\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(this.virtualReference, dialog, () => this.updatePosition(dialog), {\n\t\t\t\tancestorScroll: true,\n\t\t\t\tancestorResize: true,\n\t\t\t\telementResize: true,\n\t\t\t\tanimationFrame: true, // Enable continuous updates for smoother repositioning\n\t\t\t})\n\n\t\t\t// Initial positioning\n\t\t\tthis.updatePosition(dialog)\n\t\t}\n\t}\n\n\t/**\n\t * Update dialog position using Floating UI\n\t */\n\tprivate async updatePosition(dialog: HTMLElement) {\n\t\tif (!this.virtualReference) return\n\n\t\t// Force window bounds recalculation on resize\n\t\tif (this.position.x > 0 && this.position.y > 0) {\n\t\t\t// Update virtual reference to consider current window size\n\t\t\tconst viewportWidth = window.innerWidth\n\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t// Ensure position is constrained to current viewport\n\t\t\tconst x = Math.min(this.position.x, viewportWidth - 20)\n\t\t\tconst y = Math.min(this.position.y, viewportHeight - 20)\n\n\t\t\t// Update virtual reference with current viewport-constrained position\n\t\t\tthis.virtualReference = {\n\t\t\t\tgetBoundingClientRect() {\n\t\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\n\t\tconst placement: Placement = 'bottom-start'\n\t\tconst strategy: Strategy = 'absolute'\n\t\tconst margin = 20 // Standard margin from edges\n\n\t\tconst { x, y } = await computePosition(this.virtualReference, dialog, {\n\t\t\tplacement,\n\t\t\tstrategy,\n\t\t\tmiddleware: [\n\t\t\t\t// Offset from the reference point\n\t\t\t\toffset(margin),\n\n\t\t\t\t// Flip to opposite side if no space\n\t\t\t\tflip({\n\t\t\t\t\tfallbackPlacements: ['top-start', 'bottom-end', 'top-end'],\n\t\t\t\t\tfallbackStrategy: 'bestFit',\n\t\t\t\t}),\n\n\t\t\t\t// Shift along the preferred axis to stay in view\n\t\t\t\tshift({\n\t\t\t\t\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\n\t\t\t\t// Resize dialog if needed\n\t\t\t\tsize({\n\t\t\t\t\tapply({ availableWidth, availableHeight, elements }) {\n\t\t\t\t\t\t// If dialog is wider than available space\n\t\t\t\t\t\tif (elements.floating.offsetWidth > availableWidth) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxWidth: `${Math.max(availableWidth - margin * 2, 280)}px`, // Keep at least 280px if possible\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If dialog is taller than available space\n\t\t\t\t\t\tif (elements.floating.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxHeight: `${availableHeight - margin * 2}px`,\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\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\t\t\t],\n\t\t})\n\n\t\t// Apply the computed position\n\t\tObject.assign(dialog.style, {\n\t\t\tleft: `${Math.round(x)}px`,\n\t\t\ttop: `${Math.round(y)}px`,\n\t\t\ttransform: 'none', // Remove any transform that might interfere\n\t\t})\n\t}\n\n\t// Store resize subscription\n\tprivate resizeSubscription?: { unsubscribe: () => void }\n\n\t/**\n\t * Handle component disconnection from DOM\n\t */\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\n\t\t// Clean up subscriptions\n\t\tif (this.resizeSubscription) {\n\t\t\tthis.resizeSubscription.unsubscribe()\n\t\t\tthis.resizeSubscription = undefined\n\t\t}\n\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Handle component connection to DOM\n\t */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\t\n\t\t// Listen for \"where are you ricky\" events\n\t\tfromEvent<DialogWhereAreYouRickyEvent>(window, DialogWhereAreYouRicky).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).subscribe()\n\t}\n\n\t/**\n\t * Announce this dialog's presence to the service\n\t */\n\tprivate announcePresence() {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(DialogHereMorty, {\n\t\t\t\tdetail: { dialog: this },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Handle lifecycle callback when dialog is first rendered\n\t */\n\tfirstUpdated() {\n\t\tconst dialog = this.shadowRoot?.querySelector('.dialog') as HTMLElement\n\t\tif (!dialog) return\n\n\t\t// Set up positioning with Floating UI\n\t\tthis.setupPositioning(dialog)\n\n\t\t// Set up window resize subscription using RxJS with debounce\n\t\tthis.resizeSubscription = fromEvent(window, 'resize')\n\t\t\t.pipe(debounceTime(50)) // Faster response time\n\t\t\t.subscribe(() => {\n\t\t\t\t// Get current viewport dimensions\n\t\t\t\tconst viewportWidth = window.innerWidth\n\t\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t\t// If using CSS centered positioning, ensure it stays centered\n\t\t\t\tconst isCentered =\n\t\t\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\t\t\tif (isCentered) {\n\t\t\t\t\t// Update position to new center\n\t\t\t\t\tthis.position = {\n\t\t\t\t\t\tx: viewportWidth / 2,\n\t\t\t\t\t\ty: viewportHeight / 2,\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Always update position on resize\n\t\t\t\tthis.updatePosition(dialog)\n\t\t\t})\n\t}\n\n\t/**\n\t * Handle close action\n\t */\n\tprivate handleClose() {\n\t\tthis.hide(false)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('close', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<div class=\"overlay\" @click=${this.handleClose}></div>\n\n\t\t\t<div class=\"dialog\" role=\"dialog\" aria-modal=\"true\">\n\t\t\t\t<schmancy-surface rounded=\"all\" elevation=\"3\" type=\"containerHigh\">\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</schmancy-surface>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-dialog': SchmancyDialog\n\t}\n}\n","import { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\n/**\n * A basic dialog content component that doesn't add any padding or styling\n * Used for rendering raw content in a dialog\n *\n * @element schmancy-dialog-content\n * @slot default - Content slot for dialog content without any styling\n */\n@customElement('schmancy-dialog-content')\nexport class SchmancyDialogContent extends $LitElement(css`\n :host {\n display: block;\n width: 100%;\n height: 100%;\n }\n`) {\n render() {\n return html`<slot></slot>`\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'schmancy-dialog-content': SchmancyDialogContent\n }\n}"],"names":["ConfirmDialog","$LitElement","css","super","arguments","this","title","subtitle","message","confirmText","cancelText","variant","position","x","y","positionOrEvent","clientX","clientY","touches","length","pos","window","innerWidth","innerHeight","virtualReference","getBoundingClientRect","DOMRect","setAttribute","Promise","resolve","resolvePromise","confirmed","removeAttribute","cleanupAutoUpdate","dialog","viewportWidth","viewportHeight","Math","abs","classList","add","autoUpdate","document","body","contains","availableHeight","offsetHeight","style","maxHeight","elementResize","ancestorScroll","remove","updatePosition","ancestorResize","animationFrame","min","computePosition","placement","strategy","middleware","offset","flip","fallbackPlacements","fallbackStrategy","shift","padding","size","availableWidth","elements","floating","offsetWidth","Object","assign","maxWidth","max","margin","left","round","top","transform","disconnectedCallback","resizeSubscription","unsubscribe","shadowRoot","querySelector","setupPositioning","fromEvent","pipe","debounceTime","subscribe","handleConfirm","hide","dispatchEvent","CustomEvent","bubbles","composed","getConfirmButtonClass","colorMap","error","warning","success","primary","confirmColor","hasCustomContent","querySelectorAll","showButtons","trim","html","handleCancel","when","options","createElement","appendChild","width","setProperty","show","ask","event","confirm","__decorateClass","property","type","String","prototype","attribute","customElement","SchmancyDialog","constructor","result","apply","connectedCallback","DialogWhereAreYouRicky","tap","e","detail","uid","announcePresence","DialogHereMorty","handleClose","render","reflect","SchmancyDialogContent"],"mappings":"6kBAeaA,QAAAA,cAAN,cAA4BC,EAAAA,YAAYC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAAxC,CAAA,CAAA,aAAAC,CAAAA,MAAAA,GAAAC,SAqCEC,EAAAA,KAAAC,MAAA,OAMGD,KAAAE,SAAAA,OAMDF,KAAAG,QAAA,OAMIH,KAAAI,YAAA,UAMDJ,KAAAK,WAAA,SAMmBL,KAAAM,QAAA,UAWhCN,KAAQO,SAAW,CAAEC,EAAG,EAAGC,EAAG,CAAE,CAAA,CA4BhC,WAAWC,EAAAA,CAEV,IAAIF,EAAWC,EAEf,GAAKC,EAIL,GAAW,YAAaA,EAEvBF,EAAIE,EAAgBC,QACpBF,EAAIC,EAAgBE,gBACV,YAAaF,GAAmBA,EAAgBG,QAAQC,OAE9DN,EAAAE,EAAgBG,QAAQ,CAAGF,EAAAA,QAC3BF,EAAAC,EAAgBG,QAAQ,CAAA,EAAGD,YACzB,CAEN,MAAMG,EAAML,EACZF,EAAIO,EAAIP,EACRC,EAAIM,EAAIN,CAAA,MAdRD,EAAIQ,OAAOC,WAAa,EACxBR,EAAIO,OAAOE,YAAc,EA8BnB,OAbFlB,KAAAO,SAAW,CAAEC,EAAGC,EAAAA,EAAAA,CAAAA,EA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AAyI,CACS,OAAAhC,EAAAA,mBAAA,CAREkC,EAAAA,QAANA,4HAAA,CADNhB,EAAAA,cAAc,yBAAA,CAAA,EACFgB"}
package/dist/dialog.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./dialog-content-C1zsL7VE.cjs"),i=require("./dialog-service-BgqAlT7T.cjs");Object.defineProperty(exports,"ConfirmDialog",{enumerable:!0,get:()=>e.ConfirmDialog}),Object.defineProperty(exports,"SchmancyDialog",{enumerable:!0,get:()=>e.SchmancyDialog}),Object.defineProperty(exports,"SchmancyDialogContent",{enumerable:!0,get:()=>e.SchmancyDialogContent}),exports.$dialog=i.$dialog,exports.DialogService=i.DialogService;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./dialog-content-SX6qtxGj.cjs"),i=require("./dialog-service-BgqAlT7T.cjs");Object.defineProperty(exports,"ConfirmDialog",{enumerable:!0,get:()=>e.ConfirmDialog}),Object.defineProperty(exports,"SchmancyDialog",{enumerable:!0,get:()=>e.SchmancyDialog}),Object.defineProperty(exports,"SchmancyDialogContent",{enumerable:!0,get:()=>e.SchmancyDialogContent}),exports.$dialog=i.$dialog,exports.DialogService=i.DialogService;
2
2
  //# sourceMappingURL=dialog.cjs.map
package/dist/dialog.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C as i, S as r, a as c } from "./dialog-content-B3thpCG2.js";
1
+ import { C as i, S as r, a as c } from "./dialog-content-BUtwJ3HL.js";
2
2
  import { $ as g, D as l } from "./dialog-service-CnjZCTMj.js";
3
3
  export {
4
4
  g as $dialog,
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("./animated-text-D-kAHVL-.cjs");const n=require("./area.component-kvnRfth-.cjs"),t=require("./utils-BqFGvnN9.cjs");require("./autocomplete-Dez1_LQ_.cjs");const r=require("./avatar-CIi1nK5D.cjs"),q=require("./boat-Opr-JDiz.cjs");require("./spinner-BNAzXVjG.cjs");const b=require("./icon-button-A1NFKFmq.cjs"),o=require("./media-CxRMY7ct.cjs"),w=require("./checkbox-D02qLg64.cjs");require("./chips-nR84ClxC.cjs");const T=require("./circular-progress-C1VxqINu.cjs"),S=require("./code-preview-AaDZ25jE.cjs"),M=require("./payment-card-form-DbEZ8Js1.cjs"),d=require("./date-range-BTa3EHE4.cjs"),g=require("./delay-CBu7O627.cjs"),l=require("./dialog-content-C1zsL7VE.cjs"),p=require("./dialog-service-BgqAlT7T.cjs"),h=require("./ripple-C2BHbhcS.cjs");require("./divider-BBr_f7I9.cjs");const s=require("./dropdown-content-q5TJhsvd.cjs"),C=require("./timezone-BW4gugCz.cjs");require("./form-BkVMKRp7.cjs"),require("./icon-aeFENeVj.cjs"),require("./input-q8VOTI3J.cjs");const i=require("./flex-DcCOzqAb.cjs"),u=require("./list-YOtl6JRk.cjs");require("./menu-D0Wv-94q.cjs");const m=require("./notification-service-fl9rTVO5.cjs");require("./option-BQ0PXMOa.cjs");const f=require("./radio-button-BkYPf2-q.cjs"),A=require("./rxjs-utils.cjs");require("rxjs"),require("./index-DyJ0oDpR.cjs");const R=require("./select-5yP3bof1.cjs");require("./sheet-BcN4mBoD.cjs");const a=require("./theme.component-CIsakuvd.cjs"),O=require("./slider-BxT70Fsi.cjs"),y=require("./schmancy-steps-container-tKeAaFIY.cjs"),c=require("./context-object-K_1gDFu-.cjs"),e=require("./selector-hook-CYMLsOvh.cjs"),P=require("./surface-BWZ0Kqca.cjs"),j=require("./table-IXyFmT0L.cjs");require("./tabs-compatibility-D4J5od5-.cjs"),require("./textarea-Dl8avXEo.cjs");const I=require("./theme.interface-Xg5Zi46a.cjs");require("./theme-button-rjXu-3em.cjs");const D=require("./tooltip-DUEo4iG2.cjs"),N=require("./tree-CSCSIz67.cjs"),v=require("./types.cjs"),x=require("./typewriter-BuQA40J-.cjs"),E=require("./typography-DjwFfw1O.cjs"),H=require("./intersection-CVvaDv96.cjs");exports.FINDING_MORTIES=n.FINDING_MORTIES,exports.HERE_RICKY=n.HERE_RICKY,exports.HISTORY_STRATEGY=n.HISTORY_STRATEGY,Object.defineProperty(exports,"SchmancyArea",{enumerable:!0,get:()=>n.SchmancyArea}),exports.area=n.area,exports.routerHistory=n.routerHistory,exports.buildQueryString=t.buildQueryString,exports.compareActiveRoutes=t.compareActiveRoutes,exports.compareCustomElementConstructors=t.compareCustomElementConstructors,exports.compareRouteActions=t.compareRouteActions,exports.createRouteCacheKey=t.createRouteCacheKey,exports.debounce=t.debounce,exports.decodeRouteState=t.decodeRouteState,exports.deepMerge=t.deepMerge,exports.encodeRouteState=t.encodeRouteState,exports.extractQueryParams=t.extractQueryParams,exports.getTagName=t.getTagName,exports.isObject=t.isObject,exports.normalizeTagName=t.normalizeTagName,exports.sanitizeRouteState=t.sanitizeRouteState,exports.$drawer=r.$drawer,exports.HereMorty=r.HereMorty,Object.defineProperty(exports,"SchmancyAvatar",{enumerable:!0,get:()=>r.SchmancyAvatar}),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,"SchmancyBoat",{enumerable:!0,get:()=>q.SchmancyBoat}),Object.defineProperty(exports,"SchmancyButton",{enumerable:!0,get:()=>b.SchmancyButton}),Object.defineProperty(exports,"SchmnacyIconButton",{enumerable:!0,get:()=>b.SchmnacyIconButton}),Object.defineProperty(exports,"SchmancyCard",{enumerable:!0,get:()=>o.SchmancyCard}),Object.defineProperty(exports,"SchmancyCardAction",{enumerable:!0,get:()=>o.SchmancyCardAction}),Object.defineProperty(exports,"SchmancyCardContent",{enumerable:!0,get:()=>o.SchmancyCardContent}),Object.defineProperty(exports,"SchmancyCardMedia",{enumerable:!0,get:()=>o.SchmancyCardMedia}),Object.defineProperty(exports,"SchmancyCheckbox",{enumerable:!0,get:()=>w.SchmancyCheckbox}),Object.defineProperty(exports,"SchmancyCircularProgress",{enumerable:!0,get:()=>T.SchmancyCircularProgress}),Object.defineProperty(exports,"SchmancyCode",{enumerable:!0,get:()=>S.SchmancyCode}),Object.defineProperty(exports,"SchmancyCodeHighlight",{enumerable:!0,get:()=>S.SchmancyCode}),Object.defineProperty(exports,"SchmancyCodePreview",{enumerable:!0,get:()=>S.SchmancyCodePreview}),Object.defineProperty(exports,"SchmancyPaymentCardForm",{enumerable:!0,get:()=>M.SchmancyPaymentCardForm}),Object.defineProperty(exports,"SchmancyDateRange",{enumerable:!0,get:()=>d.SchmancyDateRange}),exports.validateInitialDateRange=d.validateInitialDateRange,Object.defineProperty(exports,"SchmancyDelay",{enumerable:!0,get:()=>g.SchmancyDelay}),exports.delayContext=g.delayContext,Object.defineProperty(exports,"ConfirmDialog",{enumerable:!0,get:()=>l.ConfirmDialog}),Object.defineProperty(exports,"SchmancyDialog",{enumerable:!0,get:()=>l.SchmancyDialog}),Object.defineProperty(exports,"SchmancyDialogContent",{enumerable:!0,get:()=>l.SchmancyDialogContent}),exports.$dialog=p.$dialog,exports.DialogService=p.DialogService,exports.color=h.color,exports.fullHeight=h.fullHeight,exports.ripple=h.ripple,Object.defineProperty(exports,"SchmancyDropdown",{enumerable:!0,get:()=>s.SchmancyDropdown}),Object.defineProperty(exports,"SchmancyDropdownContent",{enumerable:!0,get:()=>s.SchmancyDropdownContent}),Object.defineProperty(exports,"SchmancyCountriesSelect",{enumerable:!0,get:()=>C.SchmancyCountriesSelect}),Object.defineProperty(exports,"SchmancyTimezonesSelect",{enumerable:!0,get:()=>C.SchmancyTimezonesSelect}),Object.defineProperty(exports,"SchmancyFlex",{enumerable:!0,get:()=>i.SchmancyFlex}),Object.defineProperty(exports,"SchmancyFlexV2",{enumerable:!0,get:()=>i.SchmancyFlexV2}),Object.defineProperty(exports,"SchmancyGrid",{enumerable:!0,get:()=>i.SchmancyGrid}),Object.defineProperty(exports,"SchmancyScroll",{enumerable:!0,get:()=>i.SchmancyScroll}),Object.defineProperty(exports,"List",{enumerable:!0,get:()=>u.List}),Object.defineProperty(exports,"SchmancyListItem",{enumerable:!0,get:()=>u.SchmancyListItem}),exports.SchmancyListTypeContext=u.SchmancyListTypeContext,exports.$notify=m.$notify,exports.NotificationAudioService=m.NotificationAudioService,Object.defineProperty(exports,"SchmancyNotification",{enumerable:!0,get:()=>m.SchmancyNotification}),Object.defineProperty(exports,"SchmancyNotificationContainer",{enumerable:!0,get:()=>m.SchmancyNotificationContainer}),Object.defineProperty(exports,"RadioButton",{enumerable:!0,get:()=>f.RadioButton}),Object.defineProperty(exports,"RadioGroup",{enumerable:!0,get:()=>f.RadioGroup}),exports.mutationObserver=A.mutationObserver,Object.defineProperty(exports,"SchmancySelect",{enumerable:!0,get:()=>R.SchmancySelect}),exports.SchmancySheetPosition=a.SchmancySheetPosition,Object.defineProperty(exports,"SchmancyThemeComponent",{enumerable:!0,get:()=>a.SchmancyThemeComponent}),exports.SheetHereMorty=a.SheetHereMorty,exports.SheetWhereAreYouRicky=a.SheetWhereAreYouRicky,exports.ThemeHereIAm=a.ThemeHereIAm,exports.ThemeWhereAreYou=a.ThemeWhereAreYou,exports.formateTheme=a.formateTheme,exports.sheet=a.sheet,exports.tailwindStyles=a.tailwindStyles,Object.defineProperty(exports,"SchmancySlide",{enumerable:!0,get:()=>O.SchmancySlide}),Object.defineProperty(exports,"SchmancySlider",{enumerable:!0,get:()=>O.SchmancySlider}),Object.defineProperty(exports,"SchmancyStep",{enumerable:!0,get:()=>y.SchmancyStep}),Object.defineProperty(exports,"SchmancyStepsContainer",{enumerable:!0,get:()=>y.SchmancyStepsContainer}),exports.StepsController=y.StepsController,exports.stepsContext=y.stepsContext,exports.BaseStore=c.BaseStore,exports.IndexedDBStorageManager=c.IndexedDBStorageManager,exports.LocalStorageManager=c.LocalStorageManager,exports.MemoryStorageManager=c.MemoryStorageManager,exports.SchmancyArrayStore=c.SchmancyArrayStore,exports.SchmancyStoreObject=c.SchmancyStoreObject,exports.SessionStorageManager=c.SessionStorageManager,exports.StoreError=c.StoreError,exports.createStorageManager=c.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:()=>j.SchmancyDataTable}),Object.defineProperty(exports,"SchmancyTableRow",{enumerable:!0,get:()=>j.SchmancyTableRow}),exports.SchmancyTheme=I.SchmancyTheme,Object.defineProperty(exports,"SchmancyTooltip",{enumerable:!0,get:()=>D.SchmancyTooltip}),exports.tooltip=D.tooltip,Object.defineProperty(exports,"SchmancyTree",{enumerable:!0,get:()=>N.SchmancyTree}),exports.SchmancyEvents=v.SchmancyEvents,Object.defineProperty(exports,"TypewriterElement",{enumerable:!0,get:()=>x.TypewriterElement}),Object.defineProperty(exports,"SchmancyTypography",{enumerable:!0,get:()=>E.SchmancyTypography}),exports.intersection$=H.intersection$;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("./animated-text-D-kAHVL-.cjs");const n=require("./area.component-kvnRfth-.cjs"),t=require("./utils-BqFGvnN9.cjs");require("./autocomplete-Dez1_LQ_.cjs");const r=require("./avatar-DHkt5Sl6.cjs"),q=require("./boat-Opr-JDiz.cjs");require("./spinner-BNAzXVjG.cjs");const b=require("./icon-button-A1NFKFmq.cjs"),o=require("./media-CxRMY7ct.cjs"),w=require("./checkbox-D02qLg64.cjs");require("./chips-nR84ClxC.cjs");const T=require("./circular-progress-C1VxqINu.cjs"),S=require("./code-preview-AaDZ25jE.cjs"),M=require("./payment-card-form-DbEZ8Js1.cjs"),d=require("./date-range-DE62Ps16.cjs"),g=require("./delay-CBu7O627.cjs"),l=require("./dialog-content-SX6qtxGj.cjs"),p=require("./dialog-service-BgqAlT7T.cjs"),h=require("./ripple-C2BHbhcS.cjs");require("./divider-BBr_f7I9.cjs");const s=require("./dropdown-content-q5TJhsvd.cjs"),C=require("./timezone-BW4gugCz.cjs");require("./form-BkVMKRp7.cjs"),require("./icon-aeFENeVj.cjs"),require("./input-q8VOTI3J.cjs");const i=require("./flex-DcCOzqAb.cjs"),u=require("./list-YOtl6JRk.cjs");require("./menu-D0Wv-94q.cjs");const m=require("./notification-service-fl9rTVO5.cjs");require("./option-BQ0PXMOa.cjs");const f=require("./radio-button-BkYPf2-q.cjs"),A=require("./rxjs-utils.cjs");require("rxjs"),require("./index-DyJ0oDpR.cjs");const R=require("./select-5yP3bof1.cjs");require("./sheet-BcN4mBoD.cjs");const a=require("./theme.component-CIsakuvd.cjs"),O=require("./slider-BxT70Fsi.cjs"),y=require("./schmancy-steps-container-tKeAaFIY.cjs"),c=require("./context-object-K_1gDFu-.cjs"),e=require("./selector-hook-CYMLsOvh.cjs"),P=require("./surface-BWZ0Kqca.cjs"),j=require("./table-IXyFmT0L.cjs");require("./tabs-compatibility-D4J5od5-.cjs"),require("./textarea-Dl8avXEo.cjs");const I=require("./theme.interface-Xg5Zi46a.cjs");require("./theme-button-rjXu-3em.cjs");const D=require("./tooltip-DUEo4iG2.cjs"),N=require("./tree-CSCSIz67.cjs"),v=require("./types.cjs"),x=require("./typewriter-BuQA40J-.cjs"),E=require("./typography-DjwFfw1O.cjs"),H=require("./intersection-CVvaDv96.cjs");exports.FINDING_MORTIES=n.FINDING_MORTIES,exports.HERE_RICKY=n.HERE_RICKY,exports.HISTORY_STRATEGY=n.HISTORY_STRATEGY,Object.defineProperty(exports,"SchmancyArea",{enumerable:!0,get:()=>n.SchmancyArea}),exports.area=n.area,exports.routerHistory=n.routerHistory,exports.buildQueryString=t.buildQueryString,exports.compareActiveRoutes=t.compareActiveRoutes,exports.compareCustomElementConstructors=t.compareCustomElementConstructors,exports.compareRouteActions=t.compareRouteActions,exports.createRouteCacheKey=t.createRouteCacheKey,exports.debounce=t.debounce,exports.decodeRouteState=t.decodeRouteState,exports.deepMerge=t.deepMerge,exports.encodeRouteState=t.encodeRouteState,exports.extractQueryParams=t.extractQueryParams,exports.getTagName=t.getTagName,exports.isObject=t.isObject,exports.normalizeTagName=t.normalizeTagName,exports.sanitizeRouteState=t.sanitizeRouteState,exports.$drawer=r.$drawer,exports.HereMorty=r.HereMorty,Object.defineProperty(exports,"SchmancyAvatar",{enumerable:!0,get:()=>r.SchmancyAvatar}),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,"SchmancyBoat",{enumerable:!0,get:()=>q.SchmancyBoat}),Object.defineProperty(exports,"SchmancyButton",{enumerable:!0,get:()=>b.SchmancyButton}),Object.defineProperty(exports,"SchmnacyIconButton",{enumerable:!0,get:()=>b.SchmnacyIconButton}),Object.defineProperty(exports,"SchmancyCard",{enumerable:!0,get:()=>o.SchmancyCard}),Object.defineProperty(exports,"SchmancyCardAction",{enumerable:!0,get:()=>o.SchmancyCardAction}),Object.defineProperty(exports,"SchmancyCardContent",{enumerable:!0,get:()=>o.SchmancyCardContent}),Object.defineProperty(exports,"SchmancyCardMedia",{enumerable:!0,get:()=>o.SchmancyCardMedia}),Object.defineProperty(exports,"SchmancyCheckbox",{enumerable:!0,get:()=>w.SchmancyCheckbox}),Object.defineProperty(exports,"SchmancyCircularProgress",{enumerable:!0,get:()=>T.SchmancyCircularProgress}),Object.defineProperty(exports,"SchmancyCode",{enumerable:!0,get:()=>S.SchmancyCode}),Object.defineProperty(exports,"SchmancyCodeHighlight",{enumerable:!0,get:()=>S.SchmancyCode}),Object.defineProperty(exports,"SchmancyCodePreview",{enumerable:!0,get:()=>S.SchmancyCodePreview}),Object.defineProperty(exports,"SchmancyPaymentCardForm",{enumerable:!0,get:()=>M.SchmancyPaymentCardForm}),Object.defineProperty(exports,"SchmancyDateRange",{enumerable:!0,get:()=>d.SchmancyDateRange}),exports.validateInitialDateRange=d.validateInitialDateRange,Object.defineProperty(exports,"SchmancyDelay",{enumerable:!0,get:()=>g.SchmancyDelay}),exports.delayContext=g.delayContext,Object.defineProperty(exports,"ConfirmDialog",{enumerable:!0,get:()=>l.ConfirmDialog}),Object.defineProperty(exports,"SchmancyDialog",{enumerable:!0,get:()=>l.SchmancyDialog}),Object.defineProperty(exports,"SchmancyDialogContent",{enumerable:!0,get:()=>l.SchmancyDialogContent}),exports.$dialog=p.$dialog,exports.DialogService=p.DialogService,exports.color=h.color,exports.fullHeight=h.fullHeight,exports.ripple=h.ripple,Object.defineProperty(exports,"SchmancyDropdown",{enumerable:!0,get:()=>s.SchmancyDropdown}),Object.defineProperty(exports,"SchmancyDropdownContent",{enumerable:!0,get:()=>s.SchmancyDropdownContent}),Object.defineProperty(exports,"SchmancyCountriesSelect",{enumerable:!0,get:()=>C.SchmancyCountriesSelect}),Object.defineProperty(exports,"SchmancyTimezonesSelect",{enumerable:!0,get:()=>C.SchmancyTimezonesSelect}),Object.defineProperty(exports,"SchmancyFlex",{enumerable:!0,get:()=>i.SchmancyFlex}),Object.defineProperty(exports,"SchmancyFlexV2",{enumerable:!0,get:()=>i.SchmancyFlexV2}),Object.defineProperty(exports,"SchmancyGrid",{enumerable:!0,get:()=>i.SchmancyGrid}),Object.defineProperty(exports,"SchmancyScroll",{enumerable:!0,get:()=>i.SchmancyScroll}),Object.defineProperty(exports,"List",{enumerable:!0,get:()=>u.List}),Object.defineProperty(exports,"SchmancyListItem",{enumerable:!0,get:()=>u.SchmancyListItem}),exports.SchmancyListTypeContext=u.SchmancyListTypeContext,exports.$notify=m.$notify,exports.NotificationAudioService=m.NotificationAudioService,Object.defineProperty(exports,"SchmancyNotification",{enumerable:!0,get:()=>m.SchmancyNotification}),Object.defineProperty(exports,"SchmancyNotificationContainer",{enumerable:!0,get:()=>m.SchmancyNotificationContainer}),Object.defineProperty(exports,"RadioButton",{enumerable:!0,get:()=>f.RadioButton}),Object.defineProperty(exports,"RadioGroup",{enumerable:!0,get:()=>f.RadioGroup}),exports.mutationObserver=A.mutationObserver,Object.defineProperty(exports,"SchmancySelect",{enumerable:!0,get:()=>R.SchmancySelect}),exports.SchmancySheetPosition=a.SchmancySheetPosition,Object.defineProperty(exports,"SchmancyThemeComponent",{enumerable:!0,get:()=>a.SchmancyThemeComponent}),exports.SheetHereMorty=a.SheetHereMorty,exports.SheetWhereAreYouRicky=a.SheetWhereAreYouRicky,exports.ThemeHereIAm=a.ThemeHereIAm,exports.ThemeWhereAreYou=a.ThemeWhereAreYou,exports.formateTheme=a.formateTheme,exports.sheet=a.sheet,exports.tailwindStyles=a.tailwindStyles,Object.defineProperty(exports,"SchmancySlide",{enumerable:!0,get:()=>O.SchmancySlide}),Object.defineProperty(exports,"SchmancySlider",{enumerable:!0,get:()=>O.SchmancySlider}),Object.defineProperty(exports,"SchmancyStep",{enumerable:!0,get:()=>y.SchmancyStep}),Object.defineProperty(exports,"SchmancyStepsContainer",{enumerable:!0,get:()=>y.SchmancyStepsContainer}),exports.StepsController=y.StepsController,exports.stepsContext=y.stepsContext,exports.BaseStore=c.BaseStore,exports.IndexedDBStorageManager=c.IndexedDBStorageManager,exports.LocalStorageManager=c.LocalStorageManager,exports.MemoryStorageManager=c.MemoryStorageManager,exports.SchmancyArrayStore=c.SchmancyArrayStore,exports.SchmancyStoreObject=c.SchmancyStoreObject,exports.SessionStorageManager=c.SessionStorageManager,exports.StoreError=c.StoreError,exports.createStorageManager=c.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:()=>j.SchmancyDataTable}),Object.defineProperty(exports,"SchmancyTableRow",{enumerable:!0,get:()=>j.SchmancyTableRow}),exports.SchmancyTheme=I.SchmancyTheme,Object.defineProperty(exports,"SchmancyTooltip",{enumerable:!0,get:()=>D.SchmancyTooltip}),exports.tooltip=D.tooltip,Object.defineProperty(exports,"SchmancyTree",{enumerable:!0,get:()=>N.SchmancyTree}),exports.SchmancyEvents=v.SchmancyEvents,Object.defineProperty(exports,"TypewriterElement",{enumerable:!0,get:()=>x.TypewriterElement}),Object.defineProperty(exports,"SchmancyTypography",{enumerable:!0,get:()=>E.SchmancyTypography}),exports.intersection$=H.intersection$;
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import "./animated-text-C14QnAsk.js";
2
2
  import { F as C, H as g, b as u, S as D, a as b, r as w } from "./area.component-DD3k-3yp.js";
3
3
  import { l as M, h as A, c as R, f as I, j as v, a as N, b as H, d as E, e as B, k as F, g as O, i as $, n as j, s as k } from "./utils-jduntaQU.js";
4
4
  import "./autocomplete-DgrPHogj.js";
5
- import { $ as P, H as Y, q as z, S as G, f as W, c as V, g as K, d as _, e as q, h as Q, a as J, b as U, j as X, l as Z, m as aa, n as ea, k as ra, o as ta, p as oa, W as ca, s as sa, i as na, t as ma } from "./avatar-aJw7nOfK.js";
5
+ import { $ as P, H as Y, q as z, S as G, f as W, c as V, g as K, d as _, e as q, h as Q, a as J, b as U, j as X, l as Z, m as aa, n as ea, k as ra, o as ta, p as oa, W as ca, s as sa, i as na, t as ma } from "./avatar-D2CwIkLP.js";
6
6
  import { S as ia } from "./boat-QojjCx3K.js";
7
7
  import "./spinner-WpaBY1JF.js";
8
8
  import { S as ha, a as pa } from "./icon-button-C10pky9Q.js";
@@ -12,9 +12,9 @@ import "./chips-xakYpmLk.js";
12
12
  import { S as ba } from "./circular-progress-DITkB69y.js";
13
13
  import { S as Ta, S as Ma, a as Aa } from "./code-preview-ct_lICzT.js";
14
14
  import { S as Ia } from "./payment-card-form-BTpnbZFg.js";
15
- import { S as Na, v as Ha } from "./date-range-CSEw_dDa.js";
15
+ import { S as Na, v as Ha } from "./date-range-BsCL8hQs.js";
16
16
  import { S as Ba, d as Fa } from "./delay-Dvg8k4NQ.js";
17
- import { C as $a, S as ja, a as ka } from "./dialog-content-B3thpCG2.js";
17
+ import { C as $a, S as ja, a as ka } from "./dialog-content-BUtwJ3HL.js";
18
18
  import { $ as Pa, D as Ya } from "./dialog-service-CnjZCTMj.js";
19
19
  import { c as Ga, f as Wa, r as Va } from "./ripple-BumgqsDT.js";
20
20
  import "./divider-DexSqAwi.js";
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./avatar-CIi1nK5D.cjs");exports.$drawer=e.$drawer,Object.defineProperty(exports,"SchmancyDrawerAppbar",{enumerable:!0,get:()=>e.SchmancyDrawerAppbar}),exports.SchmancyDrawerNavbarMode=e.SchmancyDrawerNavbarMode,exports.SchmancyDrawerNavbarState=e.SchmancyDrawerNavbarState,Object.defineProperty(exports,"SchmancyNavigationDrawer",{enumerable:!0,get:()=>e.SchmancyNavigationDrawer}),Object.defineProperty(exports,"SchmancyNavigationDrawerContent",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerContent}),Object.defineProperty(exports,"SchmancyNavigationDrawerSidebar",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerSidebar}),exports.schmancyNavDrawer=e.schmancyNavDrawer;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./avatar-DHkt5Sl6.cjs");exports.$drawer=e.$drawer,Object.defineProperty(exports,"SchmancyDrawerAppbar",{enumerable:!0,get:()=>e.SchmancyDrawerAppbar}),exports.SchmancyDrawerNavbarMode=e.SchmancyDrawerNavbarMode,exports.SchmancyDrawerNavbarState=e.SchmancyDrawerNavbarState,Object.defineProperty(exports,"SchmancyNavigationDrawer",{enumerable:!0,get:()=>e.SchmancyNavigationDrawer}),Object.defineProperty(exports,"SchmancyNavigationDrawerContent",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerContent}),Object.defineProperty(exports,"SchmancyNavigationDrawerSidebar",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerSidebar}),exports.schmancyNavDrawer=e.schmancyNavDrawer;
2
2
  //# sourceMappingURL=nav-drawer.cjs.map
@@ -1,4 +1,4 @@
1
- import { $ as c, j as e, l as n, m, n as s, k as i, o, i as t } from "./avatar-aJw7nOfK.js";
1
+ import { $ as c, j as e, l as n, m, n as s, k as i, o, i as t } from "./avatar-D2CwIkLP.js";
2
2
  export {
3
3
  c as $drawer,
4
4
  e as SchmancyDrawerAppbar,
package/dist/teleport.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./avatar-CIi1nK5D.cjs");exports.HereMorty=e.HereMorty,Object.defineProperty(exports,"SchmancyTeleportation",{enumerable:!0,get:()=>e.SchmancyTeleportation}),exports.WhereAreYouRicky=e.WhereAreYouRicky,exports.teleport=e.teleport;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./avatar-DHkt5Sl6.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
package/dist/teleport.js CHANGED
@@ -1,4 +1,4 @@
1
- import { H as o, p as t, W as a, t as p } from "./avatar-aJw7nOfK.js";
1
+ import { H as o, p as t, W as a, t as p } from "./avatar-D2CwIkLP.js";
2
2
  export {
3
3
  o as HereMorty,
4
4
  t as SchmancyTeleportation,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mhmo91/schmancy",
3
- "version": "0.4.5",
3
+ "version": "0.4.7",
4
4
  "description": "UI library build with web components",
5
5
  "main": "./dist/index.js",
6
6
  "packageManager": "yarn@4.9.2",
@@ -1,121 +0,0 @@
1
- "use strict";const j=require("rxjs");require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const ut=require("./litElement.mixin-Do6OsQmn.cjs");require("./tailwind.mixin-BvJKKv72.cjs");const dt=require("./_commonjsHelpers-k2hpEU-q.cjs"),B=require("lit"),w=require("lit/decorators.js"),J=require("lit/directives/if-defined.js"),K=require("./dialog-service-BgqAlT7T.cjs");var at,rt={exports:{}},ht=(at||(at=1,rt.exports=function(){var t=1e3,s=6e4,e=36e5,o="millisecond",y="second",u="minute",c="hour",p="day",Y="week",T="month",E="quarter",x="year",P="date",M="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,Q=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,N={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(h){var n=["th","st","nd","rd"],a=h%100;return"["+h+(n[(a-20)%10]||n[a]||n[0])+"]"}},D=function(h,n,a){var d=String(h);return!d||d.length>=n?h:""+Array(n+1-d.length).join(a)+h},ct={s:D,z:function(h){var n=-h.utcOffset(),a=Math.abs(n),d=Math.floor(a/60),r=a%60;return(n<=0?"+":"-")+D(d,2,"0")+":"+D(r,2,"0")},m:function h(n,a){if(n.date()<a.date())return-h(a,n);var d=12*(a.year()-n.year())+(a.month()-n.month()),r=n.clone().add(d,T),l=a-r<0,m=n.clone().add(d+(l?-1:1),T);return+(-(d+(a-r)/(l?r-m:m-r))||0)},a:function(h){return h<0?Math.ceil(h)||0:Math.floor(h)},p:function(h){return{M:T,y:x,w:Y,d:p,D:P,h:c,m:u,s:y,ms:o,Q:E}[h]||String(h||"").toLowerCase().replace(/s$/,"")},u:function(h){return h===void 0}},H="en",C={};C[H]=N;var tt="$isDayjsObject",G=function(h){return h instanceof I||!(!h||!h[tt])},U=function h(n,a,d){var r;if(!n)return H;if(typeof n=="string"){var l=n.toLowerCase();C[l]&&(r=l),a&&(C[l]=a,r=l);var m=n.split("-");if(!r&&m.length>1)return h(m[0])}else{var v=n.name;C[v]=n,r=v}return!d&&r&&(H=r),r||!d&&H},$=function(h,n){if(G(h))return h.clone();var a=typeof n=="object"?n:{};return a.date=h,a.args=arguments,new I(a)},g=ct;g.l=U,g.i=G,g.w=function(h,n){return $(h,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var I=function(){function h(a){this.$L=U(a.locale,null,!0),this.parse(a),this.$x=this.$x||a.x||{},this[tt]=!0}var n=h.prototype;return n.parse=function(a){this.$d=function(d){var r=d.date,l=d.utc;if(r===null)return new Date(NaN);if(g.u(r))return new Date;if(r instanceof Date)return new Date(r);if(typeof r=="string"&&!/Z$/i.test(r)){var m=r.match(f);if(m){var v=m[2]-1||0,b=(m[7]||"0").substring(0,3);return l?new Date(Date.UTC(m[1],v,m[3]||1,m[4]||0,m[5]||0,m[6]||0,b)):new Date(m[1],v,m[3]||1,m[4]||0,m[5]||0,m[6]||0,b)}}return new Date(r)}(a),this.init()},n.init=function(){var a=this.$d;this.$y=a.getFullYear(),this.$M=a.getMonth(),this.$D=a.getDate(),this.$W=a.getDay(),this.$H=a.getHours(),this.$m=a.getMinutes(),this.$s=a.getSeconds(),this.$ms=a.getMilliseconds()},n.$utils=function(){return g},n.isValid=function(){return this.$d.toString()!==M},n.isSame=function(a,d){var r=$(a);return this.startOf(d)<=r&&r<=this.endOf(d)},n.isAfter=function(a,d){return $(a)<this.startOf(d)},n.isBefore=function(a,d){return this.endOf(d)<$(a)},n.$g=function(a,d,r){return g.u(a)?this[d]:this.set(r,a)},n.unix=function(){return Math.floor(this.valueOf()/1e3)},n.valueOf=function(){return this.$d.getTime()},n.startOf=function(a,d){var r=this,l=!!g.u(d)||d,m=g.p(a),v=function(_,k){var q=g.w(r.$u?Date.UTC(r.$y,k,_):new Date(r.$y,k,_),r);return l?q:q.endOf(p)},b=function(_,k){return g.w(r.toDate()[_].apply(r.toDate("s"),(l?[0,0,0,0]:[23,59,59,999]).slice(k)),r)},O=this.$W,F=this.$M,R=this.$D,A="set"+(this.$u?"UTC":"");switch(m){case x:return l?v(1,0):v(31,11);case T:return l?v(1,F):v(0,F+1);case Y:var L=this.$locale().weekStart||0,V=(O<L?O+7:O)-L;return v(l?R-V:R+(6-V),F);case p:case P:return b(A+"Hours",0);case c:return b(A+"Minutes",1);case u:return b(A+"Seconds",2);case y:return b(A+"Milliseconds",3);default:return this.clone()}},n.endOf=function(a){return this.startOf(a,!1)},n.$set=function(a,d){var r,l=g.p(a),m="set"+(this.$u?"UTC":""),v=(r={},r[p]=m+"Date",r[P]=m+"Date",r[T]=m+"Month",r[x]=m+"FullYear",r[c]=m+"Hours",r[u]=m+"Minutes",r[y]=m+"Seconds",r[o]=m+"Milliseconds",r)[l],b=l===p?this.$D+(d-this.$W):d;if(l===T||l===x){var O=this.clone().set(P,1);O.$d[v](b),O.init(),this.$d=O.set(P,Math.min(this.$D,O.daysInMonth())).$d}else v&&this.$d[v](b);return this.init(),this},n.set=function(a,d){return this.clone().$set(a,d)},n.get=function(a){return this[g.p(a)]()},n.add=function(a,d){var r,l=this;a=Number(a);var m=g.p(d),v=function(F){var R=$(l);return g.w(R.date(R.date()+Math.round(F*a)),l)};if(m===T)return this.set(T,this.$M+a);if(m===x)return this.set(x,this.$y+a);if(m===p)return v(1);if(m===Y)return v(7);var b=(r={},r[u]=s,r[c]=e,r[y]=t,r)[m]||1,O=this.$d.getTime()+a*b;return g.w(O,this)},n.subtract=function(a,d){return this.add(-1*a,d)},n.format=function(a){var d=this,r=this.$locale();if(!this.isValid())return r.invalidDate||M;var l=a||"YYYY-MM-DDTHH:mm:ssZ",m=g.z(this),v=this.$H,b=this.$m,O=this.$M,F=r.weekdays,R=r.months,A=r.meridiem,L=function(k,q,W,z){return k&&(k[q]||k(d,l))||W[q].slice(0,z)},V=function(k){return g.s(v%12||12,k,"0")},_=A||function(k,q,W){var z=k<12?"AM":"PM";return W?z.toLowerCase():z};return l.replace(Q,function(k,q){return q||function(W){switch(W){case"YY":return String(d.$y).slice(-2);case"YYYY":return g.s(d.$y,4,"0");case"M":return O+1;case"MM":return g.s(O+1,2,"0");case"MMM":return L(r.monthsShort,O,R,3);case"MMMM":return L(R,O);case"D":return d.$D;case"DD":return g.s(d.$D,2,"0");case"d":return String(d.$W);case"dd":return L(r.weekdaysMin,d.$W,F,2);case"ddd":return L(r.weekdaysShort,d.$W,F,3);case"dddd":return F[d.$W];case"H":return String(v);case"HH":return g.s(v,2,"0");case"h":return V(1);case"hh":return V(2);case"a":return _(v,b,!0);case"A":return _(v,b,!1);case"m":return String(b);case"mm":return g.s(b,2,"0");case"s":return String(d.$s);case"ss":return g.s(d.$s,2,"0");case"SSS":return g.s(d.$ms,3,"0");case"Z":return m}return null}(k)||m.replace(":","")})},n.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},n.diff=function(a,d,r){var l,m=this,v=g.p(d),b=$(a),O=(b.utcOffset()-this.utcOffset())*s,F=this-b,R=function(){return g.m(m,b)};switch(v){case x:l=R()/12;break;case T:l=R();break;case E:l=R()/3;break;case Y:l=(F-O)/6048e5;break;case p:l=(F-O)/864e5;break;case c:l=F/e;break;case u:l=F/s;break;case y:l=F/t;break;default:l=F}return r?l:g.a(l)},n.daysInMonth=function(){return this.endOf(T).$D},n.$locale=function(){return C[this.$L]},n.locale=function(a,d){if(!a)return this.$L;var r=this.clone(),l=U(a,d,!0);return l&&(r.$L=l),r},n.clone=function(){return g.w(this.$d,this)},n.toDate=function(){return new Date(this.valueOf())},n.toJSON=function(){return this.isValid()?this.toISOString():null},n.toISOString=function(){return this.$d.toISOString()},n.toString=function(){return this.$d.toUTCString()},h}(),et=I.prototype;return $.prototype=et,[["$ms",o],["$s",y],["$m",u],["$H",c],["$W",p],["$M",T],["$y",x],["$D",P]].forEach(function(h){et[h[1]]=function(n){return this.$g(n,h[0],h[1])}}),$.extend=function(h,n){return h.$i||(h(n,I,$),h.$i=!0),$},$.locale=U,$.isDayjs=G,$.unix=function(h){return $(1e3*h)},$.en=C[H],$.Ls=C,$.p={},$}()),rt.exports);const i=dt.getDefaultExportFromCjs(ht);var st,nt={exports:{}},Z,X,lt=st?nt.exports:(st=1,nt.exports=(Z="month",X="quarter",function(t,s){var e=s.prototype;e.quarter=function(u){return this.$utils().u(u)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(u-1))};var o=e.add;e.add=function(u,c){return u=Number(u),this.$utils().p(c)===X?this.add(3*u,Z):o.bind(this)(u,c)};var y=e.startOf;e.startOf=function(u,c){var p=this.$utils(),Y=!!p.u(c)||c;if(p.p(u)===X){var T=this.quarter()-1;return Y?this.month(3*T).startOf(Z).startOf("day"):this.month(3*T+2).endOf(Z).endOf("day")}return y.bind(this)(u,c)}}));const mt=dt.getDefaultExportFromCjs(lt);function it(t,s){if(!t)return null;const e=i(t);return e.isValid()?e.format(s):null}function ot(t,s,e){const o=it(t,e),y=it(s,e);return{dateFrom:o,dateTo:y,isValid:o!==null&&y!==null}}var ft=Object.defineProperty,pt=Object.getOwnPropertyDescriptor,S=(t,s,e,o)=>{for(var y,u=o>1?void 0:o?pt(s,e):s,c=t.length-1;c>=0;c--)(y=t[c])&&(u=(o?y(s,e,u):y(u))||u);return o&&u&&ft(s,e,u),u};i.extend(mt),exports.SchmancyDateRange=class extends ut.$LitElement(){constructor(){super(...arguments),this.type="date",this.dateFrom={label:"From",value:""},this.dateTo={label:"To",value:""},this.customPresets=[],this.disabled=!1,this.required=!1,this.placeholder="Select date range",this.clearable=!0,this.isOpen=!1,this.selectedDateRange="",this.activePreset=null,this.announceMessage="",this.isMobile=!1,this.presetRanges=[],this.presetCategories=[],this.memoizedPresets=new Map}connectedCallback(){super.connectedCallback(),this.initPresetRanges(),this.checkMobileView();const t=this.getDateFormat(),s=ot(this.dateFrom.value,this.dateTo.value,t);if(s.isValid)this.dateFrom.value=s.dateFrom,this.dateTo.value=s.dateTo,this.updateSelectedDateRange();else{const e=i().format(t);this.dateFrom.value=e,this.dateTo.value=e,this.updateSelectedDateRange()}this.setupEventHandlers()}setupEventHandlers(){j.fromEvent(document,"keydown").pipe(j.takeUntil(this.disconnecting)).subscribe(t=>{this.handleKeyboardNavigation(t)}),j.fromEvent(window,"resize").pipe(j.debounceTime(150),j.takeUntil(this.disconnecting)).subscribe(()=>{this.checkMobileView()})}disconnectedCallback(){super.disconnectedCallback()}updated(t){super.updated(t),!t.has("dateFrom")&&!t.has("dateTo")||this.dateFrom?.value===void 0&&this.dateTo?.value===void 0||this.updateSelectedDateRange()}initPresetRanges(){const t=this.getDateFormat(),s=`${this.type}-${t}-${JSON.stringify(this.customPresets)}`;if(this.memoizedPresets.has(s)){const e=this.memoizedPresets.get(s);return this.presetCategories=e,this.presetRanges=[],void e.forEach(o=>{this.presetRanges.push(...o.presets)})}if(this.presetCategories=[{name:"Days",presets:[{label:"Today",range:{dateFrom:i().startOf("day").format(t),dateTo:i().endOf("day").format(t)},step:"day"},{label:"Yesterday",range:{dateFrom:i().subtract(1,"days").startOf("day").format(t),dateTo:i().subtract(1,"days").endOf("day").format(t)},step:"day"},{label:"Last 7 Days",range:{dateFrom:i().subtract(6,"days").startOf("day").format(t),dateTo:i().endOf("day").format(t)},step:"day"},{label:"Last 14 Days",range:{dateFrom:i().subtract(13,"days").startOf("day").format(t),dateTo:i().endOf("day").format(t)},step:"day"},{label:"Last 30 Days",range:{dateFrom:i().subtract(29,"days").startOf("day").format(t),dateTo:i().endOf("day").format(t)},step:"day"},{label:"Last 60 Days",range:{dateFrom:i().subtract(59,"days").startOf("day").format(t),dateTo:i().endOf("day").format(t)},step:"day"},{label:"Last 90 Days",range:{dateFrom:i().subtract(89,"days").startOf("day").format(t),dateTo:i().endOf("day").format(t)},step:"day"}]},{name:"Weeks",presets:[{label:"This Week",range:{dateFrom:i().startOf("week").format(t),dateTo:i().endOf("week").format(t)},step:"week"},{label:"Last Week",range:{dateFrom:i().subtract(1,"weeks").startOf("week").format(t),dateTo:i().subtract(1,"weeks").endOf("week").format(t)},step:"week"},{label:"Last 2 Weeks",range:{dateFrom:i().subtract(2,"weeks").startOf("week").format(t),dateTo:i().endOf("day").format(t)},step:"week"},{label:"Last 4 Weeks",range:{dateFrom:i().subtract(4,"weeks").startOf("week").format(t),dateTo:i().endOf("day").format(t)},step:"week"}]},{name:"Months",presets:[{label:"This Month",range:{dateFrom:i().startOf("month").format(t),dateTo:i().endOf("month").format(t)},step:"month"},{label:"Last Month",range:{dateFrom:i().subtract(1,"month").startOf("month").format(t),dateTo:i().subtract(1,"month").endOf("month").format(t)},step:"month"},{label:"Last 3 Months",range:{dateFrom:i().subtract(3,"months").startOf("month").format(t),dateTo:i().endOf("day").format(t)},step:"month"},{label:"Last 6 Months",range:{dateFrom:i().subtract(6,"months").startOf("month").format(t),dateTo:i().endOf("day").format(t)},step:"month"}]},{name:"Quarters",presets:[{label:"This Quarter",range:{dateFrom:i().startOf("quarter").format(t),dateTo:i().endOf("quarter").format(t)},step:"quarter"},{label:"Last Quarter",range:{dateFrom:i().subtract(1,"quarter").startOf("quarter").format(t),dateTo:i().subtract(1,"quarter").endOf("quarter").format(t)},step:"quarter"},{label:"Last 2 Quarters",range:{dateFrom:i().subtract(2,"quarters").startOf("quarter").format(t),dateTo:i().endOf("day").format(t)},step:"quarter"},{label:"Last 4 Quarters",range:{dateFrom:i().subtract(4,"quarters").startOf("quarter").format(t),dateTo:i().endOf("day").format(t)},step:"quarter"}]},{name:"Years",presets:[{label:"This Year",range:{dateFrom:i().startOf("year").format(t),dateTo:i().endOf("year").format(t)},step:"year"},{label:"Last Year",range:{dateFrom:i().subtract(1,"year").startOf("year").format(t),dateTo:i().subtract(1,"year").endOf("year").format(t)},step:"year"},{label:"Year to Date",range:{dateFrom:i().startOf("year").format(t),dateTo:i().endOf("day").format(t)},step:"day"}]}],this.type==="datetime-local"&&this.presetCategories.unshift({name:"Hours",presets:[{label:"Last 24 Hours",range:{dateFrom:i().subtract(24,"hours").format(t),dateTo:i().format(t)},step:"hour"},{label:"Last 12 Hours",range:{dateFrom:i().subtract(12,"hours").format(t),dateTo:i().format(t)},step:"hour"}]}),this.presetRanges=[],this.presetCategories.forEach(e=>{this.presetRanges.push(...e.presets)}),this.customPresets&&this.customPresets.length>0){const e={name:"Custom",presets:this.customPresets.map(o=>({label:o.label,range:{dateFrom:o.dateFrom,dateTo:o.dateTo},step:"day"}))};this.presetCategories.push(e),this.presetRanges.push(...e.presets)}this.memoizedPresets.set(s,[...this.presetCategories])}getDateFormat(){return this.format||(this.type==="date"?"YYYY-MM-DD":"YYYY-MM-DDTHH:mm")}updateSelectedDateRange(){const t=this.presetRanges.find(u=>u.range.dateFrom===this.dateFrom.value&&u.range.dateTo===this.dateTo.value);if(t)return this.selectedDateRange=t.label,void(this.activePreset=t.label);if(this.checkAndUpdateActivePreset(this.dateFrom.value,this.dateTo.value),this.activePreset=null,!this.dateFrom.value||!this.dateTo.value)return void(this.selectedDateRange=this.placeholder);const s=i(this.dateFrom.value),e=i(this.dateTo.value);if(!s.isValid()||!e.isValid())return void(this.selectedDateRange=this.placeholder);const o=this.type==="datetime-local"?s.format(" h:mm A"):"",y=this.type==="datetime-local"?e.format(" h:mm A"):"";s.isSame(e,"day")?this.selectedDateRange=`${s.format("MMM D, YYYY")}${o}`:s.isSame(e,"month")&&s.isSame(e,"year")?this.selectedDateRange=`${s.format("MMM D")}-${e.format("D, YYYY")}${y}`:s.isSame(e,"year")?this.selectedDateRange=`${s.format("MMM D")} - ${e.format("MMM D, YYYY")}${y}`:this.selectedDateRange=`${s.format("MMM D, YYYY")}${o} - ${e.format("MMM D, YYYY")}${y}`}setDateRange(t,s){this.dateFrom.value=t,this.dateTo.value=s,this.updateSelectedDateRange(),this.announceToScreenReader(`Date range updated: ${this.selectedDateRange}`),this.dispatchEvent(new CustomEvent("change",{detail:{dateFrom:t,dateTo:s},bubbles:!0,composed:!0}))}handlePresetSelection(t,s){s.stopPropagation(),this.activePreset=t.label,this.setDateRange(t.range.dateFrom,t.range.dateTo),K.$dialog.dismiss()}toggleDropdown(t){t.stopPropagation(),this.disabled||(this.isOpen?this.closeDropdown():this.openDropdown())}openDropdown(){if(this.disabled)return;this.isOpen=!0;const t=this.createDialogContent();K.$dialog.component(t,{title:"Select Date Range",width:this.isMobile?"100vw":"800px",hideActions:!0}).then(()=>{this.isOpen=!1})}closeDropdown(){K.$dialog.dismiss(),this.isOpen=!1}adjustQuarter(t,s,e){let o=t.quarter()+e*s,y=0;for(;o>4;)o-=4,y+=1;for(;o<1;)o+=4,y-=1;const u=t.add(y,"year").month(3*(o-1)),c=u.daysInMonth(),p=Math.min(t.date(),c);return u.date(p)}shiftDateRange(t,s){if(s.stopPropagation(),!this.dateFrom.value||!this.dateTo.value)return;const e=i(this.dateFrom.value),o=i(this.dateTo.value);if(!e.isValid()||!o.isValid())return;const y=this.getDateFormat(),u=t>0?1:-1;let c,p;const Y=this.presetRanges.find(D=>D.label===this.activePreset),T=e.date()===1&&o.isSame(e.endOf("month"),"day"),E=e.isSame(e.startOf("quarter"),"day")&&o.isSame(o.endOf("quarter"),"day"),x=e.isSame(e.startOf("year"),"day")&&o.isSame(o.endOf("year"),"day"),P=e.day()===0&&o.day()===6&&o.diff(e,"days")===6;let M="day",f=1;if(Y)M=Y.step,f=1;else{const D=o.diff(e,"day");D>=360?(M="year",f=Math.round(D/365)):D>=90?(M="quarter",f=Math.round(D/90)):D>=30?(M="month",f=Math.round(D/30)):D>=7?(M="week",f=Math.round(D/7)):(M="day",f=D+1)}if(M==="quarter")E?u>0?(c=this.adjustQuarter(e,f,1).startOf("quarter"),p=c.endOf("quarter")):(c=this.adjustQuarter(e,f,-1).startOf("quarter"),p=c.endOf("quarter")):u>0?(c=this.adjustQuarter(e,f,1),p=this.adjustQuarter(o,f,1)):(c=this.adjustQuarter(e,f,-1),p=this.adjustQuarter(o,f,-1));else if(M==="hour"){const D=o.diff(e,"hour");u>0?(c=e.add(D,"hour"),p=o.add(D,"hour")):(c=e.subtract(D,"hour"),p=o.subtract(D,"hour"))}else M==="year"&&x?u>0?(c=e.add(f,"year").startOf("year"),p=c.endOf("year")):(c=e.subtract(f,"year").startOf("year"),p=c.endOf("year")):M==="year"?u>0?(c=e.add(f,"year"),p=o.add(f,"year")):(c=e.subtract(f,"year"),p=o.subtract(f,"year")):M==="month"&&T?u>0?(c=e.add(f,"month").startOf("month"),p=c.endOf("month")):(c=e.subtract(f,"month").startOf("month"),p=c.endOf("month")):M==="month"?u>0?(c=e.add(f,"month"),p=o.add(f,"month")):(c=e.subtract(f,"month"),p=o.subtract(f,"month")):M==="week"&&P?u>0?(c=e.add(f,"week").startOf("week"),p=c.endOf("week")):(c=e.subtract(f,"week").startOf("week"),p=c.endOf("week")):M==="week"?u>0?(c=e.add(f,"week"),p=o.add(f,"week")):(c=e.subtract(f,"week"),p=o.subtract(f,"week")):u>0?(c=e.add(f,"day"),p=o.add(f,"day")):(c=e.subtract(f,"day"),p=o.subtract(f,"day"));const Q=c.format(y),N=p.format(y);this.setDateRange(Q,N),this.checkAndUpdateActivePreset(Q,N)}handleKeyboardNavigation(t){const s=t.key;if(this.dateFrom.value&&this.dateTo.value&&!this.disabled)switch(s){case"PageUp":(t.target===this||this.contains(t.target))&&(this.shiftDateRange(-1,t),t.preventDefault());break;case"PageDown":(t.target===this||this.contains(t.target))&&(this.shiftDateRange(1,t),t.preventDefault());break;case"Home":if(t.ctrlKey&&(t.target===this||this.contains(t.target))){const e=i(this.dateFrom.value),o=i(this.dateTo.value),y=e.startOf("month"),u=o.diff(e,"day");this.setDateRange(y.format(this.getDateFormat()),y.add(u,"day").format(this.getDateFormat())),t.preventDefault()}break;case"End":if(t.ctrlKey&&(t.target===this||this.contains(t.target))){const e=i(this.dateFrom.value),o=i(this.dateTo.value),y=o.diff(e,"day"),u=o.endOf("month");this.setDateRange(u.subtract(y,"day").format(this.getDateFormat()),u.format(this.getDateFormat())),t.preventDefault()}}}checkAndUpdateActivePreset(t,s){const e=this.presetRanges.find(o=>o.range.dateFrom===t&&o.range.dateTo===s);this.activePreset=e?e.label:null}applyManualDateSelection(t){t.stopPropagation();const s=i(this.dateFrom.value),e=i(this.dateTo.value);s.isValid()&&e.isValid()?(s.isAfter(e)?this.setDateRange(e.format(this.getDateFormat()),s.format(this.getDateFormat())):this.setDateRange(this.dateFrom.value,this.dateTo.value),K.$dialog.dismiss()):this.announceToScreenReader("Invalid date format. Please check your input.")}checkMobileView(){this.isMobile=window.innerWidth<768}createDialogContent(){return B.html`
2
- <div class="w-full min-h-[400px] max-h-[80vh] flex flex-col p-4">
3
- <!-- Custom Range Section with Inline Calendars -->
4
- <schmancy-surface type="container" class="rounded-xl p-4 mb-6">
5
- <div class="flex flex-col gap-4">
6
- <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
7
- <!-- From Date Calendar -->
8
- <div class="flex flex-col gap-2">
9
- <schmancy-typography type="label" token="md" class="text-surface-onVariant">
10
- ${this.dateFrom.label||"From"}
11
- </schmancy-typography>
12
- <schmancy-input
13
- type="${this.type}"
14
- .value="${this.dateFrom.value}"
15
- min="${J.ifDefined(this.minDate)}"
16
- max="${J.ifDefined(this.maxDate)}"
17
- readonly
18
- @change="${t=>{const s=t.target;this.dateFrom.value=s.value,this.updateSelectedDateRange()}}"
19
- ></schmancy-input>
20
- </div>
21
-
22
- <!-- To Date Calendar -->
23
- <div class="flex flex-col gap-2">
24
- <schmancy-typography type="label" token="md" class="text-surface-onVariant">
25
- ${this.dateTo.label||"To"}
26
- </schmancy-typography>
27
- <schmancy-input
28
- type="${this.type}"
29
- .value="${this.dateTo.value}"
30
- min="${J.ifDefined(this.dateFrom.value)}"
31
- max="${J.ifDefined(this.maxDate)}"
32
- readonly
33
- @change="${t=>{const s=t.target;this.dateTo.value=s.value,this.updateSelectedDateRange()}}"
34
- ></schmancy-input>
35
- </div>
36
- </div>
37
-
38
- <!-- Apply Button - Now at the bottom for logical flow -->
39
- <div class="flex justify-end mt-2">
40
- <schmancy-button
41
- variant="filled"
42
- @click="${t=>this.applyManualDateSelection(t)}"
43
- ?disabled="${!this.dateFrom.value||!this.dateTo.value}"
44
- >
45
- Apply
46
- </schmancy-button>
47
- </div>
48
- </div>
49
- </schmancy-surface>
50
-
51
- <!-- Presets Section -->
52
- <div class="flex-1 overflow-y-auto overflow-x-hidden min-h-0">
53
- <div class="grid grid-cols-2 md:grid-cols-5 gap-6">
54
- ${this.presetCategories.map(t=>B.html`
55
- <div class="space-y-3">
56
- <schmancy-typography type="title" token="md" class="text-surface-onVariant font-medium">
57
- ${t.name}
58
- </schmancy-typography>
59
- <div class="space-y-1">
60
- ${t.presets.map(s=>B.html`
61
- <schmancy-button
62
- variant="${this.activePreset===s.label?"filled":"text"}"
63
- class="w-full justify-start text-left"
64
- @click="${e=>this.handlePresetSelection(s,e)}"
65
- aria-pressed="${this.activePreset===s.label}"
66
- aria-label="${s.label}: ${s.range.dateFrom} to ${s.range.dateTo}"
67
- title="${s.range.dateFrom} to ${s.range.dateTo}"
68
- >
69
- <span class="truncate">${s.label}</span>
70
- </schmancy-button>
71
- `)}
72
- </div>
73
- </div>
74
- `)}
75
- </div>
76
- </div>
77
- </div>
78
- `}announceToScreenReader(t){this.announceMessage=t,j.timer(100).pipe(j.takeUntil(this.disconnecting)).subscribe(()=>{this.announceMessage=""})}render(){return B.html`
79
- <div class="relative ${this.disabled?"opacity-60 pointer-events-none":""}">
80
- <!-- Screen reader announcements -->
81
- <div class="sr-only" role="status" aria-live="polite" aria-atomic="true">
82
- ${this.announceMessage}
83
- </div>
84
-
85
- <!-- Trigger using the preferred schmancy-grid pattern -->
86
- <div class="trigger-container">
87
- <section @click=${t=>t.stopPropagation()} class="flex" >
88
- <schmancy-icon-button
89
- type="button"
90
- aria-label="Previous ${this.activePreset?this.activePreset.toLowerCase():"date range"}"
91
- @click=${t=>this.shiftDateRange(-1,t)}
92
- ?disabled=${this.disabled||!this.dateFrom.value||!this.dateTo.value}
93
- >
94
- arrow_left
95
- </schmancy-icon-button>
96
-
97
- <schmancy-button
98
- class="w-max"
99
- variant="outlined"
100
- type="button"
101
- aria-haspopup="menu"
102
- aria-expanded=${this.isOpen}
103
- aria-label="Select date range. Current: ${this.selectedDateRange||"No date selected"}"
104
- @click=${t=>this.toggleDropdown(t)}
105
- >
106
- ${this.selectedDateRange||this.placeholder}
107
- </schmancy-button>
108
-
109
- <schmancy-icon-button
110
- type="button"
111
- aria-label="Next ${this.activePreset?this.activePreset.toLowerCase():"date range"}"
112
- @click=${t=>this.shiftDateRange(1,t)}
113
- ?disabled=${this.disabled||!this.dateFrom.value||!this.dateTo.value}
114
- >
115
- arrow_right
116
- </schmancy-icon-button>
117
- </section>
118
- </div>
119
- </div>
120
- `}},S([w.property({type:String})],exports.SchmancyDateRange.prototype,"type",2),S([w.property({type:Object})],exports.SchmancyDateRange.prototype,"dateFrom",2),S([w.property({type:Object})],exports.SchmancyDateRange.prototype,"dateTo",2),S([w.property({type:String})],exports.SchmancyDateRange.prototype,"minDate",2),S([w.property({type:String})],exports.SchmancyDateRange.prototype,"maxDate",2),S([w.property({type:Array})],exports.SchmancyDateRange.prototype,"customPresets",2),S([w.property({type:String})],exports.SchmancyDateRange.prototype,"format",2),S([w.property({type:Boolean})],exports.SchmancyDateRange.prototype,"disabled",2),S([w.property({type:Boolean})],exports.SchmancyDateRange.prototype,"required",2),S([w.property({type:String})],exports.SchmancyDateRange.prototype,"placeholder",2),S([w.property({type:Boolean})],exports.SchmancyDateRange.prototype,"clearable",2),S([w.state()],exports.SchmancyDateRange.prototype,"isOpen",2),S([w.state()],exports.SchmancyDateRange.prototype,"selectedDateRange",2),S([w.state()],exports.SchmancyDateRange.prototype,"activePreset",2),S([w.state()],exports.SchmancyDateRange.prototype,"announceMessage",2),S([w.state()],exports.SchmancyDateRange.prototype,"isMobile",2),exports.SchmancyDateRange=S([w.customElement("schmancy-date-range")],exports.SchmancyDateRange),exports.validateInitialDateRange=ot;
121
- //# sourceMappingURL=date-range-BTa3EHE4.cjs.map