@mhmo91/schmancy 0.2.175 → 0.2.177

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.
Files changed (34) hide show
  1. package/dist/{avatar-CTucKkA4.js → avatar-CbR-jibC.js} +3 -3
  2. package/dist/{avatar-CTucKkA4.js.map → avatar-CbR-jibC.js.map} +1 -1
  3. package/dist/{avatar-hg0j8zki.cjs → avatar-DnFccDmD.cjs} +2 -2
  4. package/dist/{avatar-hg0j8zki.cjs.map → avatar-DnFccDmD.cjs.map} +1 -1
  5. package/dist/badge.cjs +1 -1
  6. package/dist/badge.js +1 -1
  7. package/dist/card.cjs +1 -1
  8. package/dist/card.js +1 -1
  9. package/dist/content-drawer.cjs +1 -1
  10. package/dist/content-drawer.js +1 -1
  11. package/dist/{dialog-service-B7mtryVn.js → dialog-service-B9Pp1DY4.js} +18 -13
  12. package/dist/dialog-service-B9Pp1DY4.js.map +1 -0
  13. package/dist/dialog-service-BiNwFtwm.cjs +65 -0
  14. package/dist/dialog-service-BiNwFtwm.cjs.map +1 -0
  15. package/dist/dialog.cjs +1 -1
  16. package/dist/dialog.js +1 -1
  17. package/dist/index.cjs +1 -1
  18. package/dist/index.js +3 -3
  19. package/dist/nav-drawer.cjs +1 -1
  20. package/dist/nav-drawer.js +1 -1
  21. package/dist/{table-Cfe1Zloe.cjs → table-BA5yn5_q.cjs} +12 -12
  22. package/dist/{table-Cfe1Zloe.cjs.map → table-BA5yn5_q.cjs.map} +1 -1
  23. package/dist/{table-DPXzmJkJ.js → table-CRLXjzqK.js} +73 -66
  24. package/dist/{table-DPXzmJkJ.js.map → table-CRLXjzqK.js.map} +1 -1
  25. package/dist/table.cjs +1 -1
  26. package/dist/table.js +1 -1
  27. package/dist/teleport.cjs +1 -1
  28. package/dist/teleport.js +1 -1
  29. package/package.json +1 -1
  30. package/types/src/dialog/dialog-service.d.ts +11 -0
  31. package/types/src/table/table.d.ts +4 -0
  32. package/dist/dialog-service-B7mtryVn.js.map +0 -1
  33. package/dist/dialog-service-Bju5U74b.cjs +0 -65
  34. package/dist/dialog-service-Bju5U74b.cjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog-service-B9Pp1DY4.js","sources":["../src/dialog/dailog.ts","../src/dialog/dialog-service.ts"],"sourcesContent":["import { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { styleMap } from 'lit/directives/style-map.js'\nimport { when } from 'lit/directives/when.js'\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\tanimation: fade-in 150ms ease;\n\t}\n\n\t.dialog {\n\t\tposition: absolute;\n\t\tmax-width: var(--dialog-width);\n\t\twidth: max-content;\n\t\tanimation: pop-in 150ms ease;\n\t}\n\n\t@keyframes pop-in {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t\ttransform: scale(0.9);\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t\ttransform: scale(1);\n\t\t}\n\t}\n\n\t@keyframes fade-in {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t}\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 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 * 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 * 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 ('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// Set position and make dialog visible\n\t\tthis.position = this.calculatePosition(x, y)\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// 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 * Calculate optimal position based on click coordinates\n\t */\n\tprivate calculatePosition(x: number, y: number) {\n\t\t// Default to click position\n\t\treturn { x, y }\n\t}\n\n\t/**\n\t * Handle lifecycle callback when dialog is first rendered\n\t */\n\tfirstUpdated() {\n\t\t// Optimize position after first render when we know the size\n\t\tsetTimeout(() => {\n\t\t\tconst dialog = this.shadowRoot?.querySelector('.dialog') as HTMLElement\n\t\t\tif (!dialog) return\n\n\t\t\t// Get dialog dimensions\n\t\t\tconst width = dialog.offsetWidth\n\t\t\tconst height = dialog.offsetHeight\n\n\t\t\t// Get viewport dimensions\n\t\t\tconst viewportWidth = window.innerWidth\n\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t// Reposition if needed to keep dialog in viewport\n\t\t\tlet { x, y } = this.position\n\n\t\t\t// Make sure dialog stays within viewport horizontally\n\t\t\tif (x + width > viewportWidth - 16) {\n\t\t\t\tx = Math.max(16, viewportWidth - width - 16)\n\t\t\t}\n\n\t\t\t// Make sure dialog stays within viewport vertically\n\t\t\tif (y + height > viewportHeight - 16) {\n\t\t\t\t// Position above if space available, otherwise at top\n\t\t\t\tif (y > height + 32) {\n\t\t\t\t\ty = y - height - 16\n\t\t\t\t} else {\n\t\t\t\t\ty = 16\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Update dialog position\n\t\t\tdialog.style.left = `${x}px`\n\t\t\tdialog.style.top = `${y}px`\n\t\t}, 0)\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\trender() {\n\t\tconst dialogStyles = {\n\t\t\tleft: `${this.position.x}px`,\n\t\t\ttop: `${this.position.y}px`,\n\t\t}\n\n\t\tconst hasCustomContent = this.querySelectorAll('[slot=\"content\"]').length > 0\n\n\t\treturn html`\n\t\t\t<div class=\"overlay\" @click=${this.handleCancel}></div>\n\n\t\t\t<div class=\"dialog\" style=${styleMap(dialogStyles)} 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,\n\t\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\t\thtml` <schmancy-typography type=\"title\" token=\"md\" class=\"mb-2\"> ${this.title} </schmancy-typography>`,\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=\"mb-4\"><slot name=\"content\"></slot></div>`\n\t\t\t\t\t\t\t: html`<schmancy-typography type=\"body\" class=\"mb-4\"> ${this.message} </schmancy-typography>`}\n\n\t\t\t\t\t\t<div class=\"flex justify-end gap-3\">\n\t\t\t\t\t\t\t<schmancy-button variant=\"outlined\" @click=${this.handleCancel}> ${this.cancelText} </schmancy-button>\n\n\t\t\t\t\t\t\t<schmancy-button type=\"submit\" variant=\"filled\"> ${this.confirmText} </schmancy-button>\n\t\t\t\t\t\t</div>\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\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.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 the event and message\n\t */\n\tstatic async ask(event: MouseEvent | TouchEvent, message: string): 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 { render, TemplateResult } from 'lit'\nimport { ConfirmDialog } from './dailog'\n\n/**\n * Dialog service options interface with component support\n */\nexport interface DialogOptions {\n\ttitle?: string\n\tmessage?: string\n\tconfirmText?: string\n\tcancelText?: string\n\tvariant?: 'default' | 'danger'\n\tposition: { x: number; y: number } | MouseEvent | TouchEvent\n\n\t// New options for component rendering\n\tcontent?: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult)\n\twidth?: string\n\tonConfirm?: () => void\n\tonCancel?: () => void\n}\n\n/**\n * Dialog service for centralized dialog management.\n * Provides a simple API for showing dialogs with optional custom components.\n */\nexport class DialogService {\n\tprivate static instance: DialogService\n\n\t// Default dialog options\n\tprivate static DEFAULT_OPTIONS: Partial<DialogOptions> = {\n\t\ttitle: undefined,\n\t\tconfirmText: undefined,\n\t\tcancelText: 'Cancel',\n\t\tvariant: 'default',\n\t\twidth: '360px',\n\t}\n\n\t// Track active dialogs to handle dismissing the most recent one\n\tprivate activeDialogs: ConfirmDialog[] = []\n\n\t// Private constructor for singleton pattern\n\tprivate constructor() {}\n\n\t/**\n\t * Get the singleton instance\n\t */\n\tpublic static getInstance(): DialogService {\n\t\tif (!DialogService.instance) {\n\t\t\tDialogService.instance = new DialogService()\n\t\t}\n\t\treturn DialogService.instance\n\t}\n\n\t/**\n\t * Show a confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic confirm(options: DialogOptions): Promise<boolean> {\n\t\t// Apply default options\n\t\tconst completeOptions = {\n\t\t\t...DialogService.DEFAULT_OPTIONS,\n\t\t\t...options,\n\t\t}\n\n\t\t// If no position is provided, center the dialog\n\t\tif (!completeOptions.position) {\n\t\t\tcompleteOptions.position = this.getCenteredPosition()\n\t\t}\n\n\t\t// Create or find the dialog\n\t\tlet dialog = document.querySelector('confirm-dialog') as ConfirmDialog\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 basic options\n\t\tif (completeOptions.title) dialog.title = completeOptions.title\n\t\tif (completeOptions.message) dialog.message = completeOptions.message\n\t\tif (completeOptions.confirmText) dialog.confirmText = completeOptions.confirmText\n\t\tif (completeOptions.cancelText) dialog.cancelText = completeOptions.cancelText\n\t\tif (completeOptions.variant) dialog.variant = completeOptions.variant\n\t\tif (completeOptions.width) dialog.style.setProperty('--dialog-width', completeOptions.width)\n\n\t\t// Handle custom content if provided\n\t\tif (completeOptions.content) {\n\t\t\tconst contentContainer = document.createElement('div')\n\t\t\tcontentContainer.slot = 'content'\n\n\t\t\tif (typeof completeOptions.content === 'function') {\n\t\t\t\tconst result = completeOptions.content()\n\t\t\t\tif (result instanceof HTMLElement) {\n\t\t\t\t\tcontentContainer.appendChild(result)\n\t\t\t\t} else {\n\t\t\t\t\trender(result, contentContainer)\n\t\t\t\t}\n\t\t\t} else if (completeOptions.content instanceof HTMLElement) {\n\t\t\t\tcontentContainer.appendChild(completeOptions.content)\n\t\t\t} else {\n\t\t\t\trender(completeOptions.content, contentContainer)\n\t\t\t}\n\n\t\t\tdialog.appendChild(contentContainer)\n\t\t}\n\n\t\t// Set up event listeners for optional callbacks\n\t\tif (completeOptions.onConfirm) {\n\t\t\tconst onConfirm = (_e: Event) => {\n\t\t\t\tcompleteOptions.onConfirm!()\n\t\t\t\tdialog.removeEventListener('confirm', onConfirm)\n\t\t\t}\n\t\t\tdialog.addEventListener('confirm', onConfirm)\n\t\t}\n\n\t\tif (completeOptions.onCancel) {\n\t\t\tconst onCancel = (_e: Event) => {\n\t\t\t\tcompleteOptions.onCancel!()\n\t\t\t\tdialog.removeEventListener('cancel', onCancel)\n\t\t\t}\n\t\t\tdialog.addEventListener('cancel', onCancel)\n\t\t}\n\n\t\t// Add this dialog to active dialogs\n\t\tthis.activeDialogs.push(dialog)\n\n\t\t// Show dialog and return promise\n\t\treturn dialog.show(completeOptions.position).finally(() => {\n\t\t\t// Remove from active dialogs when closed\n\t\t\tconst index = this.activeDialogs.indexOf(dialog)\n\t\t\tif (index !== -1) {\n\t\t\t\tthis.activeDialogs.splice(index, 1)\n\t\t\t}\n\n\t\t\t// Clean up the content when dialog closes\n\t\t\tif (completeOptions.content) {\n\t\t\t\tconst contentEl = dialog.querySelector('[slot=\"content\"]')\n\t\t\t\tif (contentEl) {\n\t\t\t\t\tdialog.removeChild(contentEl)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\t/**\n\t * Dismiss the most recently opened dialog\n\t * @returns true if a dialog was dismissed, false if no dialogs were open\n\t */\n\tpublic dismiss(): boolean {\n\t\tif (this.activeDialogs.length === 0) {\n\t\t\treturn false\n\t\t}\n\n\t\t// Get the most recently opened dialog (last in the array)\n\t\tconst dialog = this.activeDialogs[this.activeDialogs.length - 1]\n\n\t\t// Hide the dialog (with cancel result)\n\t\tdialog.hide(false)\n\n\t\treturn true\n\t}\n\n\t/**\n\t * Show a simple confirmation dialog with just a message\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic ask(message: string, event?: MouseEvent | TouchEvent): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\tmessage,\n\t\t\tposition: event || this.getCenteredPosition(),\n\t\t})\n\t}\n\n\t/**\n\t * Show a danger confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic danger(options: Omit<DialogOptions, 'variant'>): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\t...options,\n\t\t\tvariant: 'danger',\n\t\t})\n\t}\n\n\t/**\n\t * Show a dialog with custom component content\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic component(\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions: Omit<DialogOptions, 'content' | 'message'> = { position: this.getCenteredPosition() },\n\t): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\t...options,\n\t\t\tcontent,\n\t\t\t// Clear message if content is provided\n\t\t\ttitle: undefined,\n\t\t\tmessage: undefined,\n\t\t})\n\t}\n\n\t/**\n\t * Get a centered position for the dialog\n\t */\n\tprivate getCenteredPosition(): { x: number; y: number } {\n\t\treturn {\n\t\t\tx: window.innerWidth / 2,\n\t\t\ty: window.innerHeight / 2,\n\t\t}\n\t}\n}\n\n/**\n * Global dialog utility - provides a quick way to show dialogs\n */\nexport const $dialog = {\n\t/**\n\t * Show a confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tconfirm: (options: DialogOptions): Promise<boolean> => {\n\t\treturn DialogService.getInstance().confirm(options)\n\t},\n\n\t/**\n\t * Show a simple confirmation dialog with just a message\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\task: (message: string, event?: MouseEvent | TouchEvent): Promise<boolean> => {\n\t\treturn DialogService.getInstance().ask(message, event)\n\t},\n\n\t/**\n\t * Show a danger confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tdanger: (options: Omit<DialogOptions, 'variant'>): Promise<boolean> => {\n\t\treturn DialogService.getInstance().danger(options)\n\t},\n\n\t/**\n\t * Show a dialog with custom component content\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tcomponent: (\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions?: Omit<DialogOptions, 'content' | 'message'>,\n\t): Promise<boolean> => {\n\t\treturn DialogService.getInstance().component(content, options)\n\t},\n\n\t/**\n\t * Dismiss the most recently opened dialog\n\t * @returns true if a dialog was dismissed, false if no dialogs were open\n\t */\n\tdismiss: (): boolean => {\n\t\treturn DialogService.getInstance().dismiss()\n\t},\n}\n\nexport default DialogService\n"],"names":["ConfirmDialog","$LitElement","css","constructor","super","arguments","this","title","message","confirmText","cancelText","variant","position","x","y","positionOrEvent","clientX","clientY","touches","length","pos","calculatePosition","setAttribute","Promise","resolve","resolvePromise","confirmed","removeAttribute","setTimeout","dialog","shadowRoot","querySelector","width","offsetWidth","height","offsetHeight","viewportWidth","window","innerWidth","viewportHeight","innerHeight","Math","max","style","left","top","hide","dispatchEvent","CustomEvent","bubbles","composed","handleCancel","dialogStyles","hasCustomContent","querySelectorAll","html","styleMap","handleConfirm","when","options","document","createElement","body","appendChild","setProperty","show","event","confirm","__decorateClass","property","type","String","prototype","attribute","customElement","DialogService","activeDialogs","getInstance","instance","completeOptions","DEFAULT_OPTIONS","getCenteredPosition","content","contentContainer","slot","result","HTMLElement","render","onConfirm","_e","removeEventListener","addEventListener","onCancel","push","finally","index","indexOf","splice","contentEl","removeChild","dismiss","_h","$dialog","ask","danger","component"],"mappings":";;;;;;;;;;;;AAaa,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;AAAAA;AAAAA;AAAAA;AAAAA;AAA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ACb,WAAOrD,KAAK6D,QAAQ,EAAA,GAChBR,GACHhD,SAAS;EACT;AAAA,EAOK,UACNuE,GACAvB,IAAsD,EAAE/C,UAAUN,KAAK2E,oBAEvE,EAAA,GAAA;AAAA,WAAO3E,KAAK6D,QAAQ,EAChBR,GAAAA,GACHuB,YAEA3E,OAAO,QACPC,SAAS,OAAA,CAAA;AAAA,EACT;AAAA,EAMM,sBACA;AAAA,WAAA,EACNK,GAAGwB,OAAOC,aAAa,GACvBxB,GAAGuB,OAAOG,cAAc,EAAA;AAAA,EACzB;AAOK;AAzLNlC,EAAe0E,kBAA0C,EACxDzE,OAAO,QACPE,qBACAC,YAAY,UACZC,SAAS,WACTqB,OAAO,QACR;AAVM,IAAM2C,IAAN0B;AA6LA,MAAMC,IAAU,EAKtBnC,SAAUR,OACFgB,EAAcE,YAAAA,EAAcV,QAAQR,CAAAA,GAO5C4C,KAAK,CAAC/F,GAAiB0D,MACfS,EAAcE,YAAc0B,EAAAA,IAAI/F,GAAS0D,CAAAA,GAOjDsC,QAAS7C,OACDgB,EAAcE,YAAAA,EAAc2B,OAAO7C,CAAAA,GAO3C8C,WAAW,CACVvB,GACAvB,MAEOgB,EAAcE,YAAc4B,EAAAA,UAAUvB,GAASvB,CAAAA,GAOvDyC,SAAS,MACDzB,EAAcE,YAAAA,EAAcuB;"}
@@ -0,0 +1,65 @@
1
+ "use strict";require("rxjs"),require("lit/directives/class-map.js");const p=require("lit/directives/style-map.js"),f=require("./litElement.mixin-DcVBwo9t.cjs");require("./tailwind.mixin-B9QsShMd.cjs");const l=require("lit"),m=require("lit/decorators.js"),g=require("lit/directives/when.js");var y=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=(t,i,e,n)=>{for(var o,s=n>1?void 0:n?u(i,e):i,a=t.length-1;a>=0;a--)(o=t[a])&&(s=(n?o(i,e,s):o(s))||s);return n&&s&&y(i,e,s),s};exports.ConfirmDialog=class extends f.$LitElement(l.css`
2
+ :host {
3
+ position: fixed;
4
+ z-index: 10000;
5
+ inset: 0;
6
+ display: none;
7
+ --dialog-width: 360px;
8
+ }
9
+
10
+ :host([active]) {
11
+ display: block;
12
+ }
13
+
14
+ .overlay {
15
+ position: fixed;
16
+ inset: 0;
17
+ background: rgba(0, 0, 0, 0.4);
18
+ animation: fade-in 150ms ease;
19
+ }
20
+
21
+ .dialog {
22
+ position: absolute;
23
+ max-width: var(--dialog-width);
24
+ width: max-content;
25
+ animation: pop-in 150ms ease;
26
+ }
27
+
28
+ @keyframes pop-in {
29
+ from {
30
+ opacity: 0;
31
+ transform: scale(0.9);
32
+ }
33
+ to {
34
+ opacity: 1;
35
+ transform: scale(1);
36
+ }
37
+ }
38
+
39
+ @keyframes fade-in {
40
+ from {
41
+ opacity: 0;
42
+ }
43
+ to {
44
+ opacity: 1;
45
+ }
46
+ }
47
+ `){constructor(){super(...arguments),this.title=void 0,this.message=void 0,this.confirmText="Confirm",this.cancelText="Cancel",this.variant="default",this.position={x:0,y:0}}async show(t){let i,e;if("clientX"in t)i=t.clientX,e=t.clientY;else if("touches"in t&&t.touches.length)i=t.touches[0].clientX,e=t.touches[0].clientY;else{const n=t;i=n.x,e=n.y}return this.position=this.calculatePosition(i,e),this.setAttribute("active",""),new Promise(n=>{this.resolvePromise=n})}hide(t=!1){this.removeAttribute("active"),this.resolvePromise&&(this.resolvePromise(t),this.resolvePromise=void 0)}calculatePosition(t,i){return{x:t,y:i}}firstUpdated(){setTimeout(()=>{var h;const t=(h=this.shadowRoot)==null?void 0:h.querySelector(".dialog");if(!t)return;const i=t.offsetWidth,e=t.offsetHeight,n=window.innerWidth,o=window.innerHeight;let{x:s,y:a}=this.position;s+i>n-16&&(s=Math.max(16,n-i-16)),a+e>o-16&&(a=a>e+32?a-e-16:16),t.style.left=`${s}px`,t.style.top=`${a}px`},0)}handleConfirm(){this.hide(!0),this.dispatchEvent(new CustomEvent("confirm",{bubbles:!0,composed:!0}))}handleCancel(){this.hide(!1),this.dispatchEvent(new CustomEvent("cancel",{bubbles:!0,composed:!0}))}render(){const t={left:`${this.position.x}px`,top:`${this.position.y}px`},i=this.querySelectorAll('[slot="content"]').length>0;return l.html`
48
+ <div class="overlay" @click=${this.handleCancel}></div>
49
+
50
+ <div class="dialog" style=${p.styleMap(t)} role="alertdialog" aria-modal="true">
51
+ <schmancy-surface rounded="all" elevation="3" type="containerHigh">
52
+ <schmancy-form @submit=${this.handleConfirm} class="p-4">
53
+ ${g.when(this.title,()=>l.html` <schmancy-typography type="title" token="md" class="mb-2"> ${this.title} </schmancy-typography>`)}
54
+ ${i?l.html`<div class="mb-4"><slot name="content"></slot></div>`:l.html`<schmancy-typography type="body" class="mb-4"> ${this.message} </schmancy-typography>`}
55
+
56
+ <div class="flex justify-end gap-3">
57
+ <schmancy-button variant="outlined" @click=${this.handleCancel}> ${this.cancelText} </schmancy-button>
58
+
59
+ <schmancy-button type="submit" variant="filled"> ${this.confirmText} </schmancy-button>
60
+ </div>
61
+ </schmancy-form>
62
+ </schmancy-surface>
63
+ </div>
64
+ `}static async confirm(t){let i=document.querySelector("confirm-dialog");return i||(i=document.createElement("confirm-dialog"),document.body.appendChild(i)),t.title&&(i.title=t.title),t.message&&(i.message=t.message),t.confirmText&&(i.confirmText=t.confirmText),t.cancelText&&(i.cancelText=t.cancelText),t.variant&&(i.variant=t.variant),t.width&&i.style.setProperty("--dialog-width",t.width),i.show(t.position)}static async ask(t,i){return this.confirm({message:i,position:t})}},d([m.property({type:String})],exports.ConfirmDialog.prototype,"title",2),d([m.property({type:String})],exports.ConfirmDialog.prototype,"message",2),d([m.property({type:String,attribute:"confirm-text"})],exports.ConfirmDialog.prototype,"confirmText",2),d([m.property({type:String,attribute:"cancel-text"})],exports.ConfirmDialog.prototype,"cancelText",2),d([m.property({type:String})],exports.ConfirmDialog.prototype,"variant",2),exports.ConfirmDialog=d([m.customElement("confirm-dialog")],exports.ConfirmDialog);const c=class c{constructor(){this.activeDialogs=[]}static getInstance(){return c.instance||(c.instance=new c),c.instance}confirm(i){const e={...c.DEFAULT_OPTIONS,...i};e.position||(e.position=this.getCenteredPosition());let n=document.querySelector("confirm-dialog");if(n||(n=document.createElement("confirm-dialog"),document.body.appendChild(n)),e.title&&(n.title=e.title),e.message&&(n.message=e.message),e.confirmText&&(n.confirmText=e.confirmText),e.cancelText&&(n.cancelText=e.cancelText),e.variant&&(n.variant=e.variant),e.width&&n.style.setProperty("--dialog-width",e.width),e.content){const o=document.createElement("div");if(o.slot="content",typeof e.content=="function"){const s=e.content();s instanceof HTMLElement?o.appendChild(s):l.render(s,o)}else e.content instanceof HTMLElement?o.appendChild(e.content):l.render(e.content,o);n.appendChild(o)}if(e.onConfirm){const o=s=>{e.onConfirm(),n.removeEventListener("confirm",o)};n.addEventListener("confirm",o)}if(e.onCancel){const o=s=>{e.onCancel(),n.removeEventListener("cancel",o)};n.addEventListener("cancel",o)}return this.activeDialogs.push(n),n.show(e.position).finally(()=>{const o=this.activeDialogs.indexOf(n);if(o!==-1&&this.activeDialogs.splice(o,1),e.content){const s=n.querySelector('[slot="content"]');s&&n.removeChild(s)}})}dismiss(){return this.activeDialogs.length===0?!1:(this.activeDialogs[this.activeDialogs.length-1].hide(!1),!0)}ask(i,e){return this.confirm({message:i,position:e||this.getCenteredPosition()})}danger(i){return this.confirm({...i,variant:"danger"})}component(i,e={position:this.getCenteredPosition()}){return this.confirm({...e,content:i,title:void 0,message:void 0})}getCenteredPosition(){return{x:window.innerWidth/2,y:window.innerHeight/2}}};c.DEFAULT_OPTIONS={title:void 0,confirmText:void 0,cancelText:"Cancel",variant:"default",width:"360px"};let r=c;const v={confirm:t=>r.getInstance().confirm(t),ask:(t,i)=>r.getInstance().ask(t,i),danger:t=>r.getInstance().danger(t),component:(t,i)=>r.getInstance().component(t,i),dismiss:()=>r.getInstance().dismiss()};exports.$dialog=v,exports.DialogService=r;
65
+ //# sourceMappingURL=dialog-service-BiNwFtwm.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog-service-BiNwFtwm.cjs","sources":["../src/dialog/dailog.ts","../src/dialog/dialog-service.ts"],"sourcesContent":["import { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { styleMap } from 'lit/directives/style-map.js'\nimport { when } from 'lit/directives/when.js'\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\tanimation: fade-in 150ms ease;\n\t}\n\n\t.dialog {\n\t\tposition: absolute;\n\t\tmax-width: var(--dialog-width);\n\t\twidth: max-content;\n\t\tanimation: pop-in 150ms ease;\n\t}\n\n\t@keyframes pop-in {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t\ttransform: scale(0.9);\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t\ttransform: scale(1);\n\t\t}\n\t}\n\n\t@keyframes fade-in {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t}\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 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 * 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 * 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 ('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// Set position and make dialog visible\n\t\tthis.position = this.calculatePosition(x, y)\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// 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 * Calculate optimal position based on click coordinates\n\t */\n\tprivate calculatePosition(x: number, y: number) {\n\t\t// Default to click position\n\t\treturn { x, y }\n\t}\n\n\t/**\n\t * Handle lifecycle callback when dialog is first rendered\n\t */\n\tfirstUpdated() {\n\t\t// Optimize position after first render when we know the size\n\t\tsetTimeout(() => {\n\t\t\tconst dialog = this.shadowRoot?.querySelector('.dialog') as HTMLElement\n\t\t\tif (!dialog) return\n\n\t\t\t// Get dialog dimensions\n\t\t\tconst width = dialog.offsetWidth\n\t\t\tconst height = dialog.offsetHeight\n\n\t\t\t// Get viewport dimensions\n\t\t\tconst viewportWidth = window.innerWidth\n\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t// Reposition if needed to keep dialog in viewport\n\t\t\tlet { x, y } = this.position\n\n\t\t\t// Make sure dialog stays within viewport horizontally\n\t\t\tif (x + width > viewportWidth - 16) {\n\t\t\t\tx = Math.max(16, viewportWidth - width - 16)\n\t\t\t}\n\n\t\t\t// Make sure dialog stays within viewport vertically\n\t\t\tif (y + height > viewportHeight - 16) {\n\t\t\t\t// Position above if space available, otherwise at top\n\t\t\t\tif (y > height + 32) {\n\t\t\t\t\ty = y - height - 16\n\t\t\t\t} else {\n\t\t\t\t\ty = 16\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Update dialog position\n\t\t\tdialog.style.left = `${x}px`\n\t\t\tdialog.style.top = `${y}px`\n\t\t}, 0)\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\trender() {\n\t\tconst dialogStyles = {\n\t\t\tleft: `${this.position.x}px`,\n\t\t\ttop: `${this.position.y}px`,\n\t\t}\n\n\t\tconst hasCustomContent = this.querySelectorAll('[slot=\"content\"]').length > 0\n\n\t\treturn html`\n\t\t\t<div class=\"overlay\" @click=${this.handleCancel}></div>\n\n\t\t\t<div class=\"dialog\" style=${styleMap(dialogStyles)} 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,\n\t\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\t\thtml` <schmancy-typography type=\"title\" token=\"md\" class=\"mb-2\"> ${this.title} </schmancy-typography>`,\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=\"mb-4\"><slot name=\"content\"></slot></div>`\n\t\t\t\t\t\t\t: html`<schmancy-typography type=\"body\" class=\"mb-4\"> ${this.message} </schmancy-typography>`}\n\n\t\t\t\t\t\t<div class=\"flex justify-end gap-3\">\n\t\t\t\t\t\t\t<schmancy-button variant=\"outlined\" @click=${this.handleCancel}> ${this.cancelText} </schmancy-button>\n\n\t\t\t\t\t\t\t<schmancy-button type=\"submit\" variant=\"filled\"> ${this.confirmText} </schmancy-button>\n\t\t\t\t\t\t</div>\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\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.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 the event and message\n\t */\n\tstatic async ask(event: MouseEvent | TouchEvent, message: string): 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 { render, TemplateResult } from 'lit'\nimport { ConfirmDialog } from './dailog'\n\n/**\n * Dialog service options interface with component support\n */\nexport interface DialogOptions {\n\ttitle?: string\n\tmessage?: string\n\tconfirmText?: string\n\tcancelText?: string\n\tvariant?: 'default' | 'danger'\n\tposition: { x: number; y: number } | MouseEvent | TouchEvent\n\n\t// New options for component rendering\n\tcontent?: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult)\n\twidth?: string\n\tonConfirm?: () => void\n\tonCancel?: () => void\n}\n\n/**\n * Dialog service for centralized dialog management.\n * Provides a simple API for showing dialogs with optional custom components.\n */\nexport class DialogService {\n\tprivate static instance: DialogService\n\n\t// Default dialog options\n\tprivate static DEFAULT_OPTIONS: Partial<DialogOptions> = {\n\t\ttitle: undefined,\n\t\tconfirmText: undefined,\n\t\tcancelText: 'Cancel',\n\t\tvariant: 'default',\n\t\twidth: '360px',\n\t}\n\n\t// Track active dialogs to handle dismissing the most recent one\n\tprivate activeDialogs: ConfirmDialog[] = []\n\n\t// Private constructor for singleton pattern\n\tprivate constructor() {}\n\n\t/**\n\t * Get the singleton instance\n\t */\n\tpublic static getInstance(): DialogService {\n\t\tif (!DialogService.instance) {\n\t\t\tDialogService.instance = new DialogService()\n\t\t}\n\t\treturn DialogService.instance\n\t}\n\n\t/**\n\t * Show a confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic confirm(options: DialogOptions): Promise<boolean> {\n\t\t// Apply default options\n\t\tconst completeOptions = {\n\t\t\t...DialogService.DEFAULT_OPTIONS,\n\t\t\t...options,\n\t\t}\n\n\t\t// If no position is provided, center the dialog\n\t\tif (!completeOptions.position) {\n\t\t\tcompleteOptions.position = this.getCenteredPosition()\n\t\t}\n\n\t\t// Create or find the dialog\n\t\tlet dialog = document.querySelector('confirm-dialog') as ConfirmDialog\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 basic options\n\t\tif (completeOptions.title) dialog.title = completeOptions.title\n\t\tif (completeOptions.message) dialog.message = completeOptions.message\n\t\tif (completeOptions.confirmText) dialog.confirmText = completeOptions.confirmText\n\t\tif (completeOptions.cancelText) dialog.cancelText = completeOptions.cancelText\n\t\tif (completeOptions.variant) dialog.variant = completeOptions.variant\n\t\tif (completeOptions.width) dialog.style.setProperty('--dialog-width', completeOptions.width)\n\n\t\t// Handle custom content if provided\n\t\tif (completeOptions.content) {\n\t\t\tconst contentContainer = document.createElement('div')\n\t\t\tcontentContainer.slot = 'content'\n\n\t\t\tif (typeof completeOptions.content === 'function') {\n\t\t\t\tconst result = completeOptions.content()\n\t\t\t\tif (result instanceof HTMLElement) {\n\t\t\t\t\tcontentContainer.appendChild(result)\n\t\t\t\t} else {\n\t\t\t\t\trender(result, contentContainer)\n\t\t\t\t}\n\t\t\t} else if (completeOptions.content instanceof HTMLElement) {\n\t\t\t\tcontentContainer.appendChild(completeOptions.content)\n\t\t\t} else {\n\t\t\t\trender(completeOptions.content, contentContainer)\n\t\t\t}\n\n\t\t\tdialog.appendChild(contentContainer)\n\t\t}\n\n\t\t// Set up event listeners for optional callbacks\n\t\tif (completeOptions.onConfirm) {\n\t\t\tconst onConfirm = (_e: Event) => {\n\t\t\t\tcompleteOptions.onConfirm!()\n\t\t\t\tdialog.removeEventListener('confirm', onConfirm)\n\t\t\t}\n\t\t\tdialog.addEventListener('confirm', onConfirm)\n\t\t}\n\n\t\tif (completeOptions.onCancel) {\n\t\t\tconst onCancel = (_e: Event) => {\n\t\t\t\tcompleteOptions.onCancel!()\n\t\t\t\tdialog.removeEventListener('cancel', onCancel)\n\t\t\t}\n\t\t\tdialog.addEventListener('cancel', onCancel)\n\t\t}\n\n\t\t// Add this dialog to active dialogs\n\t\tthis.activeDialogs.push(dialog)\n\n\t\t// Show dialog and return promise\n\t\treturn dialog.show(completeOptions.position).finally(() => {\n\t\t\t// Remove from active dialogs when closed\n\t\t\tconst index = this.activeDialogs.indexOf(dialog)\n\t\t\tif (index !== -1) {\n\t\t\t\tthis.activeDialogs.splice(index, 1)\n\t\t\t}\n\n\t\t\t// Clean up the content when dialog closes\n\t\t\tif (completeOptions.content) {\n\t\t\t\tconst contentEl = dialog.querySelector('[slot=\"content\"]')\n\t\t\t\tif (contentEl) {\n\t\t\t\t\tdialog.removeChild(contentEl)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\t/**\n\t * Dismiss the most recently opened dialog\n\t * @returns true if a dialog was dismissed, false if no dialogs were open\n\t */\n\tpublic dismiss(): boolean {\n\t\tif (this.activeDialogs.length === 0) {\n\t\t\treturn false\n\t\t}\n\n\t\t// Get the most recently opened dialog (last in the array)\n\t\tconst dialog = this.activeDialogs[this.activeDialogs.length - 1]\n\n\t\t// Hide the dialog (with cancel result)\n\t\tdialog.hide(false)\n\n\t\treturn true\n\t}\n\n\t/**\n\t * Show a simple confirmation dialog with just a message\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic ask(message: string, event?: MouseEvent | TouchEvent): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\tmessage,\n\t\t\tposition: event || this.getCenteredPosition(),\n\t\t})\n\t}\n\n\t/**\n\t * Show a danger confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic danger(options: Omit<DialogOptions, 'variant'>): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\t...options,\n\t\t\tvariant: 'danger',\n\t\t})\n\t}\n\n\t/**\n\t * Show a dialog with custom component content\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic component(\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions: Omit<DialogOptions, 'content' | 'message'> = { position: this.getCenteredPosition() },\n\t): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\t...options,\n\t\t\tcontent,\n\t\t\t// Clear message if content is provided\n\t\t\ttitle: undefined,\n\t\t\tmessage: undefined,\n\t\t})\n\t}\n\n\t/**\n\t * Get a centered position for the dialog\n\t */\n\tprivate getCenteredPosition(): { x: number; y: number } {\n\t\treturn {\n\t\t\tx: window.innerWidth / 2,\n\t\t\ty: window.innerHeight / 2,\n\t\t}\n\t}\n}\n\n/**\n * Global dialog utility - provides a quick way to show dialogs\n */\nexport const $dialog = {\n\t/**\n\t * Show a confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tconfirm: (options: DialogOptions): Promise<boolean> => {\n\t\treturn DialogService.getInstance().confirm(options)\n\t},\n\n\t/**\n\t * Show a simple confirmation dialog with just a message\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\task: (message: string, event?: MouseEvent | TouchEvent): Promise<boolean> => {\n\t\treturn DialogService.getInstance().ask(message, event)\n\t},\n\n\t/**\n\t * Show a danger confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tdanger: (options: Omit<DialogOptions, 'variant'>): Promise<boolean> => {\n\t\treturn DialogService.getInstance().danger(options)\n\t},\n\n\t/**\n\t * Show a dialog with custom component content\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tcomponent: (\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions?: Omit<DialogOptions, 'content' | 'message'>,\n\t): Promise<boolean> => {\n\t\treturn DialogService.getInstance().component(content, options)\n\t},\n\n\t/**\n\t * Dismiss the most recently opened dialog\n\t * @returns true if a dialog was dismissed, false if no dialogs were open\n\t */\n\tdismiss: (): boolean => {\n\t\treturn DialogService.getInstance().dismiss()\n\t},\n}\n\nexport default DialogService\n"],"names":["ConfirmDialog","$LitElement","css","constructor","super","arguments","this","title","message","confirmText","cancelText","variant","position","x","y","show","positionOrEvent","clientX","clientY","touches","length","pos","calculatePosition","setAttribute","Promise","resolve","resolvePromise","confirmed","removeAttribute","firstUpdated","setTimeout","dialog","shadowRoot","querySelector","width","offsetWidth","height","offsetHeight","viewportWidth","window","innerWidth","viewportHeight","innerHeight","Math","max","style","left","top","handleConfirm","hide","dispatchEvent","CustomEvent","bubbles","composed","render","dialogStyles","hasCustomContent","querySelectorAll","html","handleCancel","styleMap","when","options","document","createElement","body","appendChild","setProperty","event","confirm","__decorateClass","property","type","String","prototype","attribute","customElement","DialogService","activeDialogs","instance","completeOptions","DEFAULT_OPTIONS","getCenteredPosition","content","contentContainer","slot","result","HTMLElement","onConfirm","_e","removeEventListener","addEventListener","onCancel","push","finally","index","indexOf","splice","contentEl","removeChild","dismiss","_r","$dialog","getInstance","ask","danger","component"],"mappings":"meAaaA,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;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,GAAxC,aAAAC,CAAAC,MAAAC,GAAAA,SAAAA,EAmDEC,KAAAC,MAAAA,OAMED,K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,WAAY,SACZC,QAAS,UACTuB,MAAO,OAAA,EATF,IAAM2C,EAANwB,EA6LA,MAAMC,EAAU,CAKtBjC,QAAUP,GACFe,EAAc0B,YAAAA,EAAclC,QAAQP,CAAAA,EAO5C0C,IAAK,CAAChG,EAAiB4D,IACfS,EAAc0B,YAAcC,EAAAA,IAAIhG,EAAS4D,CAAAA,EAOjDqC,OAAS3C,GACDe,EAAc0B,YAAAA,EAAcE,OAAO3C,CAAAA,EAO3C4C,UAAW,CACVvB,EACArB,IAEOe,EAAc0B,YAAAA,EAAcG,UAAUvB,EAASrB,CAOvDsC,EAAAA,QAAS,IACDvB,EAAc0B,YAAcH,EAAAA,QAAAA,CAAAA"}
package/dist/dialog.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./dialog-service-Bju5U74b.cjs");exports.$dialog=e.$dialog,Object.defineProperty(exports,"ConfirmDialog",{enumerable:!0,get:()=>e.ConfirmDialog}),exports.DialogService=e.DialogService;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./dialog-service-BiNwFtwm.cjs");exports.$dialog=e.$dialog,Object.defineProperty(exports,"ConfirmDialog",{enumerable:!0,get:()=>e.ConfirmDialog}),exports.DialogService=e.DialogService;
2
2
  //# sourceMappingURL=dialog.cjs.map
package/dist/dialog.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as i, C as r, D as e } from "./dialog-service-B7mtryVn.js";
1
+ import { $ as i, C as r, D as e } from "./dialog-service-B9Pp1DY4.js";
2
2
  export {
3
3
  i as $dialog,
4
4
  r as ConfirmDialog,
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("./animated-text-BrDkqFTI.cjs");const a=require("./area.component-RZA2bq-D.cjs");require("./autocomplete-CuuHN9km.cjs");const r=require("./avatar-hg0j8zki.cjs");require("./spinner-D35seXuq.cjs");const h=require("./icon-button-D1627KoB.cjs"),f=require("./checkbox-DQd9Azq2.cjs");require("./chips-CkZAEsJp.cjs");const C=require("./payment-card-form-CdrMcc5c.cjs"),O=require("./date-range-BZlbUc_n.cjs"),u=require("./delay-C0xLB5YE.cjs"),S=require("./ripple-C2BHbhcS.cjs");require("./divider-xPhgMgau.cjs");const b=require("./timezone-BydmQhke.cjs");require("./form-BG9KH92a.cjs"),require("./icon-CIY_VPoc.cjs"),require("./input-VTxTwAen.cjs");const c=require("./flex-COQaEZmU.cjs"),y=require("./list-Df47IR-i.cjs");require("./menu-BmdOK-Gh.cjs");const n=require("./notification-service-DOGtyP8q.cjs");require("./option-BR_cajUP.cjs");const D=require("./radio-group-FInGxSDU.cjs"),P=require("./rxjs-utils.cjs");require("rxjs"),require("./index-DyJ0oDpR.cjs");const j=require("./select-DfzEP7n4.cjs"),o=require("./sheet-DfHOLchM.cjs"),p=require("./slider-YyZnXMOX.cjs"),i=require("./schmancy-steps-container-iHTmuKkc.cjs"),t=require("./context-object-CP7HbDFQ.cjs"),e=require("./selector-hook-wEJh3oTm.cjs"),d=require("./surface-u3lOyjll.cjs"),g=require("./table-Cfe1Zloe.cjs");require("./tabs-group-MGpxSLVK.cjs"),require("./textarea-CylQCLpW.cjs");const m=require("./theme.component-Cbjb7vBh.cjs"),q=require("./theme.interface-Xg5Zi46a.cjs");require("./theme-button-BSpshrnu.cjs");const w=require("./tooltip-Bs1R5e8R.cjs"),T=require("./tree-C68UrNiC.cjs"),M=require("./types.cjs"),I=require("./typewriter-CFgNAfJm.cjs"),A=require("./typography-B7lbxH4O.cjs"),N=require("./intersection-CVvaDv96.cjs"),s=require("./dropdown-content-Bwjmh6uS.cjs"),l=require("./dialog-service-Bju5U74b.cjs");exports.FINDING_MORTIES=a.FINDING_MORTIES,exports.HERE_RICKY=a.HERE_RICKY,exports.HISTORY_STRATEGY=a.HISTORY_STRATEGY,Object.defineProperty(exports,"SchmancyArea",{enumerable:!0,get:()=>a.SchmancyArea}),exports.area=a.area,exports.routerHistory=a.routerHistory,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,"SchmancyButton",{enumerable:!0,get:()=>h.SchmancyButton}),Object.defineProperty(exports,"SchmnacyIconButton",{enumerable:!0,get:()=>h.SchmnacyIconButton}),Object.defineProperty(exports,"SchmancyCheckbox",{enumerable:!0,get:()=>f.SchmancyCheckbox}),Object.defineProperty(exports,"SchmancyPaymentCardForm",{enumerable:!0,get:()=>C.SchmancyPaymentCardForm}),Object.defineProperty(exports,"SchmancyDateRange",{enumerable:!0,get:()=>O.SchmancyDateRange}),Object.defineProperty(exports,"SchmancyDelay",{enumerable:!0,get:()=>u.SchmancyDelay}),exports.delayContext=u.delayContext,exports.color=S.color,exports.fullHeight=S.fullHeight,exports.ripple=S.ripple,Object.defineProperty(exports,"SchmancyCountriesSelect",{enumerable:!0,get:()=>b.SchmancyCountriesSelect}),Object.defineProperty(exports,"SchmancyTimezonesSelect",{enumerable:!0,get:()=>b.SchmancyTimezonesSelect}),Object.defineProperty(exports,"SchmancyFlex",{enumerable:!0,get:()=>c.SchmancyFlex}),Object.defineProperty(exports,"SchmancyFlexV2",{enumerable:!0,get:()=>c.SchmancyFlexV2}),Object.defineProperty(exports,"SchmancyGrid",{enumerable:!0,get:()=>c.SchmancyGrid}),Object.defineProperty(exports,"SchmancyScroll",{enumerable:!0,get:()=>c.SchmancyScroll}),Object.defineProperty(exports,"List",{enumerable:!0,get:()=>y.List}),Object.defineProperty(exports,"SchmancyListItem",{enumerable:!0,get:()=>y.SchmancyListItem}),exports.SchmancyListTypeContext=y.SchmancyListTypeContext,exports.$notify=n.$notify,exports.NotificationAudioService=n.NotificationAudioService,Object.defineProperty(exports,"SchmancyNotification",{enumerable:!0,get:()=>n.SchmancyNotification}),Object.defineProperty(exports,"SchmancyNotificationContainer",{enumerable:!0,get:()=>n.SchmancyNotificationContainer}),Object.defineProperty(exports,"RadioGroup",{enumerable:!0,get:()=>D.RadioGroup}),exports.mutationObserver=P.mutationObserver,Object.defineProperty(exports,"SchmancySelect",{enumerable:!0,get:()=>j.SchmancySelect}),exports.SchmancySheetPosition=o.SchmancySheetPosition,exports.SheetHereMorty=o.SheetHereMorty,exports.SheetWhereAreYouRicky=o.SheetWhereAreYouRicky,exports.sheet=o.sheet,Object.defineProperty(exports,"SchmancySlide",{enumerable:!0,get:()=>p.SchmancySlide}),Object.defineProperty(exports,"SchmancySlider",{enumerable:!0,get:()=>p.SchmancySlider}),Object.defineProperty(exports,"SchmancyStep",{enumerable:!0,get:()=>i.SchmancyStep}),Object.defineProperty(exports,"SchmancyStepsContainer",{enumerable:!0,get:()=>i.SchmancyStepsContainer}),exports.StepsController=i.StepsController,exports.stepsContext=i.stepsContext,exports.BaseStore=t.BaseStore,exports.IndexedDBStorageManager=t.IndexedDBStorageManager,exports.LocalStorageManager=t.LocalStorageManager,exports.MemoryStorageManager=t.MemoryStorageManager,exports.SchmancyArrayStore=t.SchmancyArrayStore,exports.SchmancyStoreObject=t.SchmancyStoreObject,exports.SessionStorageManager=t.SessionStorageManager,exports.StoreError=t.StoreError,exports.createStorageManager=t.createStorageManager,exports.compareValues=e.compareValues,exports.createArrayContext=e.createArrayContext,exports.createCollectionSelector=e.createCollectionSelector,exports.createCompoundSelector=e.createCompoundSelector,exports.createContext=e.createContext,exports.createCountSelector=e.createCountSelector,exports.createEntriesSelector=e.createEntriesSelector,exports.createFilterSelector=e.createFilterSelector,exports.createFindSelector=e.createFindSelector,exports.createItemSelector=e.createItemSelector,exports.createItemsSelector=e.createItemsSelector,exports.createKeysSelector=e.createKeysSelector,exports.createMapSelector=e.createMapSelector,exports.createOptimizedSelector=e.createOptimizedSelector,exports.createSelector=e.createSelector,exports.createSortSelector=e.createSortSelector,exports.createTestArrayContext=e.createTestArrayContext,exports.filterArray=e.filterArray,exports.filterArrayItems=e.filterArrayItems,exports.filterMap=e.filterMap,exports.filterMapItems=e.filterMapItems,exports.getFieldValue=e.getFieldValue,exports.isArray=e.isArray,exports.isDate=e.isDate,exports.isIterable=e.isIterable,exports.isMap=e.isMap,exports.isNil=e.isNil,exports.isNumber=e.isNumber,exports.isPlainObject=e.isPlainObject,exports.isSet=e.isSet,exports.isString=e.isString,exports.select=e.select,exports.selectItem=e.selectItem,Object.defineProperty(exports,"SchmancySurface",{enumerable:!0,get:()=>d.SchmancySurface}),exports.SchmancySurfaceTypeContext=d.SchmancySurfaceTypeContext,Object.defineProperty(exports,"SchmancyDataTable",{enumerable:!0,get:()=>g.SchmancyDataTable}),Object.defineProperty(exports,"SchmancyTableRow",{enumerable:!0,get:()=>g.SchmancyTableRow}),Object.defineProperty(exports,"SchmancyThemeComponent",{enumerable:!0,get:()=>m.SchmancyThemeComponent}),exports.formateTheme=m.formateTheme,exports.tailwindStyles=m.tailwindStyles,exports.SchmancyTheme=q.SchmancyTheme,Object.defineProperty(exports,"SchmancyTooltip",{enumerable:!0,get:()=>w.SchmancyTooltip}),Object.defineProperty(exports,"SchmancyTree",{enumerable:!0,get:()=>T.SchmancyTree}),exports.SchmancyEvents=M.SchmancyEvents,Object.defineProperty(exports,"TypewriterElement",{enumerable:!0,get:()=>I.TypewriterElement}),Object.defineProperty(exports,"SchmancyTypography",{enumerable:!0,get:()=>A.SchmancyTypography}),exports.intersection$=N.intersection$,Object.defineProperty(exports,"SchmancyDropdown",{enumerable:!0,get:()=>s.SchmancyDropdown}),Object.defineProperty(exports,"SchmancyDropdownContent",{enumerable:!0,get:()=>s.SchmancyDropdownContent}),exports.$dialog=l.$dialog,Object.defineProperty(exports,"ConfirmDialog",{enumerable:!0,get:()=>l.ConfirmDialog}),exports.DialogService=l.DialogService;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("./animated-text-BrDkqFTI.cjs");const a=require("./area.component-RZA2bq-D.cjs");require("./autocomplete-CuuHN9km.cjs");const r=require("./avatar-DnFccDmD.cjs");require("./spinner-D35seXuq.cjs");const h=require("./icon-button-D1627KoB.cjs"),f=require("./checkbox-DQd9Azq2.cjs");require("./chips-CkZAEsJp.cjs");const C=require("./payment-card-form-CdrMcc5c.cjs"),O=require("./date-range-BZlbUc_n.cjs"),u=require("./delay-C0xLB5YE.cjs"),S=require("./ripple-C2BHbhcS.cjs");require("./divider-xPhgMgau.cjs");const b=require("./timezone-BydmQhke.cjs");require("./form-BG9KH92a.cjs"),require("./icon-CIY_VPoc.cjs"),require("./input-VTxTwAen.cjs");const c=require("./flex-COQaEZmU.cjs"),y=require("./list-Df47IR-i.cjs");require("./menu-BmdOK-Gh.cjs");const n=require("./notification-service-DOGtyP8q.cjs");require("./option-BR_cajUP.cjs");const D=require("./radio-group-FInGxSDU.cjs"),P=require("./rxjs-utils.cjs");require("rxjs"),require("./index-DyJ0oDpR.cjs");const j=require("./select-DfzEP7n4.cjs"),o=require("./sheet-DfHOLchM.cjs"),p=require("./slider-YyZnXMOX.cjs"),i=require("./schmancy-steps-container-iHTmuKkc.cjs"),t=require("./context-object-CP7HbDFQ.cjs"),e=require("./selector-hook-wEJh3oTm.cjs"),d=require("./surface-u3lOyjll.cjs"),g=require("./table-BA5yn5_q.cjs");require("./tabs-group-MGpxSLVK.cjs"),require("./textarea-CylQCLpW.cjs");const m=require("./theme.component-Cbjb7vBh.cjs"),q=require("./theme.interface-Xg5Zi46a.cjs");require("./theme-button-BSpshrnu.cjs");const w=require("./tooltip-Bs1R5e8R.cjs"),T=require("./tree-C68UrNiC.cjs"),M=require("./types.cjs"),I=require("./typewriter-CFgNAfJm.cjs"),A=require("./typography-B7lbxH4O.cjs"),N=require("./intersection-CVvaDv96.cjs"),s=require("./dropdown-content-Bwjmh6uS.cjs"),l=require("./dialog-service-BiNwFtwm.cjs");exports.FINDING_MORTIES=a.FINDING_MORTIES,exports.HERE_RICKY=a.HERE_RICKY,exports.HISTORY_STRATEGY=a.HISTORY_STRATEGY,Object.defineProperty(exports,"SchmancyArea",{enumerable:!0,get:()=>a.SchmancyArea}),exports.area=a.area,exports.routerHistory=a.routerHistory,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,"SchmancyButton",{enumerable:!0,get:()=>h.SchmancyButton}),Object.defineProperty(exports,"SchmnacyIconButton",{enumerable:!0,get:()=>h.SchmnacyIconButton}),Object.defineProperty(exports,"SchmancyCheckbox",{enumerable:!0,get:()=>f.SchmancyCheckbox}),Object.defineProperty(exports,"SchmancyPaymentCardForm",{enumerable:!0,get:()=>C.SchmancyPaymentCardForm}),Object.defineProperty(exports,"SchmancyDateRange",{enumerable:!0,get:()=>O.SchmancyDateRange}),Object.defineProperty(exports,"SchmancyDelay",{enumerable:!0,get:()=>u.SchmancyDelay}),exports.delayContext=u.delayContext,exports.color=S.color,exports.fullHeight=S.fullHeight,exports.ripple=S.ripple,Object.defineProperty(exports,"SchmancyCountriesSelect",{enumerable:!0,get:()=>b.SchmancyCountriesSelect}),Object.defineProperty(exports,"SchmancyTimezonesSelect",{enumerable:!0,get:()=>b.SchmancyTimezonesSelect}),Object.defineProperty(exports,"SchmancyFlex",{enumerable:!0,get:()=>c.SchmancyFlex}),Object.defineProperty(exports,"SchmancyFlexV2",{enumerable:!0,get:()=>c.SchmancyFlexV2}),Object.defineProperty(exports,"SchmancyGrid",{enumerable:!0,get:()=>c.SchmancyGrid}),Object.defineProperty(exports,"SchmancyScroll",{enumerable:!0,get:()=>c.SchmancyScroll}),Object.defineProperty(exports,"List",{enumerable:!0,get:()=>y.List}),Object.defineProperty(exports,"SchmancyListItem",{enumerable:!0,get:()=>y.SchmancyListItem}),exports.SchmancyListTypeContext=y.SchmancyListTypeContext,exports.$notify=n.$notify,exports.NotificationAudioService=n.NotificationAudioService,Object.defineProperty(exports,"SchmancyNotification",{enumerable:!0,get:()=>n.SchmancyNotification}),Object.defineProperty(exports,"SchmancyNotificationContainer",{enumerable:!0,get:()=>n.SchmancyNotificationContainer}),Object.defineProperty(exports,"RadioGroup",{enumerable:!0,get:()=>D.RadioGroup}),exports.mutationObserver=P.mutationObserver,Object.defineProperty(exports,"SchmancySelect",{enumerable:!0,get:()=>j.SchmancySelect}),exports.SchmancySheetPosition=o.SchmancySheetPosition,exports.SheetHereMorty=o.SheetHereMorty,exports.SheetWhereAreYouRicky=o.SheetWhereAreYouRicky,exports.sheet=o.sheet,Object.defineProperty(exports,"SchmancySlide",{enumerable:!0,get:()=>p.SchmancySlide}),Object.defineProperty(exports,"SchmancySlider",{enumerable:!0,get:()=>p.SchmancySlider}),Object.defineProperty(exports,"SchmancyStep",{enumerable:!0,get:()=>i.SchmancyStep}),Object.defineProperty(exports,"SchmancyStepsContainer",{enumerable:!0,get:()=>i.SchmancyStepsContainer}),exports.StepsController=i.StepsController,exports.stepsContext=i.stepsContext,exports.BaseStore=t.BaseStore,exports.IndexedDBStorageManager=t.IndexedDBStorageManager,exports.LocalStorageManager=t.LocalStorageManager,exports.MemoryStorageManager=t.MemoryStorageManager,exports.SchmancyArrayStore=t.SchmancyArrayStore,exports.SchmancyStoreObject=t.SchmancyStoreObject,exports.SessionStorageManager=t.SessionStorageManager,exports.StoreError=t.StoreError,exports.createStorageManager=t.createStorageManager,exports.compareValues=e.compareValues,exports.createArrayContext=e.createArrayContext,exports.createCollectionSelector=e.createCollectionSelector,exports.createCompoundSelector=e.createCompoundSelector,exports.createContext=e.createContext,exports.createCountSelector=e.createCountSelector,exports.createEntriesSelector=e.createEntriesSelector,exports.createFilterSelector=e.createFilterSelector,exports.createFindSelector=e.createFindSelector,exports.createItemSelector=e.createItemSelector,exports.createItemsSelector=e.createItemsSelector,exports.createKeysSelector=e.createKeysSelector,exports.createMapSelector=e.createMapSelector,exports.createOptimizedSelector=e.createOptimizedSelector,exports.createSelector=e.createSelector,exports.createSortSelector=e.createSortSelector,exports.createTestArrayContext=e.createTestArrayContext,exports.filterArray=e.filterArray,exports.filterArrayItems=e.filterArrayItems,exports.filterMap=e.filterMap,exports.filterMapItems=e.filterMapItems,exports.getFieldValue=e.getFieldValue,exports.isArray=e.isArray,exports.isDate=e.isDate,exports.isIterable=e.isIterable,exports.isMap=e.isMap,exports.isNil=e.isNil,exports.isNumber=e.isNumber,exports.isPlainObject=e.isPlainObject,exports.isSet=e.isSet,exports.isString=e.isString,exports.select=e.select,exports.selectItem=e.selectItem,Object.defineProperty(exports,"SchmancySurface",{enumerable:!0,get:()=>d.SchmancySurface}),exports.SchmancySurfaceTypeContext=d.SchmancySurfaceTypeContext,Object.defineProperty(exports,"SchmancyDataTable",{enumerable:!0,get:()=>g.SchmancyDataTable}),Object.defineProperty(exports,"SchmancyTableRow",{enumerable:!0,get:()=>g.SchmancyTableRow}),Object.defineProperty(exports,"SchmancyThemeComponent",{enumerable:!0,get:()=>m.SchmancyThemeComponent}),exports.formateTheme=m.formateTheme,exports.tailwindStyles=m.tailwindStyles,exports.SchmancyTheme=q.SchmancyTheme,Object.defineProperty(exports,"SchmancyTooltip",{enumerable:!0,get:()=>w.SchmancyTooltip}),Object.defineProperty(exports,"SchmancyTree",{enumerable:!0,get:()=>T.SchmancyTree}),exports.SchmancyEvents=M.SchmancyEvents,Object.defineProperty(exports,"TypewriterElement",{enumerable:!0,get:()=>I.TypewriterElement}),Object.defineProperty(exports,"SchmancyTypography",{enumerable:!0,get:()=>A.SchmancyTypography}),exports.intersection$=N.intersection$,Object.defineProperty(exports,"SchmancyDropdown",{enumerable:!0,get:()=>s.SchmancyDropdown}),Object.defineProperty(exports,"SchmancyDropdownContent",{enumerable:!0,get:()=>s.SchmancyDropdownContent}),exports.$dialog=l.$dialog,Object.defineProperty(exports,"ConfirmDialog",{enumerable:!0,get:()=>l.ConfirmDialog}),exports.DialogService=l.DialogService;
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import "./animated-text-s9T0FPzu.js";
2
2
  import { F as C, H as D, b as d, S as g, a as w, r as b } from "./area.component-DGr6ZdvQ.js";
3
3
  import "./autocomplete-1gZeSbnf.js";
4
- import { $ as T, H as u, q as I, S as A, f as N, c as v, g as R, d as E, e as F, h as H, a as B, b as $, j as L, l as O, m as k, n as G, k as Y, o as j, p as V, W, s as z, i as P, t as _ } from "./avatar-CTucKkA4.js";
4
+ import { $ as T, H as u, q as I, S as A, f as N, c as v, g as R, d as E, e as F, h as H, a as B, b as $, j as L, l as O, m as k, n as G, k as Y, o as j, p as V, W, s as z, i as P, t as _ } from "./avatar-CbR-jibC.js";
5
5
  import "./spinner-Bd1aWVNB.js";
6
6
  import { S as K, a as J } from "./icon-button-BMbFb3-e.js";
7
7
  import { S as U } from "./checkbox-DFYmSAah.js";
@@ -31,7 +31,7 @@ import { S as ja, a as Va, b as Wa, s as za } from "./schmancy-steps-container-f
31
31
  import { B as _a, I as qa, L as Ka, M as Ja, S as Qa, a as Ua, b as Xa, d as Za, c as ae } from "./context-object-CISes2bD.js";
32
32
  import { p as re, a as te, v as oe, G as ce, c as se, E as ne, z as Se, C as me, B as ie, x as ye, w as pe, y as he, D as le, F as fe, u as xe, A as Ce, b as De, r as de, d as ge, q as we, f as be, g as Me, i as Te, j as ue, k as Ie, l as Ae, o as Ne, h as ve, n as Re, m as Ee, e as Fe, s as He, t as Be } from "./selector-hook-omsuyAOu.js";
33
33
  import { a as Le, S as Oe } from "./surface-CkiumzDj.js";
34
- import { a as Ge, S as Ye } from "./table-DPXzmJkJ.js";
34
+ import { a as Ge, S as Ye } from "./table-CRLXjzqK.js";
35
35
  import "./tabs-group-CBXEoVBr.js";
36
36
  import "./textarea-BkXQqdc4.js";
37
37
  import { S as Ve, f as We, t as ze } from "./theme.component-B6OPvX11.js";
@@ -44,7 +44,7 @@ import { T as ar } from "./typewriter-Ckxnim4-.js";
44
44
  import { S as rr } from "./typography-xqI7xXeK.js";
45
45
  import { i as or } from "./intersection-CJxzz8c-.js";
46
46
  import { S as sr, a as nr } from "./dropdown-content-Cnk_HWWq.js";
47
- import { $ as mr, C as ir, D as yr } from "./dialog-service-B7mtryVn.js";
47
+ import { $ as mr, C as ir, D as yr } from "./dialog-service-B9Pp1DY4.js";
48
48
  export {
49
49
  mr as $dialog,
50
50
  T as $drawer,
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./avatar-hg0j8zki.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-DnFccDmD.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-CTucKkA4.js";
1
+ import { $ as c, j as e, l as n, m, n as s, k as i, o, i as t } from "./avatar-CbR-jibC.js";
2
2
  export {
3
3
  c as $drawer,
4
4
  e as SchmancyDrawerAppbar,
@@ -1,31 +1,31 @@
1
- "use strict";const p=require("./tslib.es6-DgOcxv4s.cjs"),n=require("lit"),y=require("lit/decorators/property.js"),k=require("lit/directive.js"),F=require("lit/async-directive.js"),P=require("lit/directives/repeat.js"),D=require("./litElement.mixin-DcVBwo9t.cjs"),a=require("lit/decorators.js");var N=Object.defineProperty,j=Object.getOwnPropertyDescriptor,g=(l,t,e,i)=>{for(var s,r=i>1?void 0:i?j(t,e):t,o=l.length-1;o>=0;o--)(s=l[o])&&(r=(i?s(t,e,r):s(r))||r);return i&&r&&N(t,e,r),r};exports.SchmancyTableRow=class extends D.$LitElement(){constructor(){super(...arguments),this.columns=[],this.cols=this.columns.map(()=>"1fr").join(" ")}renderCell(l){if(l.render)return n.html`
1
+ "use strict";const y=require("./tslib.es6-DgOcxv4s.cjs"),h=require("lit"),g=require("lit/decorators/property.js"),k=require("lit/directive.js"),N=require("lit/async-directive.js"),B=require("lit/directives/repeat.js"),D=require("./litElement.mixin-DcVBwo9t.cjs"),u=require("lit/decorators.js");var j=Object.defineProperty,P=Object.getOwnPropertyDescriptor,f=(l,t,e,i)=>{for(var s,r=i>1?void 0:i?P(t,e):t,o=l.length-1;o>=0;o--)(s=l[o])&&(r=(i?s(t,e,r):s(r))||r);return i&&r&&j(t,e,r),r};exports.SchmancyTableRow=class extends D.$LitElement(){constructor(){super(...arguments),this.columns=[],this.cols=this.columns.map(()=>"1fr").join(" ")}renderCell(l){if(l.render)return h.html`
2
2
  <div class="overflow-hidden text-ellipsis">
3
3
  <schmancy-typography align="${l.align||"left"}" maxLines="2" weight="${l.weight||"normal"}">
4
4
  ${l.render(this.item)}
5
5
  </schmancy-typography>
6
6
  </div>
7
- `;const t=l.key?this.item[l.key]:"";return n.html`
7
+ `;const t=l.key?this.item[l.key]:"";return h.html`
8
8
  <div class="overflow-hidden text-ellipsis">
9
9
  <schmancy-typography align="${l.align||"left"}" maxLines="2" weight="${l.weight||"normal"}">
10
10
  ${t}
11
11
  </schmancy-typography>
12
12
  </div>
13
- `}render(){return n.html`
13
+ `}render(){return h.html`
14
14
  <schmancy-list-item class="w-full">
15
15
  <schmancy-grid .cols=${this.cols} align="center" gap="md">
16
16
  ${this.columns.map(l=>this.renderCell(l))}
17
17
  </schmancy-grid>
18
18
  </schmancy-list-item>
19
- `}},g([a.property({type:Array,attribute:!1})],exports.SchmancyTableRow.prototype,"columns",2),g([a.property({type:Object,attribute:!1})],exports.SchmancyTableRow.prototype,"item",2),g([a.property({type:String})],exports.SchmancyTableRow.prototype,"cols",2),exports.SchmancyTableRow=g([a.customElement("schmancy-table-row")],exports.SchmancyTableRow);class b extends Event{constructor(t){super(b.eventName,{bubbles:!1}),this.first=t.first,this.last=t.last}}b.eventName="rangeChanged";class w extends Event{constructor(t){super(w.eventName,{bubbles:!1}),this.first=t.first,this.last=t.last}}w.eventName="visibilityChanged";class C extends Event{constructor(){super(C.eventName,{bubbles:!1})}}C.eventName="unpinned";class H{constructor(t){this._element=null;const e=t??window;this._node=e,t&&(this._element=t)}get element(){return this._element||document.scrollingElement||document.documentElement}get scrollTop(){return this.element.scrollTop||window.scrollY}get scrollLeft(){return this.element.scrollLeft||window.scrollX}get scrollHeight(){return this.element.scrollHeight}get scrollWidth(){return this.element.scrollWidth}get viewportHeight(){return this._element?this._element.getBoundingClientRect().height:window.innerHeight}get viewportWidth(){return this._element?this._element.getBoundingClientRect().width:window.innerWidth}get maxScrollTop(){return this.scrollHeight-this.viewportHeight}get maxScrollLeft(){return this.scrollWidth-this.viewportWidth}}class q extends H{constructor(t,e){super(e),this._clients=new Set,this._retarget=null,this._end=null,this.t=null,this.correctingScrollError=!1,this._checkForArrival=this._checkForArrival.bind(this),this._updateManagedScrollTo=this._updateManagedScrollTo.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollBy=this.scrollBy.bind(this);const i=this._node;this._originalScrollTo=i.scrollTo,this._originalScrollBy=i.scrollBy,this._originalScroll=i.scroll,this._attach(t)}get _destination(){return this.t}get scrolling(){return this._destination!==null}scrollTo(t,e){const i=typeof t=="number"&&typeof e=="number"?{left:t,top:e}:t;this._scrollTo(i)}scrollBy(t,e){const i=typeof t=="number"&&typeof e=="number"?{left:t,top:e}:t;i.top!==void 0&&(i.top+=this.scrollTop),i.left!==void 0&&(i.left+=this.scrollLeft),this._scrollTo(i)}_nativeScrollTo(t){this._originalScrollTo.bind(this._element||window)(t)}_scrollTo(t,e=null,i=null){this._end!==null&&this._end(),t.behavior==="smooth"?(this._setDestination(t),this._retarget=e,this._end=i):this._resetScrollState(),this._nativeScrollTo(t)}_setDestination(t){let{top:e,left:i}=t;return e=e===void 0?void 0:Math.max(0,Math.min(e,this.maxScrollTop)),i=i===void 0?void 0:Math.max(0,Math.min(i,this.maxScrollLeft)),(this._destination===null||i!==this._destination.left||e!==this._destination.top)&&(this.t={top:e,left:i,behavior:"smooth"},!0)}_resetScrollState(){this.t=null,this._retarget=null,this._end=null}_updateManagedScrollTo(t){this._destination&&this._setDestination(t)&&this._nativeScrollTo(this._destination)}managedScrollTo(t,e,i){return this._scrollTo(t,e,i),this._updateManagedScrollTo}correctScrollError(t){this.correctingScrollError=!0,requestAnimationFrame(()=>requestAnimationFrame(()=>this.correctingScrollError=!1)),this._nativeScrollTo(t),this._retarget&&this._setDestination(this._retarget()),this._destination&&this._nativeScrollTo(this._destination)}_checkForArrival(){if(this._destination!==null){const{scrollTop:t,scrollLeft:e}=this;let{top:i,left:s}=this._destination;i=Math.min(i||0,this.maxScrollTop),s=Math.min(s||0,this.maxScrollLeft);const r=Math.abs(i-t),o=Math.abs(s-e);r<1&&o<1&&(this._end&&this._end(),this._resetScrollState())}}detach(t){return this._clients.delete(t),this._clients.size===0&&(this._node.scrollTo=this._originalScrollTo,this._node.scrollBy=this._originalScrollBy,this._node.scroll=this._originalScroll,this._node.removeEventListener("scroll",this._checkForArrival)),null}_attach(t){this._clients.add(t),this._clients.size===1&&(this._node.scrollTo=this.scrollTo,this._node.scrollBy=this.scrollBy,this._node.scroll=this.scrollTo,this._node.addEventListener("scroll",this._checkForArrival))}}let L=typeof window<"u"?window.ResizeObserver:void 0;const S=Symbol("virtualizerRef"),f="virtualizer-sizer";let z;class W{constructor(t){if(this._benchmarkStart=null,this._layout=null,this._clippingAncestors=[],this._scrollSize=null,this._scrollError=null,this._childrenPos=null,this._childMeasurements=null,this._toBeMeasured=new Map,this._rangeChanged=!0,this._itemsChanged=!0,this._visibilityChanged=!0,this._scrollerController=null,this._isScroller=!1,this._sizer=null,this._hostElementRO=null,this._childrenRO=null,this._mutationObserver=null,this._scrollEventListeners=[],this._scrollEventListenerOptions={passive:!0},this._loadListener=this._childLoaded.bind(this),this._scrollIntoViewTarget=null,this._updateScrollIntoViewCoordinates=null,this._items=[],this._first=-1,this._last=-1,this._firstVisible=-1,this._lastVisible=-1,this._scheduled=new WeakSet,this._measureCallback=null,this._measureChildOverride=null,this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null,this._layoutInitialized=null,this._connected=!1,!t)throw new Error("Virtualizer constructor requires a configuration object");if(!t.hostElement)throw new Error('Virtualizer configuration requires the "hostElement" property');this._init(t)}set items(t){Array.isArray(t)&&t!==this._items&&(this._itemsChanged=!0,this._items=t,this._schedule(this._updateLayout))}_init(t){this._isScroller=!!t.scroller,this._initHostElement(t);const e=t.layout||{};this._layoutInitialized=this._initLayout(e)}_initObservers(){this._mutationObserver=new MutationObserver(this._finishDOMUpdate.bind(this)),this._hostElementRO=new L(()=>this._hostElementSizeChanged()),this._childrenRO=new L(this._childrenSizeChanged.bind(this))}_initHostElement(t){const e=this._hostElement=t.hostElement;this._applyVirtualizerStyles(),e[S]=this}connected(){this._initObservers();const t=this._isScroller;this._clippingAncestors=function(e,i=!1){let s=!1;return function(r,o=!1){const u=[];let c=o?r:x(r);for(;c!==null;)u.push(c),c=x(c);return u}(e,i).filter(r=>{if(s)return!1;const o=getComputedStyle(r);return s=o.position==="fixed",o.overflow!=="visible"})}(this._hostElement,t),this._scrollerController=new q(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen(),this._connected=!0}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach(t=>{t.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(t),this._hostElementRO.observe(t)}),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach(t=>this._childrenRO.observe(t)),this._scrollEventListeners.forEach(t=>t.addEventListener("scroll",this,this._scrollEventListenerOptions))}disconnected(){var t,e,i,s;this._scrollEventListeners.forEach(r=>r.removeEventListener("scroll",this,this._scrollEventListenerOptions)),this._scrollEventListeners=[],this._clippingAncestors=[],(t=this._scrollerController)==null||t.detach(this),this._scrollerController=null,(e=this._mutationObserver)==null||e.disconnect(),this._mutationObserver=null,(i=this._hostElementRO)==null||i.disconnect(),this._hostElementRO=null,(s=this._childrenRO)==null||s.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise("disconnected"),this._connected=!1}_applyVirtualizerStyles(){const t=this._hostElement.style;t.display=t.display||"block",t.position=t.position||"relative",t.contain=t.contain||"size layout",this._isScroller&&(t.overflow=t.overflow||"auto",t.minHeight=t.minHeight||"150px")}_getSizer(){const t=this._hostElement;if(!this._sizer){let e=t.querySelector(`[${f}]`);e||(e=document.createElement("div"),e.setAttribute(f,""),t.appendChild(e)),Object.assign(e.style,{position:"absolute",margin:"-2px 0 0 0",padding:0,visibility:"hidden",fontSize:"2px"}),e.textContent="&nbsp;",e.setAttribute(f,""),this._sizer=e}return this._sizer}async updateLayoutConfig(t){await this._layoutInitialized;const e=t.type||z;if(typeof e=="function"&&this._layout instanceof e){const i={...t};return delete i.type,this._layout.config=i,!0}return!1}async _initLayout(t){let e,i;if(typeof t.type=="function"){i=t.type;const s={...t};delete s.type,e=s}else e=t;i===void 0&&(z=i=(await Promise.resolve().then(()=>require("./flow-CnJl1T1A.cjs"))).FlowLayout),this._layout=new i(s=>this._handleLayoutMessage(s),e),this._layout.measureChildren&&typeof this._layout.updateItemSizes=="function"&&(typeof this._layout.measureChildren=="function"&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener("load",this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){this._benchmarkStart===null&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(this._benchmarkStart!==null){const t=window.performance.now(),e=t-this._benchmarkStart,i=performance.getEntriesByName("uv-virtualizing","measure").filter(s=>s.startTime>=this._benchmarkStart&&s.startTime<t).reduce((s,r)=>s+r.duration,0);return this._benchmarkStart=null,{timeElapsed:e,virtualizationTime:i}}return null}_measureChildren(){const t={},e=this._children,i=this._measureChildOverride||this._measureChild;for(let s=0;s<e.length;s++){const r=e[s],o=this._first+s;(this._itemsChanged||this._toBeMeasured.has(r))&&(t[o]=i.call(this,r,this._items[o]))}this._childMeasurements=t,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(t){const{width:e,height:i}=t.getBoundingClientRect();return Object.assign({width:e,height:i},function(s){const r=window.getComputedStyle(s);return{marginTop:v(r.marginTop),marginRight:v(r.marginRight),marginBottom:v(r.marginBottom),marginLeft:v(r.marginLeft)}}(t))}async _schedule(t){this._scheduled.has(t)||(this._scheduled.add(t),await Promise.resolve(),this._scheduled.delete(t),t.call(this))}async _updateDOM(t){this._scrollSize=t.scrollSize,this._adjustRange(t.range),this._childrenPos=t.childPositions,this._scrollError=t.scrollError||null;const{_rangeChanged:e,_itemsChanged:i}=this;this._visibilityChanged&&(this._notifyVisibility(),this._visibilityChanged=!1),(e||i)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._connected&&(this._children.forEach(t=>this._childrenRO.observe(t)),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_updateLayout(){this._layout&&this._connected&&(this._layout.items=this._items,this._updateView(),this._childMeasurements!==null&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_handleScrollEvent(){var t;if(this._benchmarkStart&&"mark"in window.performance){try{window.performance.measure("uv-virtualizing","uv-start","uv-end")}catch{}window.performance.mark("uv-start")}this._scrollerController.correctingScrollError===!1&&((t=this._layout)==null||t.unpin()),this._schedule(this._updateLayout)}handleEvent(t){t.type==="scroll"&&(t.currentTarget===window||this._clippingAncestors.includes(t.currentTarget))&&this._handleScrollEvent()}_handleLayoutMessage(t){t.type==="stateChanged"?this._updateDOM(t):t.type==="visibilityChanged"?(this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._notifyVisibility()):t.type==="unpinned"&&this._hostElement.dispatchEvent(new C)}get _children(){const t=[];let e=this._hostElement.firstElementChild;for(;e;)e.hasAttribute(f)||t.push(e),e=e.nextElementSibling;return t}_updateView(){var s;const t=this._hostElement,e=(s=this._scrollerController)==null?void 0:s.element,i=this._layout;if(t&&e&&i){let r,o,u,c;const h=t.getBoundingClientRect();r=0,o=0,u=window.innerHeight,c=window.innerWidth;const E=this._clippingAncestors.map(_=>_.getBoundingClientRect());E.unshift(h);for(const _ of E)r=Math.max(r,_.top),o=Math.max(o,_.left),u=Math.min(u,_.bottom),c=Math.min(c,_.right);const T=e.getBoundingClientRect(),R={left:h.left-T.left,top:h.top-T.top},M={width:e.scrollWidth,height:e.scrollHeight},I=r-h.top+t.scrollTop,$=o-h.left+t.scrollLeft,A=Math.max(0,u-r),B=Math.max(0,c-o);i.viewportSize={width:B,height:A},i.viewportScroll={top:I,left:$},i.totalScrollSize=M,i.offsetWithinScroller=R}}_sizeHostElement(t){const i=t&&t.width!==null?Math.min(82e5,t.width):0,s=t&&t.height!==null?Math.min(82e5,t.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${i}px, ${s}px)`;else{const r=this._hostElement.style;r.minWidth=i?`${i}px`:"100%",r.minHeight=s?`${s}px`:"100%"}}_positionChildren(t){t&&t.forEach(({top:e,left:i,width:s,height:r,xOffset:o,yOffset:u},c)=>{const h=this._children[c-this._first];h&&(h.style.position="absolute",h.style.boxSizing="border-box",h.style.transform=`translate(${i}px, ${e}px)`,s!==void 0&&(h.style.width=s+"px"),r!==void 0&&(h.style.height=r+"px"),h.style.left=o===void 0?null:o+"px",h.style.top=u===void 0?null:u+"px")})}async _adjustRange(t){const{_first:e,_last:i,_firstVisible:s,_lastVisible:r}=this;this._first=t.first,this._last=t.last,this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==e||this._last!==i,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==s||this._lastVisible!==r}_correctScrollError(){if(this._scrollError){const{scrollTop:t,scrollLeft:e}=this._scrollerController,{top:i,left:s}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:t-i,left:e-s})}}element(t){var e;return t===1/0&&(t=this._items.length-1),((e=this._items)==null?void 0:e[t])===void 0?void 0:{scrollIntoView:(i={})=>this._scrollElementIntoView({...i,index:t})}}_scrollElementIntoView(t){if(t.index>=this._first&&t.index<=this._last)this._children[t.index-this._first].scrollIntoView(t);else if(t.index=Math.min(t.index,this._items.length-1),t.behavior==="smooth"){const e=this._layout.getScrollIntoViewCoordinates(t),{behavior:i}=t;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(e,{behavior:i}),()=>this._layout.getScrollIntoViewCoordinates(t),()=>this._scrollIntoViewTarget=null),this._scrollIntoViewTarget=t}else this._layout.pin=t}_checkScrollIntoViewTarget(t){const{index:e}=this._scrollIntoViewTarget||{};e&&(t!=null&&t.has(e))&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new b({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new w({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||(this._layoutCompletePromise=new Promise((t,e)=>{this._layoutCompleteResolver=t,this._layoutCompleteRejecter=e})),this._layoutCompletePromise}_rejectLayoutCompletePromise(t){this._layoutCompleteRejecter!==null&&this._layoutCompleteRejecter(t),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&this._pendingLayoutComplete===null&&(this._pendingLayoutComplete=requestAnimationFrame(()=>requestAnimationFrame(()=>this._resolveLayoutCompletePromise())))}_resolveLayoutCompletePromise(){this._layoutCompleteResolver!==null&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(t){var e;if((e=this._layout)!=null&&e.measureChildren){for(const i of t)this._toBeMeasured.set(i.target,i.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}}function v(l){const t=l?parseFloat(l):NaN;return Number.isNaN(t)?0:t}function x(l){if(l.assignedSlot!==null)return l.assignedSlot;if(l.parentElement!==null)return l.parentElement;const t=l.parentNode;return t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host||null}const O=l=>l,V=(l,t)=>n.html`${t}: ${JSON.stringify(l,null,2)}`;class U extends F.AsyncDirective{constructor(t){if(super(t),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(e,i)=>V(e,i+this._first),this._keyFunction=(e,i)=>O(e,this._first),this._items=[],t.type!==k.PartType.CHILD)throw new Error("The virtualize directive can only be used in child expressions")}render(t){t&&this._setFunctions(t);const e=[];if(this._first>=0&&this._last>=this._first)for(let i=this._first;i<=this._last;i++)e.push(this._items[i]);return P.repeat(e,this._keyFunction,this._renderItem)}update(t,[e]){this._setFunctions(e);const i=this._items!==e.items;return this._items=e.items||[],this._virtualizer?this._updateVirtualizerConfig(t,e):this._initialize(t,e),i?n.noChange:this.render()}async _updateVirtualizerConfig(t,e){if(!await this._virtualizer.updateLayoutConfig(e.layout||{})){const i=t.parentNode;this._makeVirtualizer(i,e)}this._virtualizer.items=this._items}_setFunctions(t){const{renderItem:e,keyFunction:i}=t;e&&(this._renderItem=(s,r)=>e(s,r+this._first)),i&&(this._keyFunction=(s,r)=>i(s,r+this._first))}_makeVirtualizer(t,e){this._virtualizer&&this._virtualizer.disconnected();const{layout:i,scroller:s,items:r}=e;this._virtualizer=new W({hostElement:t,layout:i,scroller:s}),this._virtualizer.items=r,this._virtualizer.connected()}_initialize(t,e){const i=t.parentNode;i&&i.nodeType===1&&(i.addEventListener("rangeChanged",s=>{this._first=s.first,this._last=s.last,this.setValue(this.render())}),this._makeVirtualizer(i,e))}disconnected(){var t;(t=this._virtualizer)==null||t.disconnected()}reconnected(){var t;(t=this._virtualizer)==null||t.connected()}}const G=k.directive(U);class m extends n.LitElement{constructor(){super(...arguments),this.items=[],this.renderItem=V,this.keyFunction=O,this.layout={},this.scroller=!1}createRenderRoot(){return this}render(){const{items:t,renderItem:e,keyFunction:i,layout:s,scroller:r}=this;return n.html`${G({items:t,renderItem:e,keyFunction:i,layout:s,scroller:r})}`}element(t){var e;return(e=this[S])==null?void 0:e.element(t)}get layoutComplete(){var t;return(t=this[S])==null?void 0:t.layoutComplete}scrollToIndex(t,e="start"){var i;(i=this.element(t))==null||i.scrollIntoView({block:e})}}p.i([y.property({attribute:!1})],m.prototype,"items",void 0),p.i([y.property()],m.prototype,"renderItem",void 0),p.i([y.property()],m.prototype,"keyFunction",void 0),p.i([y.property({attribute:!1})],m.prototype,"layout",void 0),p.i([y.property({reflect:!0,type:Boolean})],m.prototype,"scroller",void 0),customElements.define("lit-virtualizer",m);var J=Object.defineProperty,X=Object.getOwnPropertyDescriptor,d=(l,t,e,i)=>{for(var s,r=i>1?void 0:i?X(t,e):t,o=l.length-1;o>=0;o--)(s=l[o])&&(r=(i?s(t,e,r):s(r))||r);return i&&r&&J(t,e,r),r};exports.SchmancyDataTable=class extends D.$LitElement(){constructor(){super(),this.columns=[],this.data=[],this.keyField="id",this.cols="1fr",this.sortable=!1,this.sortColumn=null,this.sortDirection=null,this.filteredData=[],this.filteredData=this.data}willUpdate(l){(l.has("data")||l.has("sortColumn")||l.has("sortDirection"))&&this.processData()}processData(){let l=[...this.data];this.sortable&&this.sortColumn&&this.sortDirection&&l.sort((t,e)=>{const i=t[this.sortColumn],s=e[this.sortColumn];if(typeof i=="string"&&typeof s=="string")return this.sortDirection==="asc"?i.localeCompare(s):s.localeCompare(i);if(typeof i=="number"&&typeof s=="number")return this.sortDirection==="asc"?i-s:s-i;if(i&&s&&i instanceof Date&&s instanceof Date)return this.sortDirection==="asc"?i.getTime()-s.getTime():s.getTime()-i.getTime();{const r=String(i||""),o=String(s||"");return this.sortDirection==="asc"?r.localeCompare(o):o.localeCompare(r)}}),this.filteredData=l}toggleSort(l){if(!l.key||l.sortable===!1)return;const t=l.key;t===this.sortColumn?this.sortDirection==="asc"?this.sortDirection="desc":this.sortDirection==="desc"?this.sortDirection=null:this.sortDirection="asc":(this.sortColumn=t,this.sortDirection="asc"),this.dispatchEvent(new CustomEvent("sort-change",{detail:{column:this.sortColumn,direction:this.sortDirection},bubbles:!0,composed:!0}))}renderSortIndicator(l){return this.sortable&&l.sortable!==!1&&l.key&&l.key===this.sortColumn?n.html`
19
+ `}},f([u.property({type:Array,attribute:!1})],exports.SchmancyTableRow.prototype,"columns",2),f([u.property({type:Object,attribute:!1})],exports.SchmancyTableRow.prototype,"item",2),f([u.property({type:String})],exports.SchmancyTableRow.prototype,"cols",2),exports.SchmancyTableRow=f([u.customElement("schmancy-table-row")],exports.SchmancyTableRow);class w extends Event{constructor(t){super(w.eventName,{bubbles:!1}),this.first=t.first,this.last=t.last}}w.eventName="rangeChanged";class C extends Event{constructor(t){super(C.eventName,{bubbles:!1}),this.first=t.first,this.last=t.last}}C.eventName="visibilityChanged";class S extends Event{constructor(){super(S.eventName,{bubbles:!1})}}S.eventName="unpinned";class H{constructor(t){this._element=null;const e=t??window;this._node=e,t&&(this._element=t)}get element(){return this._element||document.scrollingElement||document.documentElement}get scrollTop(){return this.element.scrollTop||window.scrollY}get scrollLeft(){return this.element.scrollLeft||window.scrollX}get scrollHeight(){return this.element.scrollHeight}get scrollWidth(){return this.element.scrollWidth}get viewportHeight(){return this._element?this._element.getBoundingClientRect().height:window.innerHeight}get viewportWidth(){return this._element?this._element.getBoundingClientRect().width:window.innerWidth}get maxScrollTop(){return this.scrollHeight-this.viewportHeight}get maxScrollLeft(){return this.scrollWidth-this.viewportWidth}}class q extends H{constructor(t,e){super(e),this._clients=new Set,this._retarget=null,this._end=null,this.t=null,this.correctingScrollError=!1,this._checkForArrival=this._checkForArrival.bind(this),this._updateManagedScrollTo=this._updateManagedScrollTo.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollBy=this.scrollBy.bind(this);const i=this._node;this._originalScrollTo=i.scrollTo,this._originalScrollBy=i.scrollBy,this._originalScroll=i.scroll,this._attach(t)}get _destination(){return this.t}get scrolling(){return this._destination!==null}scrollTo(t,e){const i=typeof t=="number"&&typeof e=="number"?{left:t,top:e}:t;this._scrollTo(i)}scrollBy(t,e){const i=typeof t=="number"&&typeof e=="number"?{left:t,top:e}:t;i.top!==void 0&&(i.top+=this.scrollTop),i.left!==void 0&&(i.left+=this.scrollLeft),this._scrollTo(i)}_nativeScrollTo(t){this._originalScrollTo.bind(this._element||window)(t)}_scrollTo(t,e=null,i=null){this._end!==null&&this._end(),t.behavior==="smooth"?(this._setDestination(t),this._retarget=e,this._end=i):this._resetScrollState(),this._nativeScrollTo(t)}_setDestination(t){let{top:e,left:i}=t;return e=e===void 0?void 0:Math.max(0,Math.min(e,this.maxScrollTop)),i=i===void 0?void 0:Math.max(0,Math.min(i,this.maxScrollLeft)),(this._destination===null||i!==this._destination.left||e!==this._destination.top)&&(this.t={top:e,left:i,behavior:"smooth"},!0)}_resetScrollState(){this.t=null,this._retarget=null,this._end=null}_updateManagedScrollTo(t){this._destination&&this._setDestination(t)&&this._nativeScrollTo(this._destination)}managedScrollTo(t,e,i){return this._scrollTo(t,e,i),this._updateManagedScrollTo}correctScrollError(t){this.correctingScrollError=!0,requestAnimationFrame(()=>requestAnimationFrame(()=>this.correctingScrollError=!1)),this._nativeScrollTo(t),this._retarget&&this._setDestination(this._retarget()),this._destination&&this._nativeScrollTo(this._destination)}_checkForArrival(){if(this._destination!==null){const{scrollTop:t,scrollLeft:e}=this;let{top:i,left:s}=this._destination;i=Math.min(i||0,this.maxScrollTop),s=Math.min(s||0,this.maxScrollLeft);const r=Math.abs(i-t),o=Math.abs(s-e);r<1&&o<1&&(this._end&&this._end(),this._resetScrollState())}}detach(t){return this._clients.delete(t),this._clients.size===0&&(this._node.scrollTo=this._originalScrollTo,this._node.scrollBy=this._originalScrollBy,this._node.scroll=this._originalScroll,this._node.removeEventListener("scroll",this._checkForArrival)),null}_attach(t){this._clients.add(t),this._clients.size===1&&(this._node.scrollTo=this.scrollTo,this._node.scrollBy=this.scrollBy,this._node.scroll=this.scrollTo,this._node.addEventListener("scroll",this._checkForArrival))}}let L=typeof window<"u"?window.ResizeObserver:void 0;const E=Symbol("virtualizerRef"),v="virtualizer-sizer";let z;class W{constructor(t){if(this._benchmarkStart=null,this._layout=null,this._clippingAncestors=[],this._scrollSize=null,this._scrollError=null,this._childrenPos=null,this._childMeasurements=null,this._toBeMeasured=new Map,this._rangeChanged=!0,this._itemsChanged=!0,this._visibilityChanged=!0,this._scrollerController=null,this._isScroller=!1,this._sizer=null,this._hostElementRO=null,this._childrenRO=null,this._mutationObserver=null,this._scrollEventListeners=[],this._scrollEventListenerOptions={passive:!0},this._loadListener=this._childLoaded.bind(this),this._scrollIntoViewTarget=null,this._updateScrollIntoViewCoordinates=null,this._items=[],this._first=-1,this._last=-1,this._firstVisible=-1,this._lastVisible=-1,this._scheduled=new WeakSet,this._measureCallback=null,this._measureChildOverride=null,this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null,this._layoutInitialized=null,this._connected=!1,!t)throw new Error("Virtualizer constructor requires a configuration object");if(!t.hostElement)throw new Error('Virtualizer configuration requires the "hostElement" property');this._init(t)}set items(t){Array.isArray(t)&&t!==this._items&&(this._itemsChanged=!0,this._items=t,this._schedule(this._updateLayout))}_init(t){this._isScroller=!!t.scroller,this._initHostElement(t);const e=t.layout||{};this._layoutInitialized=this._initLayout(e)}_initObservers(){this._mutationObserver=new MutationObserver(this._finishDOMUpdate.bind(this)),this._hostElementRO=new L(()=>this._hostElementSizeChanged()),this._childrenRO=new L(this._childrenSizeChanged.bind(this))}_initHostElement(t){const e=this._hostElement=t.hostElement;this._applyVirtualizerStyles(),e[E]=this}connected(){this._initObservers();const t=this._isScroller;this._clippingAncestors=function(e,i=!1){let s=!1;return function(r,o=!1){const c=[];let a=o?r:x(r);for(;a!==null;)c.push(a),a=x(a);return c}(e,i).filter(r=>{if(s)return!1;const o=getComputedStyle(r);return s=o.position==="fixed",o.overflow!=="visible"})}(this._hostElement,t),this._scrollerController=new q(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen(),this._connected=!0}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach(t=>{t.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(t),this._hostElementRO.observe(t)}),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach(t=>this._childrenRO.observe(t)),this._scrollEventListeners.forEach(t=>t.addEventListener("scroll",this,this._scrollEventListenerOptions))}disconnected(){var t,e,i,s;this._scrollEventListeners.forEach(r=>r.removeEventListener("scroll",this,this._scrollEventListenerOptions)),this._scrollEventListeners=[],this._clippingAncestors=[],(t=this._scrollerController)==null||t.detach(this),this._scrollerController=null,(e=this._mutationObserver)==null||e.disconnect(),this._mutationObserver=null,(i=this._hostElementRO)==null||i.disconnect(),this._hostElementRO=null,(s=this._childrenRO)==null||s.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise("disconnected"),this._connected=!1}_applyVirtualizerStyles(){const t=this._hostElement.style;t.display=t.display||"block",t.position=t.position||"relative",t.contain=t.contain||"size layout",this._isScroller&&(t.overflow=t.overflow||"auto",t.minHeight=t.minHeight||"150px")}_getSizer(){const t=this._hostElement;if(!this._sizer){let e=t.querySelector(`[${v}]`);e||(e=document.createElement("div"),e.setAttribute(v,""),t.appendChild(e)),Object.assign(e.style,{position:"absolute",margin:"-2px 0 0 0",padding:0,visibility:"hidden",fontSize:"2px"}),e.textContent="&nbsp;",e.setAttribute(v,""),this._sizer=e}return this._sizer}async updateLayoutConfig(t){await this._layoutInitialized;const e=t.type||z;if(typeof e=="function"&&this._layout instanceof e){const i={...t};return delete i.type,this._layout.config=i,!0}return!1}async _initLayout(t){let e,i;if(typeof t.type=="function"){i=t.type;const s={...t};delete s.type,e=s}else e=t;i===void 0&&(z=i=(await Promise.resolve().then(()=>require("./flow-CnJl1T1A.cjs"))).FlowLayout),this._layout=new i(s=>this._handleLayoutMessage(s),e),this._layout.measureChildren&&typeof this._layout.updateItemSizes=="function"&&(typeof this._layout.measureChildren=="function"&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener("load",this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){this._benchmarkStart===null&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(this._benchmarkStart!==null){const t=window.performance.now(),e=t-this._benchmarkStart,i=performance.getEntriesByName("uv-virtualizing","measure").filter(s=>s.startTime>=this._benchmarkStart&&s.startTime<t).reduce((s,r)=>s+r.duration,0);return this._benchmarkStart=null,{timeElapsed:e,virtualizationTime:i}}return null}_measureChildren(){const t={},e=this._children,i=this._measureChildOverride||this._measureChild;for(let s=0;s<e.length;s++){const r=e[s],o=this._first+s;(this._itemsChanged||this._toBeMeasured.has(r))&&(t[o]=i.call(this,r,this._items[o]))}this._childMeasurements=t,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(t){const{width:e,height:i}=t.getBoundingClientRect();return Object.assign({width:e,height:i},function(s){const r=window.getComputedStyle(s);return{marginTop:b(r.marginTop),marginRight:b(r.marginRight),marginBottom:b(r.marginBottom),marginLeft:b(r.marginLeft)}}(t))}async _schedule(t){this._scheduled.has(t)||(this._scheduled.add(t),await Promise.resolve(),this._scheduled.delete(t),t.call(this))}async _updateDOM(t){this._scrollSize=t.scrollSize,this._adjustRange(t.range),this._childrenPos=t.childPositions,this._scrollError=t.scrollError||null;const{_rangeChanged:e,_itemsChanged:i}=this;this._visibilityChanged&&(this._notifyVisibility(),this._visibilityChanged=!1),(e||i)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._connected&&(this._children.forEach(t=>this._childrenRO.observe(t)),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_updateLayout(){this._layout&&this._connected&&(this._layout.items=this._items,this._updateView(),this._childMeasurements!==null&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_handleScrollEvent(){var t;if(this._benchmarkStart&&"mark"in window.performance){try{window.performance.measure("uv-virtualizing","uv-start","uv-end")}catch{}window.performance.mark("uv-start")}this._scrollerController.correctingScrollError===!1&&((t=this._layout)==null||t.unpin()),this._schedule(this._updateLayout)}handleEvent(t){t.type==="scroll"&&(t.currentTarget===window||this._clippingAncestors.includes(t.currentTarget))&&this._handleScrollEvent()}_handleLayoutMessage(t){t.type==="stateChanged"?this._updateDOM(t):t.type==="visibilityChanged"?(this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._notifyVisibility()):t.type==="unpinned"&&this._hostElement.dispatchEvent(new S)}get _children(){const t=[];let e=this._hostElement.firstElementChild;for(;e;)e.hasAttribute(v)||t.push(e),e=e.nextElementSibling;return t}_updateView(){var s;const t=this._hostElement,e=(s=this._scrollerController)==null?void 0:s.element,i=this._layout;if(t&&e&&i){let r,o,c,a;const n=t.getBoundingClientRect();r=0,o=0,c=window.innerHeight,a=window.innerWidth;const p=this._clippingAncestors.map(_=>_.getBoundingClientRect());p.unshift(n);for(const _ of p)r=Math.max(r,_.top),o=Math.max(o,_.left),c=Math.min(c,_.bottom),a=Math.min(a,_.right);const T=e.getBoundingClientRect(),R={left:n.left-T.left,top:n.top-T.top},M={width:e.scrollWidth,height:e.scrollHeight},I=r-n.top+t.scrollTop,$=o-n.left+t.scrollLeft,A=Math.max(0,c-r),F=Math.max(0,a-o);i.viewportSize={width:F,height:A},i.viewportScroll={top:I,left:$},i.totalScrollSize=M,i.offsetWithinScroller=R}}_sizeHostElement(t){const i=t&&t.width!==null?Math.min(82e5,t.width):0,s=t&&t.height!==null?Math.min(82e5,t.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${i}px, ${s}px)`;else{const r=this._hostElement.style;r.minWidth=i?`${i}px`:"100%",r.minHeight=s?`${s}px`:"100%"}}_positionChildren(t){t&&t.forEach(({top:e,left:i,width:s,height:r,xOffset:o,yOffset:c},a)=>{const n=this._children[a-this._first];n&&(n.style.position="absolute",n.style.boxSizing="border-box",n.style.transform=`translate(${i}px, ${e}px)`,s!==void 0&&(n.style.width=s+"px"),r!==void 0&&(n.style.height=r+"px"),n.style.left=o===void 0?null:o+"px",n.style.top=c===void 0?null:c+"px")})}async _adjustRange(t){const{_first:e,_last:i,_firstVisible:s,_lastVisible:r}=this;this._first=t.first,this._last=t.last,this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==e||this._last!==i,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==s||this._lastVisible!==r}_correctScrollError(){if(this._scrollError){const{scrollTop:t,scrollLeft:e}=this._scrollerController,{top:i,left:s}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:t-i,left:e-s})}}element(t){var e;return t===1/0&&(t=this._items.length-1),((e=this._items)==null?void 0:e[t])===void 0?void 0:{scrollIntoView:(i={})=>this._scrollElementIntoView({...i,index:t})}}_scrollElementIntoView(t){if(t.index>=this._first&&t.index<=this._last)this._children[t.index-this._first].scrollIntoView(t);else if(t.index=Math.min(t.index,this._items.length-1),t.behavior==="smooth"){const e=this._layout.getScrollIntoViewCoordinates(t),{behavior:i}=t;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(e,{behavior:i}),()=>this._layout.getScrollIntoViewCoordinates(t),()=>this._scrollIntoViewTarget=null),this._scrollIntoViewTarget=t}else this._layout.pin=t}_checkScrollIntoViewTarget(t){const{index:e}=this._scrollIntoViewTarget||{};e&&(t!=null&&t.has(e))&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new w({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new C({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||(this._layoutCompletePromise=new Promise((t,e)=>{this._layoutCompleteResolver=t,this._layoutCompleteRejecter=e})),this._layoutCompletePromise}_rejectLayoutCompletePromise(t){this._layoutCompleteRejecter!==null&&this._layoutCompleteRejecter(t),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&this._pendingLayoutComplete===null&&(this._pendingLayoutComplete=requestAnimationFrame(()=>requestAnimationFrame(()=>this._resolveLayoutCompletePromise())))}_resolveLayoutCompletePromise(){this._layoutCompleteResolver!==null&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(t){var e;if((e=this._layout)!=null&&e.measureChildren){for(const i of t)this._toBeMeasured.set(i.target,i.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}}function b(l){const t=l?parseFloat(l):NaN;return Number.isNaN(t)?0:t}function x(l){if(l.assignedSlot!==null)return l.assignedSlot;if(l.parentElement!==null)return l.parentElement;const t=l.parentNode;return t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host||null}const O=l=>l,V=(l,t)=>h.html`${t}: ${JSON.stringify(l,null,2)}`;class U extends N.AsyncDirective{constructor(t){if(super(t),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(e,i)=>V(e,i+this._first),this._keyFunction=(e,i)=>O(e,this._first),this._items=[],t.type!==k.PartType.CHILD)throw new Error("The virtualize directive can only be used in child expressions")}render(t){t&&this._setFunctions(t);const e=[];if(this._first>=0&&this._last>=this._first)for(let i=this._first;i<=this._last;i++)e.push(this._items[i]);return B.repeat(e,this._keyFunction,this._renderItem)}update(t,[e]){this._setFunctions(e);const i=this._items!==e.items;return this._items=e.items||[],this._virtualizer?this._updateVirtualizerConfig(t,e):this._initialize(t,e),i?h.noChange:this.render()}async _updateVirtualizerConfig(t,e){if(!await this._virtualizer.updateLayoutConfig(e.layout||{})){const i=t.parentNode;this._makeVirtualizer(i,e)}this._virtualizer.items=this._items}_setFunctions(t){const{renderItem:e,keyFunction:i}=t;e&&(this._renderItem=(s,r)=>e(s,r+this._first)),i&&(this._keyFunction=(s,r)=>i(s,r+this._first))}_makeVirtualizer(t,e){this._virtualizer&&this._virtualizer.disconnected();const{layout:i,scroller:s,items:r}=e;this._virtualizer=new W({hostElement:t,layout:i,scroller:s}),this._virtualizer.items=r,this._virtualizer.connected()}_initialize(t,e){const i=t.parentNode;i&&i.nodeType===1&&(i.addEventListener("rangeChanged",s=>{this._first=s.first,this._last=s.last,this.setValue(this.render())}),this._makeVirtualizer(i,e))}disconnected(){var t;(t=this._virtualizer)==null||t.disconnected()}reconnected(){var t;(t=this._virtualizer)==null||t.connected()}}const G=k.directive(U);class m extends h.LitElement{constructor(){super(...arguments),this.items=[],this.renderItem=V,this.keyFunction=O,this.layout={},this.scroller=!1}createRenderRoot(){return this}render(){const{items:t,renderItem:e,keyFunction:i,layout:s,scroller:r}=this;return h.html`${G({items:t,renderItem:e,keyFunction:i,layout:s,scroller:r})}`}element(t){var e;return(e=this[E])==null?void 0:e.element(t)}get layoutComplete(){var t;return(t=this[E])==null?void 0:t.layoutComplete}scrollToIndex(t,e="start"){var i;(i=this.element(t))==null||i.scrollIntoView({block:e})}}y.i([g.property({attribute:!1})],m.prototype,"items",void 0),y.i([g.property()],m.prototype,"renderItem",void 0),y.i([g.property()],m.prototype,"keyFunction",void 0),y.i([g.property({attribute:!1})],m.prototype,"layout",void 0),y.i([g.property({reflect:!0,type:Boolean})],m.prototype,"scroller",void 0),customElements.define("lit-virtualizer",m);var J=Object.defineProperty,X=Object.getOwnPropertyDescriptor,d=(l,t,e,i)=>{for(var s,r=i>1?void 0:i?X(t,e):t,o=l.length-1;o>=0;o--)(s=l[o])&&(r=(i?s(t,e,r):s(r))||r);return i&&r&&J(t,e,r),r};exports.SchmancyDataTable=class extends D.$LitElement(){constructor(){super(),this.columns=[],this.data=[],this.keyField="id",this.cols="1fr",this.sortable=!1,this.sortColumn=null,this.sortDirection=null,this.filteredData=[],this.filteredData=this.data}willUpdate(l){(l.has("data")||l.has("sortColumn")||l.has("sortDirection"))&&this.processData()}isDate(l){return l&&typeof l=="object"&&Object.prototype.toString.call(l)==="[object Date]"}processData(){let l=[...this.data];this.sortable&&this.sortColumn&&this.sortDirection&&l.sort((t,e)=>{const i=t[this.sortColumn],s=e[this.sortColumn];if(i==null)return this.sortDirection==="asc"?1:-1;if(s==null)return this.sortDirection==="asc"?-1:1;if(typeof i=="number"&&typeof s=="number")return this.sortDirection==="asc"?i-s:s-i;const r=typeof i=="string"&&!isNaN(Number(i)),o=typeof s=="string"&&!isNaN(Number(s));if(r&&o){const n=parseFloat(i),p=parseFloat(s);return this.sortDirection==="asc"?n-p:p-n}if(this.isDate(i)&&this.isDate(s))return this.sortDirection==="asc"?i.getTime()-s.getTime():s.getTime()-i.getTime();const c=String(i),a=String(s);return this.sortDirection==="asc"?c.localeCompare(a):a.localeCompare(c)}),this.filteredData=l}toggleSort(l){if(!l.key||l.sortable===!1)return;const t=l.key;t===this.sortColumn?this.sortDirection==="asc"?this.sortDirection="desc":this.sortDirection==="desc"?this.sortDirection=null:this.sortDirection="asc":(this.sortColumn=t,this.sortDirection="asc"),this.dispatchEvent(new CustomEvent("sort-change",{detail:{column:this.sortColumn,direction:this.sortDirection},bubbles:!0,composed:!0}))}renderSortIndicator(l){return this.sortable&&l.sortable!==!1&&l.key&&l.key===this.sortColumn?h.html`
20
20
  <span class="ml-1">
21
- ${this.sortDirection==="asc"?n.html`<schmancy-icon size="16px">arrow_upward</schmancy-icon>`:this.sortDirection==="desc"?n.html`<schmancy-icon size="16px">arrow_downward</schmancy-icon>`:null}
21
+ ${this.sortDirection==="asc"?h.html`<schmancy-icon size="16px">arrow_upward</schmancy-icon>`:this.sortDirection==="desc"?h.html`<schmancy-icon size="16px">arrow_downward</schmancy-icon>`:null}
22
22
  </span>
23
- `:null}render(){const l=t=>({"flex items-center":!0,"cursor-pointer gap-1":this.sortable&&t.sortable!==!1&&t.key});return n.html`
23
+ `:null}render(){const l=t=>({"flex items-center":!0,"cursor-pointer gap-1":this.sortable&&t.sortable!==!1&&t.key});return h.html`
24
24
  <schmancy-surface fill="all" type="container" rounded="all" elevation="2">
25
25
  <schmancy-grid class="h-full w-full" cols="1fr" rows="auto 1fr">
26
26
  <schmancy-surface rounded="top" elevation="1" type="containerHighest" class="sticky top-0 z-10">
27
27
  <schmancy-grid align="center" class="px-4 py-3" .cols=${this.cols} gap="md" rows="1fr">
28
- ${this.columns.map(t=>n.html`
28
+ ${this.columns.map(t=>h.html`
29
29
  <div
30
30
  class=${this.classMap(l(t))}
31
31
  @click=${()=>this.sortable&&t.sortable!==!1?this.toggleSort(t):null}
@@ -39,12 +39,12 @@
39
39
  </schmancy-grid>
40
40
  </schmancy-surface>
41
41
 
42
- ${this.filteredData.length>0?n.html`
42
+ ${this.filteredData.length>0?h.html`
43
43
  <lit-virtualizer
44
44
  scroller
45
45
  class="w-full h-full relative overflow-auto"
46
46
  .items=${this.filteredData}
47
- .renderItem=${(t,e)=>n.html`
47
+ .renderItem=${(t,e)=>h.html`
48
48
  <schmancy-table-row
49
49
  class="w-full border-b border-solid border-outlineVariant"
50
50
  .columns=${this.columns}
@@ -54,12 +54,12 @@
54
54
  ></schmancy-table-row>
55
55
  `}
56
56
  ></lit-virtualizer>
57
- `:n.html`
57
+ `:h.html`
58
58
  <div class="flex items-center justify-center w-full h-full p-8 text-center">
59
59
  <schmancy-typography type="body" token="lg"> No data available </schmancy-typography>
60
60
  </div>
61
61
  `}
62
62
  </schmancy-grid>
63
63
  </schmancy-surface>
64
- `}},d([a.property({type:Array,attribute:!1})],exports.SchmancyDataTable.prototype,"columns",2),d([a.property({type:Array,attribute:!1})],exports.SchmancyDataTable.prototype,"data",2),d([a.property({type:String})],exports.SchmancyDataTable.prototype,"keyField",2),d([a.property({type:String})],exports.SchmancyDataTable.prototype,"cols",2),d([a.property({type:Boolean})],exports.SchmancyDataTable.prototype,"sortable",2),d([a.state()],exports.SchmancyDataTable.prototype,"sortColumn",2),d([a.state()],exports.SchmancyDataTable.prototype,"sortDirection",2),d([a.state()],exports.SchmancyDataTable.prototype,"filteredData",2),exports.SchmancyDataTable=d([a.customElement("schmancy-table")],exports.SchmancyDataTable);
65
- //# sourceMappingURL=table-Cfe1Zloe.cjs.map
64
+ `}},d([u.property({type:Array,attribute:!1})],exports.SchmancyDataTable.prototype,"columns",2),d([u.property({type:Array,attribute:!1})],exports.SchmancyDataTable.prototype,"data",2),d([u.property({type:String})],exports.SchmancyDataTable.prototype,"keyField",2),d([u.property({type:String})],exports.SchmancyDataTable.prototype,"cols",2),d([u.property({type:Boolean})],exports.SchmancyDataTable.prototype,"sortable",2),d([u.state()],exports.SchmancyDataTable.prototype,"sortColumn",2),d([u.state()],exports.SchmancyDataTable.prototype,"sortDirection",2),d([u.state()],exports.SchmancyDataTable.prototype,"filteredData",2),exports.SchmancyDataTable=d([u.customElement("schmancy-table")],exports.SchmancyDataTable);
65
+ //# sourceMappingURL=table-BA5yn5_q.cjs.map