@mhmo91/schmancy 0.4.48 → 0.4.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai/dialog.md +6 -3
- package/dist/ai/dialog.md +6 -3
- package/dist/autocomplete-CkycjWy4.js +267 -0
- package/dist/autocomplete-CkycjWy4.js.map +1 -0
- package/dist/autocomplete-CrhgxhFI.cjs +73 -0
- package/dist/autocomplete-CrhgxhFI.cjs.map +1 -0
- package/dist/autocomplete.cjs +1 -1
- package/dist/autocomplete.js +1 -1
- package/dist/{avatar-DBcrNPzz.js → avatar-2RMudsVg.js} +7 -7
- package/dist/{avatar-DBcrNPzz.js.map → avatar-2RMudsVg.js.map} +1 -1
- package/dist/{avatar-CagKP9HD.cjs → avatar-nwqyt3uc.cjs} +2 -2
- package/dist/{avatar-CagKP9HD.cjs.map → avatar-nwqyt3uc.cjs.map} +1 -1
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- package/dist/content-drawer.cjs +1 -1
- package/dist/content-drawer.js +1 -1
- package/dist/{date-range-DPZXGoEA.js → date-range-8o_f5N7V.js} +2 -2
- package/dist/{date-range-DPZXGoEA.js.map → date-range-8o_f5N7V.js.map} +1 -1
- package/dist/{date-range-Cf9ldt-N.cjs → date-range-9NUFmKqd.cjs} +2 -2
- package/dist/{date-range-Cf9ldt-N.cjs.map → date-range-9NUFmKqd.cjs.map} +1 -1
- package/dist/date-range.cjs +1 -1
- package/dist/date-range.js +1 -1
- package/dist/{dialog-content-CT6Y3ZLb.js → dialog-content-C_paCOeM.js} +2 -2
- package/dist/{dialog-content-CT6Y3ZLb.js.map → dialog-content-C_paCOeM.js.map} +1 -1
- package/dist/{dialog-content-tiwbeegi.cjs → dialog-content-tGl9B67L.cjs} +2 -2
- package/dist/{dialog-content-tiwbeegi.cjs.map → dialog-content-tGl9B67L.cjs.map} +1 -1
- package/dist/{dialog-service-Dm7HJGjx.js → dialog-service-DZv4KB89.js} +5 -2
- package/dist/{dialog-service-Dm7HJGjx.js.map → dialog-service-DZv4KB89.js.map} +1 -1
- package/dist/{dialog-service-DUDhcx9X.cjs → dialog-service-JNWTLfAy.cjs} +2 -2
- package/dist/{dialog-service-DUDhcx9X.cjs.map → dialog-service-JNWTLfAy.cjs.map} +1 -1
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +16 -14
- package/dist/index.js.map +1 -1
- package/dist/nav-drawer.cjs +1 -1
- package/dist/nav-drawer.js +1 -1
- package/dist/search-6Hr7K1gh.js +53 -0
- package/dist/search-6Hr7K1gh.js.map +1 -0
- package/dist/search-DWW8IoOp.cjs +2 -0
- package/dist/search-DWW8IoOp.cjs.map +1 -0
- package/dist/{tabs-compatibility-DsOH4PSw.js → tabs-compatibility-BEXurIiZ.js} +6 -6
- package/dist/{tabs-compatibility-DsOH4PSw.js.map → tabs-compatibility-BEXurIiZ.js.map} +1 -1
- package/dist/tabs.js +1 -1
- package/dist/teleport.cjs +1 -1
- package/dist/teleport.js +1 -1
- package/dist/{typewriter-CnloNIdN.js → typewriter-DMKxup-I.js} +6 -6
- package/dist/{typewriter-CnloNIdN.js.map → typewriter-DMKxup-I.js.map} +1 -1
- package/dist/{typewriter-DwLZUKKQ.cjs → typewriter-Fq4uV6Gm.cjs} +2 -2
- package/dist/{typewriter-DwLZUKKQ.cjs.map → typewriter-Fq4uV6Gm.cjs.map} +1 -1
- package/dist/typewriter.cjs +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +3 -1
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/types/src/dialog/dialog-service.d.ts +10 -0
- package/types/src/index.d.ts +0 -1
- package/types/src/utils/index.d.ts +1 -0
- package/dist/autocomplete-CHObbMzK.js +0 -315
- package/dist/autocomplete-CHObbMzK.js.map +0 -1
- package/dist/autocomplete-PHnzqAII.cjs +0 -73
- package/dist/autocomplete-PHnzqAII.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-service-Dm7HJGjx.js","sources":["../src/dialog/dialog-events.ts","../src/dialog/dialog-service.ts"],"sourcesContent":["// Dialog discovery event constants\r\nexport const DialogWhereAreYouRicky = 'are-you-there-dialog'\r\nexport const DialogHereMorty = 'yes-dialog-here'\r\n\r\n// Event interfaces\r\nexport interface DialogWhereAreYouRickyEvent extends CustomEvent {\r\n detail: {\r\n uid: string\r\n }\r\n}\r\n\r\nexport interface DialogHereMortyEvent extends CustomEvent {\r\n detail: {\r\n dialog: any // Will be schmancy-dialog instance\r\n theme?: any // Will be schmancy-theme instance\r\n }\r\n}","import { render, TemplateResult } from 'lit'\nimport { defaultIfEmpty, forkJoin, fromEvent, map, of, Subject, switchMap, takeUntil, tap, timer, take } from 'rxjs'\nimport { ConfirmDialog } from './dailog'\nimport { DialogHereMorty, DialogHereMortyEvent, DialogWhereAreYouRicky } from './dialog-events'\nimport { ThemeWhereAreYou, ThemeHereIAm, ThemeHereIAmEvent } from '../theme/theme.component'\n\n/**\n * Dialog service options interface with component support\n */\nexport interface DialogOptions {\n\ttitle?: string\n\tsubtitle?: string\n\tmessage?: string\n\tconfirmText?: string\n\tcancelText?: string\n\tvariant?: 'default' | 'danger'\n\tconfirmColor?: 'primary' | 'error' | 'warning' | 'success' // Button color for confirm action\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\thideActions?: boolean // Set to true to hide all buttons and title\n\ttargetContainer?: HTMLElement // Container to append dialog to (defaults to document.body)\n}\n\ninterface DialogTarget {\n\toptions: DialogOptions\n\ttype: 'confirm' | 'component'\n\tcontent?: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult)\n\tresolve?: (value: boolean) => void\n\treject?: (reason?: any) => 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\tsubtitle: undefined,\n\t\tconfirmText: undefined,\n\t\tcancelText: undefined,\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\t\n\t// Track component dialogs (schmancy-dialog instances)\n\tprivate activeRawDialogs: any[] = []\n\t\n\t// Subject for dialog opening requests\n\tprivate dialogSubject = new Subject<DialogTarget>()\n\t\n\t// Subject for dialog dismissal requests\n\tprivate dismissSubject = new Subject<string>()\n\n\t// Private constructor for singleton pattern\n\tprivate constructor() {\n\t\tthis.setupDialogOpeningLogic()\n\t\tthis.setupDialogDismissLogic()\n\t}\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\t\n\t/**\n\t * Sets up the main dialog opening logic using RxJS pipes\n\t */\n\tprivate setupDialogOpeningLogic() {\n\t\tthis.dialogSubject\n\t\t\t.pipe(\n\t\t\t\tswitchMap(target =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<DialogHereMortyEvent>(window, DialogHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\tmap(e => e.detail),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(target).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\tconst uid = target.type === 'confirm' \n\t\t\t\t\t\t\t\t\t? `confirm-dialog-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`\n\t\t\t\t\t\t\t\t\t: `dialog-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(DialogWhereAreYouRicky, {\n\t\t\t\t\t\t\t\t\t\tdetail: { uid },\n\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// Store uid in target for later use\n\t\t\t\t\t\t\t\t;(target as any).uid = uid\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\tswitchMap(([response, target]) => {\n\t\t\t\t\tlet dialog: ConfirmDialog | any\n\t\t\t\t\tlet targetContainer: HTMLElement\n\t\t\t\t\t\n\t\t\t\t\tif (response?.dialog) {\n\t\t\t\t\t\t// Use existing dialog\n\t\t\t\t\t\tdialog = response.dialog\n\t\t\t\t\t\ttargetContainer = dialog.parentElement as HTMLElement\n\t\t\t\t\t\treturn of({ dialog, target, targetContainer })\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Determine container - use responding theme or fallback\n\t\t\t\t\t\tif (response?.theme) {\n\t\t\t\t\t\t\ttargetContainer = response.theme as HTMLElement\n\t\t\t\t\t\t\treturn of({ dialog: null, target, targetContainer })\n\t\t\t\t\t\t} else if (target.options.targetContainer) {\n\t\t\t\t\t\t\ttargetContainer = target.options.targetContainer\n\t\t\t\t\t\t\treturn of({ dialog: null, target, targetContainer })\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Use the same theme discovery pattern as sheet service\n\t\t\t\t\t\t\twindow.dispatchEvent(new CustomEvent(ThemeWhereAreYou))\n\t\t\t\t\t\t\treturn fromEvent<ThemeHereIAmEvent>(window, ThemeHereIAm).pipe(\n\t\t\t\t\t\t\t\ttake(1),\n\t\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\t\tmap(e => e.detail.theme),\n\t\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t\t\tmap(theme => ({\n\t\t\t\t\t\t\t\t\tdialog: null,\n\t\t\t\t\t\t\t\t\ttarget,\n\t\t\t\t\t\t\t\t\ttargetContainer: theme || document.body\n\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttap(({ dialog, target, targetContainer }) => {\n\t\t\t\t\tif (!dialog) {\n\t\t\t\t\t\t// Create appropriate dialog type\n\t\t\t\t\t\tif (target.type === 'confirm') {\n\t\t\t\t\t\t\tdialog = document.createElement('confirm-dialog') as ConfirmDialog\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdialog = document.createElement('schmancy-dialog')\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tdialog.setAttribute('uid', (target as any).uid)\n\t\t\t\t\t\ttargetContainer.appendChild(dialog)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tmap(({ dialog, target, targetContainer }) => {\n\t\t\t\t\t// Return the actual dialog element that was created\n\t\t\t\t\tif (!dialog) {\n\t\t\t\t\t\tdialog = targetContainer.querySelector(`[uid=\"${(target as any).uid}\"]`)\n\t\t\t\t\t}\n\t\t\t\t\treturn { dialog, target, targetContainer }\n\t\t\t\t}),\n\t\t\t\ttap(({ dialog, target }) => {\n\t\t\t\t\tif (target.type === 'confirm') {\n\t\t\t\t\t\t// Configure confirm dialog\n\t\t\t\t\t\tconst confirmDialog = dialog as ConfirmDialog\n\t\t\t\t\t\tconst options = target.options\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (options.title) confirmDialog.title = options.title\n\t\t\t\t\t\tif (options.subtitle) confirmDialog.subtitle = options.subtitle\n\t\t\t\t\t\tif (options.message) confirmDialog.message = options.message\n\t\t\t\t\t\tif (options.confirmText) confirmDialog.confirmText = options.confirmText\n\t\t\t\t\t\tif (options.cancelText) confirmDialog.cancelText = options.cancelText\n\t\t\t\t\t\tif (options.variant) confirmDialog.variant = options.variant\n\t\t\t\t\t\tif (options.confirmColor) confirmDialog.confirmColor = options.confirmColor\n\t\t\t\t\t\tif (options.width) confirmDialog.style.setProperty('--dialog-width', options.width)\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Handle custom content if provided\n\t\t\t\t\t\tif (options.content) {\n\t\t\t\t\t\t\tconst contentContainer = document.createElement('div')\n\t\t\t\t\t\t\tcontentContainer.slot = 'content'\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (typeof options.content === 'function') {\n\t\t\t\t\t\t\t\tconst result = options.content()\n\t\t\t\t\t\t\t\tif (result instanceof HTMLElement) {\n\t\t\t\t\t\t\t\t\tcontentContainer.appendChild(result)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\trender(result, contentContainer)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (options.content instanceof HTMLElement) {\n\t\t\t\t\t\t\t\tcontentContainer.appendChild(options.content)\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\trender(options.content, contentContainer)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tconfirmDialog.appendChild(contentContainer)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add to active dialogs\n\t\t\t\t\t\tthis.activeDialogs.push(confirmDialog)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Configure component dialog\n\t\t\t\t\t\tif (target.content) {\n\t\t\t\t\t\t\tconst directContentContainer = document.createElement('div')\n\t\t\t\t\t\t\tdirectContentContainer.style.height = '100%'\n\t\t\t\t\t\t\tdirectContentContainer.style.width = '100%'\n\t\t\t\t\t\t\tdirectContentContainer.classList.add('schmancy-dialog-content-container')\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Render the content directly\n\t\t\t\t\t\t\tif (typeof target.content === 'function') {\n\t\t\t\t\t\t\t\tconst result = target.content()\n\t\t\t\t\t\t\t\tif (result instanceof HTMLElement) {\n\t\t\t\t\t\t\t\t\tdirectContentContainer.appendChild(result)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\trender(result, directContentContainer)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (target.content instanceof HTMLElement) {\n\t\t\t\t\t\t\t\tdirectContentContainer.appendChild(target.content)\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\trender(target.content, directContentContainer)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdialog.appendChild(directContentContainer)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Set width from options\n\t\t\t\t\t\tif (target.options.width) {\n\t\t\t\t\t\t\tdialog.style.setProperty('--dialog-width', target.options.width)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add to active raw dialogs\n\t\t\t\t\t\tthis.activeRawDialogs.push(dialog)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttap(({ dialog, target }) => {\n\t\t\t\t\t// Show dialog and handle promise resolution\n\t\t\t\t\tconst position = target.options.position || this.getCenteredPosition()\n\t\t\t\t\t\n\t\t\t\t\tdialog.show(position).then((result: boolean) => {\n\t\t\t\t\t\tif (target.resolve) {\n\t\t\t\t\t\t\ttarget.resolve(result)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Cleanup\n\t\t\t\t\t\tif (target.type === 'confirm') {\n\t\t\t\t\t\t\tconst index = this.activeDialogs.indexOf(dialog)\n\t\t\t\t\t\t\tif (index !== -1) {\n\t\t\t\t\t\t\t\tthis.activeDialogs.splice(index, 1)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Clean up content\n\t\t\t\t\t\t\tconst contentEl = dialog.querySelector('[slot=\"content\"]')\n\t\t\t\t\t\t\tif (contentEl) {\n\t\t\t\t\t\t\t\tdialog.removeChild(contentEl)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst index = this.activeRawDialogs.indexOf(dialog)\n\t\t\t\t\t\t\tif (index !== -1) {\n\t\t\t\t\t\t\t\tthis.activeRawDialogs.splice(index, 1)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Clean up content\n\t\t\t\t\t\t\tconst contentContainer = dialog.querySelector('.schmancy-dialog-content-container')\n\t\t\t\t\t\t\tif (contentContainer && contentContainer.parentNode) {\n\t\t\t\t\t\t\t\tcontentContainer.parentNode.removeChild(contentContainer)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove dialog from DOM\n\t\t\t\t\t\tif (dialog.parentElement) {\n\t\t\t\t\t\t\tdialog.parentElement.removeChild(dialog)\n\t\t\t\t\t\t}\n\t\t\t\t\t}).catch((error: any) => {\n\t\t\t\t\t\tif (target.reject) {\n\t\t\t\t\t\t\ttarget.reject(error)\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t\n\t\t\t\t\t// Set up event listeners for callbacks\n\t\t\t\t\tif (target.options.onConfirm) {\n\t\t\t\t\t\tconst onConfirm = (_e: Event) => {\n\t\t\t\t\t\t\ttarget.options.onConfirm!()\n\t\t\t\t\t\t\tdialog.removeEventListener('confirm', onConfirm)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdialog.addEventListener('confirm', onConfirm)\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (target.options.onCancel) {\n\t\t\t\t\t\tconst onCancel = (_e: Event) => {\n\t\t\t\t\t\t\ttarget.options.onCancel!()\n\t\t\t\t\t\t\tdialog.removeEventListener('cancel', onCancel)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdialog.addEventListener('cancel', onCancel)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\t\n\t/**\n\t * Sets up the dialog dismissal logic\n\t */\n\tprivate setupDialogDismissLogic() {\n\t\tthis.dismissSubject\n\t\t\t.pipe(\n\t\t\t\tswitchMap(uid =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<DialogHereMortyEvent>(window, DialogHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\tmap(e => e.detail),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(uid).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(DialogWhereAreYouRicky, { \n\t\t\t\t\t\t\t\t\t\tdetail: { uid },\n\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\ttap(([response]) => {\n\t\t\t\t\tif (response?.dialog) {\n\t\t\t\t\t\t// Hide the dialog\n\t\t\t\t\t\tresponse.dialog.hide(false)\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove from tracking arrays\n\t\t\t\t\t\tconst confirmIndex = this.activeDialogs.indexOf(response.dialog)\n\t\t\t\t\t\tif (confirmIndex !== -1) {\n\t\t\t\t\t\t\tthis.activeDialogs.splice(confirmIndex, 1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tconst rawIndex = this.activeRawDialogs.indexOf(response.dialog)\n\t\t\t\t\t\tif (rawIndex !== -1) {\n\t\t\t\t\t\t\tthis.activeRawDialogs.splice(rawIndex, 1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove dialog from DOM immediately\n\t\t\t\t\t\tif (response.dialog.parentElement) {\n\t\t\t\t\t\t\tresponse.dialog.parentElement.removeChild(response.dialog)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\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\treturn new Promise((resolve, reject) => {\n\t\t\t// Apply default options\n\t\t\tconst completeOptions = {\n\t\t\t\t...DialogService.DEFAULT_OPTIONS,\n\t\t\t\t...options,\n\t\t\t}\n\n\t\t\t// If no position is provided, center the dialog\n\t\t\tif (!completeOptions.position) {\n\t\t\t\tcompleteOptions.position = this.getCenteredPosition()\n\t\t\t}\n\n\t\t\t// Create dialog target and emit to subject\n\t\t\tconst target: DialogTarget = {\n\t\t\t\toptions: completeOptions,\n\t\t\t\ttype: 'confirm',\n\t\t\t\tcontent: completeOptions.content,\n\t\t\t\tresolve,\n\t\t\t\treject,\n\t\t\t}\n\n\t\t\tthis.dialogSubject.next(target)\n\t\t})\n\t}\n\n\t/**\n\t * Show a dialog with custom component content\n\t * Always renders content directly without any headers or action buttons\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tpublic component(\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions: Omit<DialogOptions, 'content' | 'message'> = {},\n\t): Promise<boolean> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\t// If no position is provided, center the dialog\n\t\t\tif (!options.position) {\n\t\t\t\toptions.position = this.getCenteredPosition()\n\t\t\t}\n\n\t\t\t// Create dialog target and emit to subject\n\t\t\tconst target: DialogTarget = {\n\t\t\t\toptions: options as DialogOptions,\n\t\t\t\ttype: 'component',\n\t\t\t\tcontent,\n\t\t\t\tresolve,\n\t\t\t\treject,\n\t\t\t}\n\n\t\t\tthis.dialogSubject.next(target)\n\t\t})\n\t}\n\n\t/**\n\t * Dismiss the most recently opened dialog (either confirm or component type)\n\t * @returns true if a dialog was dismissed, false if no dialogs were open\n\t */\n\tpublic dismiss(): boolean {\n\t\t// Try component dialog first (they're more likely to be on top)\n\t\tif (this.activeRawDialogs.length > 0) {\n\t\t\t// Get the most recently opened raw dialog (last in the array)\n\t\t\tconst dialog = this.activeRawDialogs[this.activeRawDialogs.length - 1]\n\t\t\tconst uid = dialog.getAttribute('uid')\n\t\t\t\n\t\t\tif (uid) {\n\t\t\t\tthis.dismissSubject.next(uid)\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Fall back to confirm dialogs\n\t\tif (this.activeDialogs.length > 0) {\n\t\t\t// Get the most recently opened dialog (last in the array)\n\t\t\tconst dialog = this.activeDialogs[this.activeDialogs.length - 1]\n\t\t\tconst uid = dialog.getAttribute('uid')\n\t\t\t\n\t\t\tif (uid) {\n\t\t\t\tthis.dismissSubject.next(uid)\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\n\t\treturn false\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,\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 * 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/**\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 when dialog is closed\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 * Show a simple dialog without title or actions, just content\n\t * This is an alias for component() since all component dialogs are now simple by design\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tsimple: (\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions?: Omit<DialogOptions, 'content' | 'message' | 'title' | 'confirmText' | 'cancelText'>,\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"],"names":["DialogWhereAreYouRicky","DialogHereMorty","DialogService","constructor","this","activeDialogs","activeRawDialogs","dialogSubject","Subject","dismissSubject","setupDialogOpeningLogic","setupDialogDismissLogic","getInstance","instance","pipe","switchMap","forkJoin","fromEvent","window","takeUntil","timer","map","e","detail","defaultIfEmpty","of","target","tap","uid","type","Date","now","Math","random","toString","substring","dispatchEvent","CustomEvent","bubbles","composed","response","dialog","targetContainer","parentElement","theme","options","ThemeWhereAreYou","ThemeHereIAm","take","document","body","createElement","setAttribute","appendChild","querySelector","confirmDialog","title","subtitle","message","confirmText","cancelText","variant","confirmColor","width","style","setProperty","content","contentContainer","slot","result","HTMLElement","render","push","directContentContainer","height","classList","add","position","getCenteredPosition","show","then","resolve","index","indexOf","splice","contentEl","removeChild","parentNode","catch","error","reject","onConfirm","_e","removeEventListener","addEventListener","onCancel","subscribe","hide","confirmIndex","rawIndex","Promise","completeOptions","DEFAULT_OPTIONS","next","dismiss","length","getAttribute","event","confirm","x","innerWidth","y","innerHeight","_w","$dialog","ask","danger","component","simple"],"mappings":";;;AACO,MAAMA,IAAyB,wBACzBC,IAAkB,mBCsClBC,IAAN,MAAMA,EAAAA;AAAAA,EA0BJ,cAAAC;AAZRC,SAAQC,gBAAiC,CAAA,GAGzCD,KAAQE,mBAA0B,CAAA,GAGlCF,KAAQG,gBAAgB,IAAIC,KAG5BJ,KAAQK,iBAAiB,IAAID,KAI5BJ,KAAKM,wBAAAA,GACLN,KAAKO,wBAAAA;AAAAA,EACN;AAAA,EAKA,OAAA,cAAcC;AAIb,WAHKV,EAAcW,aAClBX,EAAcW,WAAW,IAAIX,MAEvBA,EAAcW;AAAAA,EACtB;AAAA,EAKQ,0BAAAH;AACPN,SAAKG,cACHO,KACAC,SACCC,EAAS,CACRC,EAAgCC,QAAQjB,CAAAA,EAAiBa,KACxDK,EAAUC,EAAM,GAAA,CAAA,GAChBC,EAAIC,CAAAA,MAAKA,EAAEC,MAAAA,GACXC,EAAAA,UAEDC,EAAGC,CAAAA,EAAQZ,KACVa,EAAI,MAAA;AACH,YAAMC,IAAMF,EAAOG,SAAS,YACzB,kBAAkBC,KAAKC,IAAAA,CAAAA,IA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ASrB,CAAAA,GAQvDyE,QAAQ,CACPpD,GACArB,MAEO3C,EAAcU,YAAAA,EAAcyG,UAAUnD,GAASrB,CAAAA,GAOvD2D,SAAS,MACDtG,EAAcU,YAAAA,EAAc4F,QAAAA,EAAAA;"}
|
|
1
|
+
{"version":3,"file":"dialog-service-DZv4KB89.js","sources":["../src/dialog/dialog-events.ts","../src/dialog/dialog-service.ts"],"sourcesContent":["// Dialog discovery event constants\r\nexport const DialogWhereAreYouRicky = 'are-you-there-dialog'\r\nexport const DialogHereMorty = 'yes-dialog-here'\r\n\r\n// Event interfaces\r\nexport interface DialogWhereAreYouRickyEvent extends CustomEvent {\r\n detail: {\r\n uid: string\r\n }\r\n}\r\n\r\nexport interface DialogHereMortyEvent extends CustomEvent {\r\n detail: {\r\n dialog: any // Will be schmancy-dialog instance\r\n theme?: any // Will be schmancy-theme instance\r\n }\r\n}","import { render, TemplateResult } from 'lit'\nimport { defaultIfEmpty, forkJoin, fromEvent, map, of, Subject, switchMap, takeUntil, tap, timer, take } from 'rxjs'\nimport { ConfirmDialog } from './dailog'\nimport { DialogHereMorty, DialogHereMortyEvent, DialogWhereAreYouRicky } from './dialog-events'\nimport { ThemeWhereAreYou, ThemeHereIAm, ThemeHereIAmEvent } from '../theme/theme.component'\n\n/**\n * Dialog service options interface with component support\n */\nexport interface DialogOptions {\n\ttitle?: string\n\tsubtitle?: string\n\tmessage?: string\n\tconfirmText?: string\n\tcancelText?: string\n\tvariant?: 'default' | 'danger'\n\tconfirmColor?: 'primary' | 'error' | 'warning' | 'success' // Button color for confirm action\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\thideActions?: boolean // Set to true to hide all buttons and title\n\ttargetContainer?: HTMLElement // Container to append dialog to (defaults to document.body)\n}\n\ninterface DialogTarget {\n\toptions: DialogOptions\n\ttype: 'confirm' | 'component'\n\tcontent?: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult)\n\tresolve?: (value: boolean) => void\n\treject?: (reason?: any) => 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\tsubtitle: undefined,\n\t\tconfirmText: undefined,\n\t\tcancelText: undefined,\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\t\n\t// Track component dialogs (schmancy-dialog instances)\n\tprivate activeRawDialogs: any[] = []\n\t\n\t// Subject for dialog opening requests\n\tprivate dialogSubject = new Subject<DialogTarget>()\n\t\n\t// Subject for dialog dismissal requests\n\tprivate dismissSubject = new Subject<string>()\n\n\t// Private constructor for singleton pattern\n\tprivate constructor() {\n\t\tthis.setupDialogOpeningLogic()\n\t\tthis.setupDialogDismissLogic()\n\t}\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\t\n\t/**\n\t * Sets up the main dialog opening logic using RxJS pipes\n\t */\n\tprivate setupDialogOpeningLogic() {\n\t\tthis.dialogSubject\n\t\t\t.pipe(\n\t\t\t\tswitchMap(target =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<DialogHereMortyEvent>(window, DialogHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\tmap(e => e.detail),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(target).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\tconst uid = target.type === 'confirm' \n\t\t\t\t\t\t\t\t\t? `confirm-dialog-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`\n\t\t\t\t\t\t\t\t\t: `dialog-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(DialogWhereAreYouRicky, {\n\t\t\t\t\t\t\t\t\t\tdetail: { uid },\n\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// Store uid in target for later use\n\t\t\t\t\t\t\t\t;(target as any).uid = uid\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\tswitchMap(([response, target]) => {\n\t\t\t\t\tlet dialog: ConfirmDialog | any\n\t\t\t\t\tlet targetContainer: HTMLElement\n\t\t\t\t\t\n\t\t\t\t\tif (response?.dialog) {\n\t\t\t\t\t\t// Use existing dialog\n\t\t\t\t\t\tdialog = response.dialog\n\t\t\t\t\t\ttargetContainer = dialog.parentElement as HTMLElement\n\t\t\t\t\t\treturn of({ dialog, target, targetContainer })\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Determine container - use responding theme or fallback\n\t\t\t\t\t\tif (response?.theme) {\n\t\t\t\t\t\t\ttargetContainer = response.theme as HTMLElement\n\t\t\t\t\t\t\treturn of({ dialog: null, target, targetContainer })\n\t\t\t\t\t\t} else if (target.options.targetContainer) {\n\t\t\t\t\t\t\ttargetContainer = target.options.targetContainer\n\t\t\t\t\t\t\treturn of({ dialog: null, target, targetContainer })\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Use the same theme discovery pattern as sheet service\n\t\t\t\t\t\t\twindow.dispatchEvent(new CustomEvent(ThemeWhereAreYou))\n\t\t\t\t\t\t\treturn fromEvent<ThemeHereIAmEvent>(window, ThemeHereIAm).pipe(\n\t\t\t\t\t\t\t\ttake(1),\n\t\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\t\tmap(e => e.detail.theme),\n\t\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t\t\tmap(theme => ({\n\t\t\t\t\t\t\t\t\tdialog: null,\n\t\t\t\t\t\t\t\t\ttarget,\n\t\t\t\t\t\t\t\t\ttargetContainer: theme || document.body\n\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttap(({ dialog, target, targetContainer }) => {\n\t\t\t\t\tif (!dialog) {\n\t\t\t\t\t\t// Create appropriate dialog type\n\t\t\t\t\t\tif (target.type === 'confirm') {\n\t\t\t\t\t\t\tdialog = document.createElement('confirm-dialog') as ConfirmDialog\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdialog = document.createElement('schmancy-dialog')\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tdialog.setAttribute('uid', (target as any).uid)\n\t\t\t\t\t\ttargetContainer.appendChild(dialog)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tmap(({ dialog, target, targetContainer }) => {\n\t\t\t\t\t// Return the actual dialog element that was created\n\t\t\t\t\tif (!dialog) {\n\t\t\t\t\t\tdialog = targetContainer.querySelector(`[uid=\"${(target as any).uid}\"]`)\n\t\t\t\t\t}\n\t\t\t\t\treturn { dialog, target, targetContainer }\n\t\t\t\t}),\n\t\t\t\ttap(({ dialog, target }) => {\n\t\t\t\t\tif (target.type === 'confirm') {\n\t\t\t\t\t\t// Configure confirm dialog\n\t\t\t\t\t\tconst confirmDialog = dialog as ConfirmDialog\n\t\t\t\t\t\tconst options = target.options\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (options.title) confirmDialog.title = options.title\n\t\t\t\t\t\tif (options.subtitle) confirmDialog.subtitle = options.subtitle\n\t\t\t\t\t\tif (options.message) confirmDialog.message = options.message\n\t\t\t\t\t\tif (options.confirmText) confirmDialog.confirmText = options.confirmText\n\t\t\t\t\t\tif (options.cancelText) confirmDialog.cancelText = options.cancelText\n\t\t\t\t\t\tif (options.variant) confirmDialog.variant = options.variant\n\t\t\t\t\t\tif (options.confirmColor) confirmDialog.confirmColor = options.confirmColor\n\t\t\t\t\t\tif (options.width) confirmDialog.style.setProperty('--dialog-width', options.width)\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Handle custom content if provided\n\t\t\t\t\t\tif (options.content) {\n\t\t\t\t\t\t\tconst contentContainer = document.createElement('div')\n\t\t\t\t\t\t\tcontentContainer.slot = 'content'\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (typeof options.content === 'function') {\n\t\t\t\t\t\t\t\tconst result = options.content()\n\t\t\t\t\t\t\t\tif (result instanceof HTMLElement) {\n\t\t\t\t\t\t\t\t\tcontentContainer.appendChild(result)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\trender(result, contentContainer)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (options.content instanceof HTMLElement) {\n\t\t\t\t\t\t\t\tcontentContainer.appendChild(options.content)\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\trender(options.content, contentContainer)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tconfirmDialog.appendChild(contentContainer)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add to active dialogs\n\t\t\t\t\t\tthis.activeDialogs.push(confirmDialog)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Configure component dialog\n\t\t\t\t\t\tif (target.content) {\n\t\t\t\t\t\t\tconst directContentContainer = document.createElement('div')\n\t\t\t\t\t\t\tdirectContentContainer.style.height = '100%'\n\t\t\t\t\t\t\tdirectContentContainer.style.width = '100%'\n\t\t\t\t\t\t\tdirectContentContainer.classList.add('schmancy-dialog-content-container')\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Render the content directly\n\t\t\t\t\t\t\tif (typeof target.content === 'function') {\n\t\t\t\t\t\t\t\tconst result = target.content()\n\t\t\t\t\t\t\t\tif (result instanceof HTMLElement) {\n\t\t\t\t\t\t\t\t\tdirectContentContainer.appendChild(result)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\trender(result, directContentContainer)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (target.content instanceof HTMLElement) {\n\t\t\t\t\t\t\t\tdirectContentContainer.appendChild(target.content)\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\trender(target.content, directContentContainer)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdialog.appendChild(directContentContainer)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Set width from options\n\t\t\t\t\t\tif (target.options.width) {\n\t\t\t\t\t\t\tdialog.style.setProperty('--dialog-width', target.options.width)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add to active raw dialogs\n\t\t\t\t\t\tthis.activeRawDialogs.push(dialog)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttap(({ dialog, target }) => {\n\t\t\t\t\t// Show dialog and handle promise resolution\n\t\t\t\t\tconst position = target.options.position || this.getCenteredPosition()\n\t\t\t\t\t\n\t\t\t\t\tdialog.show(position).then((result: boolean) => {\n\t\t\t\t\t\tif (target.resolve) {\n\t\t\t\t\t\t\ttarget.resolve(result)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Cleanup\n\t\t\t\t\t\tif (target.type === 'confirm') {\n\t\t\t\t\t\t\tconst index = this.activeDialogs.indexOf(dialog)\n\t\t\t\t\t\t\tif (index !== -1) {\n\t\t\t\t\t\t\t\tthis.activeDialogs.splice(index, 1)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Clean up content\n\t\t\t\t\t\t\tconst contentEl = dialog.querySelector('[slot=\"content\"]')\n\t\t\t\t\t\t\tif (contentEl) {\n\t\t\t\t\t\t\t\tdialog.removeChild(contentEl)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst index = this.activeRawDialogs.indexOf(dialog)\n\t\t\t\t\t\t\tif (index !== -1) {\n\t\t\t\t\t\t\t\tthis.activeRawDialogs.splice(index, 1)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Clean up content\n\t\t\t\t\t\t\tconst contentContainer = dialog.querySelector('.schmancy-dialog-content-container')\n\t\t\t\t\t\t\tif (contentContainer && contentContainer.parentNode) {\n\t\t\t\t\t\t\t\tcontentContainer.parentNode.removeChild(contentContainer)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove dialog from DOM\n\t\t\t\t\t\tif (dialog.parentElement) {\n\t\t\t\t\t\t\tdialog.parentElement.removeChild(dialog)\n\t\t\t\t\t\t}\n\t\t\t\t\t}).catch((error: any) => {\n\t\t\t\t\t\tif (target.reject) {\n\t\t\t\t\t\t\ttarget.reject(error)\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t\n\t\t\t\t\t// Set up event listeners for callbacks\n\t\t\t\t\tif (target.options.onConfirm) {\n\t\t\t\t\t\tconst onConfirm = (_e: Event) => {\n\t\t\t\t\t\t\ttarget.options.onConfirm!()\n\t\t\t\t\t\t\tdialog.removeEventListener('confirm', onConfirm)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdialog.addEventListener('confirm', onConfirm)\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (target.options.onCancel) {\n\t\t\t\t\t\tconst onCancel = (_e: Event) => {\n\t\t\t\t\t\t\ttarget.options.onCancel!()\n\t\t\t\t\t\t\tdialog.removeEventListener('cancel', onCancel)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdialog.addEventListener('cancel', onCancel)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\t\n\t/**\n\t * Sets up the dialog dismissal logic\n\t */\n\tprivate setupDialogDismissLogic() {\n\t\tthis.dismissSubject\n\t\t\t.pipe(\n\t\t\t\tswitchMap(uid =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<DialogHereMortyEvent>(window, DialogHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\tmap(e => e.detail),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(uid).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(DialogWhereAreYouRicky, { \n\t\t\t\t\t\t\t\t\t\tdetail: { uid },\n\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\ttap(([response]) => {\n\t\t\t\t\tif (response?.dialog) {\n\t\t\t\t\t\t// Hide the dialog\n\t\t\t\t\t\tresponse.dialog.hide(false)\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove from tracking arrays\n\t\t\t\t\t\tconst confirmIndex = this.activeDialogs.indexOf(response.dialog)\n\t\t\t\t\t\tif (confirmIndex !== -1) {\n\t\t\t\t\t\t\tthis.activeDialogs.splice(confirmIndex, 1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tconst rawIndex = this.activeRawDialogs.indexOf(response.dialog)\n\t\t\t\t\t\tif (rawIndex !== -1) {\n\t\t\t\t\t\t\tthis.activeRawDialogs.splice(rawIndex, 1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove dialog from DOM immediately\n\t\t\t\t\t\tif (response.dialog.parentElement) {\n\t\t\t\t\t\t\tresponse.dialog.parentElement.removeChild(response.dialog)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\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\treturn new Promise((resolve, reject) => {\n\t\t\t// Apply default options\n\t\t\tconst completeOptions = {\n\t\t\t\t...DialogService.DEFAULT_OPTIONS,\n\t\t\t\t...options,\n\t\t\t}\n\n\t\t\t// If no position is provided, center the dialog\n\t\t\tif (!completeOptions.position) {\n\t\t\t\tcompleteOptions.position = this.getCenteredPosition()\n\t\t\t}\n\n\t\t\t// Create dialog target and emit to subject\n\t\t\tconst target: DialogTarget = {\n\t\t\t\toptions: completeOptions,\n\t\t\t\ttype: 'confirm',\n\t\t\t\tcontent: completeOptions.content,\n\t\t\t\tresolve,\n\t\t\t\treject,\n\t\t\t}\n\n\t\t\tthis.dialogSubject.next(target)\n\t\t})\n\t}\n\n\t/**\n\t * Show a dialog with custom component content\n\t * Always renders content directly without any headers or action buttons\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tpublic component(\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions: Omit<DialogOptions, 'content' | 'message'> = {},\n\t): Promise<boolean> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\t// If no position is provided, center the dialog\n\t\t\tif (!options.position) {\n\t\t\t\toptions.position = this.getCenteredPosition()\n\t\t\t}\n\n\t\t\t// Create dialog target and emit to subject\n\t\t\tconst target: DialogTarget = {\n\t\t\t\toptions: options as DialogOptions,\n\t\t\t\ttype: 'component',\n\t\t\t\tcontent,\n\t\t\t\tresolve,\n\t\t\t\treject,\n\t\t\t}\n\n\t\t\tthis.dialogSubject.next(target)\n\t\t})\n\t}\n\n\t/**\n\t * Dismiss the most recently opened dialog (either confirm or component type)\n\t * @returns true if a dialog was dismissed, false if no dialogs were open\n\t */\n\tpublic dismiss(): boolean {\n\t\t// Try component dialog first (they're more likely to be on top)\n\t\tif (this.activeRawDialogs.length > 0) {\n\t\t\t// Get the most recently opened raw dialog (last in the array)\n\t\t\tconst dialog = this.activeRawDialogs[this.activeRawDialogs.length - 1]\n\t\t\tconst uid = dialog.getAttribute('uid')\n\t\t\t\n\t\t\tif (uid) {\n\t\t\t\tthis.dismissSubject.next(uid)\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Fall back to confirm dialogs\n\t\tif (this.activeDialogs.length > 0) {\n\t\t\t// Get the most recently opened dialog (last in the array)\n\t\t\tconst dialog = this.activeDialogs[this.activeDialogs.length - 1]\n\t\t\tconst uid = dialog.getAttribute('uid')\n\t\t\t\n\t\t\tif (uid) {\n\t\t\t\tthis.dismissSubject.next(uid)\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\n\t\treturn false\n\t}\n\n\t/**\n\t * Close the most recently opened dialog (alias for dismiss)\n\t * @returns true if a dialog was closed, false if no dialogs were open\n\t */\n\tpublic close(): boolean {\n\t\treturn this.dismiss()\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,\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 * 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/**\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 when dialog is closed\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 * Show a simple dialog without title or actions, just content\n\t * This is an alias for component() since all component dialogs are now simple by design\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tsimple: (\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions?: Omit<DialogOptions, 'content' | 'message' | 'title' | 'confirmText' | 'cancelText'>,\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\t/**\n\t * Close the most recently opened dialog (alias for dismiss)\n\t * @returns true if a dialog was closed, false if no dialogs were open\n\t */\n\tclose: (): boolean => {\n\t\treturn DialogService.getInstance().close()\n\t},\n}\n\nexport default DialogService"],"names":["DialogWhereAreYouRicky","DialogHereMorty","DialogService","constructor","this","activeDialogs","activeRawDialogs","dialogSubject","Subject","dismissSubject","setupDialogOpeningLogic","setupDialogDismissLogic","getInstance","instance","pipe","switchMap","forkJoin","fromEvent","window","takeUntil","timer","map","e","detail","defaultIfEmpty","of","target","tap","uid","type","Date","now","Math","random","toString","substring","dispatchEvent","CustomEvent","bubbles","composed","response","dialog","targetContainer","parentElement","theme","options","ThemeWhereAreYou","ThemeHereIAm","take","document","body","createElement","setAttribute","appendChild","querySelector","confirmDialog","title","subtitle","message","confirmText","cancelText","variant","confirmColor","width","style","setProperty","content","contentContainer","slot","result","HTMLElement","render","push","directContentContainer","height","classList","add","position","getCenteredPosition","show","then","resolve","index","indexOf","splice","contentEl","removeChild","parentNode","catch","error","reject","onConfirm","_e","removeEventListener","addEventListener","onCancel","subscribe","hide","confirmIndex","rawIndex","Promise","completeOptions","DEFAULT_OPTIONS","next","dismiss","length","getAttribute","close","event","confirm","x","innerWidth","y","innerHeight","_w","$dialog","ask","danger","component","simple"],"mappings":";;;AACO,MAAMA,IAAyB,wBACzBC,IAAkB,mBCsClBC,IAAN,MAAMA,EAAAA;AAAAA,EA0BJ,cAAAC;AAZRC,SAAQC,gBAAiC,CAAA,GAGzCD,KAAQE,mBAA0B,CAAA,GAGlCF,KAAQG,gBAAgB,IAAIC,KAG5BJ,KAAQK,iBAAiB,IAAID,KAI5BJ,KAAKM,wBAAAA,GACLN,KAAKO,wBAAAA;AAAAA,EACN;AAAA,EAKA,OAAA,cAAcC;AAIb,WAHKV,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AA;AAzbA7G,EAAekG,kBAA0C,EACxD9C,OAAAA,QACAC,UAAAA,QACAE,aAAAA,QACAC,oBACAC,SAAS,WACTE,OAAO,QAAA;AAVF,IAAM7D,IAANgH;AAocA,MAAMC,IAAU,EAKtBN,SAAUhE,CAAAA,MACF3C,EAAcU,YAAAA,EAAciG,QAAQhE,CAAAA,GAO5CuE,KAAK,CAAC1D,GAAiBkD,MACf1G,EAAcU,cAAcwG,IAAI1D,GAASkD,CAAAA,GAOjDS,QAASxE,CAAAA,MACD3C,EAAcU,cAAcyG,OAAOxE,CAAAA,GAO3CyE,WAAW,CACVpD,GACArB,MAEO3C,EAAcU,YAAAA,EAAc0G,UAAUpD,GAASrB,CAAAA,GAQvD0E,QAAQ,CACPrD,GACArB,MAEO3C,EAAcU,YAAAA,EAAc0G,UAAUpD,GAASrB,CAAAA,GAOvD2D,SAAS,MACDtG,EAAcU,YAAAA,EAAc4F,QAAAA,GAOpCG,OAAO,MACCzG,EAAcU,YAAAA,EAAc+F,MAAAA,EAAAA;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const d=require("lit"),o=require("rxjs"),m=require("./theme.component-RtV3l-Ns.cjs"),g="are-you-there-dialog",p="yes-dialog-here",l=class l{constructor(){this.activeDialogs=[],this.activeRawDialogs=[],this.dialogSubject=new o.Subject,this.dismissSubject=new o.Subject,this.setupDialogOpeningLogic(),this.setupDialogDismissLogic()}static getInstance(){return l.instance||(l.instance=new l),l.instance}setupDialogOpeningLogic(){this.dialogSubject.pipe(o.switchMap(e=>o.forkJoin([o.fromEvent(window,p).pipe(o.takeUntil(o.timer(100)),o.map(t=>t.detail),o.defaultIfEmpty(void 0)),o.of(e).pipe(o.tap(()=>{const t=e.type==="confirm"?`confirm-dialog-${Date.now()}-${Math.random().toString(36).substring(2,9)}`:`dialog-${Date.now()}-${Math.random().toString(36).substring(2,9)}`;window.dispatchEvent(new CustomEvent(g,{detail:{uid:t},bubbles:!0,composed:!0})),e.uid=t}))])),o.switchMap(([e,t])=>{let n,i;return e?.dialog?(n=e.dialog,i=n.parentElement,o.of({dialog:n,target:t,targetContainer:i})):e?.theme?(i=e.theme,o.of({dialog:null,target:t,targetContainer:i})):t.options.targetContainer?(i=t.options.targetContainer,o.of({dialog:null,target:t,targetContainer:i})):(window.dispatchEvent(new CustomEvent(m.ThemeWhereAreYou)),o.fromEvent(window,m.ThemeHereIAm).pipe(o.take(1),o.takeUntil(o.timer(100)),o.map(
|
|
2
|
-
//# sourceMappingURL=dialog-service-
|
|
1
|
+
"use strict";const d=require("lit"),o=require("rxjs"),m=require("./theme.component-RtV3l-Ns.cjs"),g="are-you-there-dialog",p="yes-dialog-here",l=class l{constructor(){this.activeDialogs=[],this.activeRawDialogs=[],this.dialogSubject=new o.Subject,this.dismissSubject=new o.Subject,this.setupDialogOpeningLogic(),this.setupDialogDismissLogic()}static getInstance(){return l.instance||(l.instance=new l),l.instance}setupDialogOpeningLogic(){this.dialogSubject.pipe(o.switchMap(e=>o.forkJoin([o.fromEvent(window,p).pipe(o.takeUntil(o.timer(100)),o.map(t=>t.detail),o.defaultIfEmpty(void 0)),o.of(e).pipe(o.tap(()=>{const t=e.type==="confirm"?`confirm-dialog-${Date.now()}-${Math.random().toString(36).substring(2,9)}`:`dialog-${Date.now()}-${Math.random().toString(36).substring(2,9)}`;window.dispatchEvent(new CustomEvent(g,{detail:{uid:t},bubbles:!0,composed:!0})),e.uid=t}))])),o.switchMap(([e,t])=>{let n,i;return e?.dialog?(n=e.dialog,i=n.parentElement,o.of({dialog:n,target:t,targetContainer:i})):e?.theme?(i=e.theme,o.of({dialog:null,target:t,targetContainer:i})):t.options.targetContainer?(i=t.options.targetContainer,o.of({dialog:null,target:t,targetContainer:i})):(window.dispatchEvent(new CustomEvent(m.ThemeWhereAreYou)),o.fromEvent(window,m.ThemeHereIAm).pipe(o.take(1),o.takeUntil(o.timer(100)),o.map(s=>s.detail.theme),o.defaultIfEmpty(void 0),o.map(s=>({dialog:null,target:t,targetContainer:s||document.body}))))}),o.tap(({dialog:e,target:t,targetContainer:n})=>{e||((e=t.type==="confirm"?document.createElement("confirm-dialog"):document.createElement("schmancy-dialog")).setAttribute("uid",t.uid),n.appendChild(e))}),o.map(({dialog:e,target:t,targetContainer:n})=>(e||(e=n.querySelector(`[uid="${t.uid}"]`)),{dialog:e,target:t,targetContainer:n})),o.tap(({dialog:e,target:t})=>{if(t.type==="confirm"){const n=e,i=t.options;if(i.title&&(n.title=i.title),i.subtitle&&(n.subtitle=i.subtitle),i.message&&(n.message=i.message),i.confirmText&&(n.confirmText=i.confirmText),i.cancelText&&(n.cancelText=i.cancelText),i.variant&&(n.variant=i.variant),i.confirmColor&&(n.confirmColor=i.confirmColor),i.width&&n.style.setProperty("--dialog-width",i.width),i.content){const s=document.createElement("div");if(s.slot="content",typeof i.content=="function"){const a=i.content();a instanceof HTMLElement?s.appendChild(a):d.render(a,s)}else i.content instanceof HTMLElement?s.appendChild(i.content):d.render(i.content,s);n.appendChild(s)}this.activeDialogs.push(n)}else{if(t.content){const n=document.createElement("div");if(n.style.height="100%",n.style.width="100%",n.classList.add("schmancy-dialog-content-container"),typeof t.content=="function"){const i=t.content();i instanceof HTMLElement?n.appendChild(i):d.render(i,n)}else t.content instanceof HTMLElement?n.appendChild(t.content):d.render(t.content,n);e.appendChild(n)}t.options.width&&e.style.setProperty("--dialog-width",t.options.width),this.activeRawDialogs.push(e)}}),o.tap(({dialog:e,target:t})=>{const n=t.options.position||this.getCenteredPosition();if(e.show(n).then(i=>{if(t.resolve&&t.resolve(i),t.type==="confirm"){const s=this.activeDialogs.indexOf(e);s!==-1&&this.activeDialogs.splice(s,1);const a=e.querySelector('[slot="content"]');a&&e.removeChild(a)}else{const s=this.activeRawDialogs.indexOf(e);s!==-1&&this.activeRawDialogs.splice(s,1);const a=e.querySelector(".schmancy-dialog-content-container");a&&a.parentNode&&a.parentNode.removeChild(a)}e.parentElement&&e.parentElement.removeChild(e)}).catch(i=>{t.reject&&t.reject(i)}),t.options.onConfirm){const i=s=>{t.options.onConfirm(),e.removeEventListener("confirm",i)};e.addEventListener("confirm",i)}if(t.options.onCancel){const i=s=>{t.options.onCancel(),e.removeEventListener("cancel",i)};e.addEventListener("cancel",i)}})).subscribe()}setupDialogDismissLogic(){this.dismissSubject.pipe(o.switchMap(e=>o.forkJoin([o.fromEvent(window,p).pipe(o.takeUntil(o.timer(100)),o.map(t=>t.detail),o.defaultIfEmpty(void 0)),o.of(e).pipe(o.tap(()=>{window.dispatchEvent(new CustomEvent(g,{detail:{uid:e},bubbles:!0,composed:!0}))}))])),o.tap(([e])=>{if(e?.dialog){e.dialog.hide(!1);const t=this.activeDialogs.indexOf(e.dialog);t!==-1&&this.activeDialogs.splice(t,1);const n=this.activeRawDialogs.indexOf(e.dialog);n!==-1&&this.activeRawDialogs.splice(n,1),e.dialog.parentElement&&e.dialog.parentElement.removeChild(e.dialog)}})).subscribe()}confirm(e){return new Promise((t,n)=>{const i={...l.DEFAULT_OPTIONS,...e};i.position||(i.position=this.getCenteredPosition());const s={options:i,type:"confirm",content:i.content,resolve:t,reject:n};this.dialogSubject.next(s)})}component(e,t={}){return new Promise((n,i)=>{t.position||(t.position=this.getCenteredPosition());const s={options:t,type:"component",content:e,resolve:n,reject:i};this.dialogSubject.next(s)})}dismiss(){if(this.activeRawDialogs.length>0){const e=this.activeRawDialogs[this.activeRawDialogs.length-1].getAttribute("uid");if(e)return this.dismissSubject.next(e),!0}if(this.activeDialogs.length>0){const e=this.activeDialogs[this.activeDialogs.length-1].getAttribute("uid");if(e)return this.dismissSubject.next(e),!0}return!1}close(){return this.dismiss()}ask(e,t){return this.confirm({message:e,position:t})}danger(e){return this.confirm({...e,variant:"danger"})}getCenteredPosition(){return{x:window.innerWidth/2,y:window.innerHeight/2}}};l.DEFAULT_OPTIONS={title:void 0,subtitle:void 0,confirmText:void 0,cancelText:void 0,variant:"default",width:"360px"};let c=l;const h={confirm:r=>c.getInstance().confirm(r),ask:(r,e)=>c.getInstance().ask(r,e),danger:r=>c.getInstance().danger(r),component:(r,e)=>c.getInstance().component(r,e),simple:(r,e)=>c.getInstance().component(r,e),dismiss:()=>c.getInstance().dismiss(),close:()=>c.getInstance().close()};exports.$dialog=h,exports.DialogHereMorty=p,exports.DialogService=c,exports.DialogWhereAreYouRicky=g;
|
|
2
|
+
//# sourceMappingURL=dialog-service-JNWTLfAy.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-service-DUDhcx9X.cjs","sources":["../src/dialog/dialog-events.ts","../src/dialog/dialog-service.ts"],"sourcesContent":["// Dialog discovery event constants\r\nexport const DialogWhereAreYouRicky = 'are-you-there-dialog'\r\nexport const DialogHereMorty = 'yes-dialog-here'\r\n\r\n// Event interfaces\r\nexport interface DialogWhereAreYouRickyEvent extends CustomEvent {\r\n detail: {\r\n uid: string\r\n }\r\n}\r\n\r\nexport interface DialogHereMortyEvent extends CustomEvent {\r\n detail: {\r\n dialog: any // Will be schmancy-dialog instance\r\n theme?: any // Will be schmancy-theme instance\r\n }\r\n}","import { render, TemplateResult } from 'lit'\nimport { defaultIfEmpty, forkJoin, fromEvent, map, of, Subject, switchMap, takeUntil, tap, timer, take } from 'rxjs'\nimport { ConfirmDialog } from './dailog'\nimport { DialogHereMorty, DialogHereMortyEvent, DialogWhereAreYouRicky } from './dialog-events'\nimport { ThemeWhereAreYou, ThemeHereIAm, ThemeHereIAmEvent } from '../theme/theme.component'\n\n/**\n * Dialog service options interface with component support\n */\nexport interface DialogOptions {\n\ttitle?: string\n\tsubtitle?: string\n\tmessage?: string\n\tconfirmText?: string\n\tcancelText?: string\n\tvariant?: 'default' | 'danger'\n\tconfirmColor?: 'primary' | 'error' | 'warning' | 'success' // Button color for confirm action\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\thideActions?: boolean // Set to true to hide all buttons and title\n\ttargetContainer?: HTMLElement // Container to append dialog to (defaults to document.body)\n}\n\ninterface DialogTarget {\n\toptions: DialogOptions\n\ttype: 'confirm' | 'component'\n\tcontent?: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult)\n\tresolve?: (value: boolean) => void\n\treject?: (reason?: any) => 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\tsubtitle: undefined,\n\t\tconfirmText: undefined,\n\t\tcancelText: undefined,\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\t\n\t// Track component dialogs (schmancy-dialog instances)\n\tprivate activeRawDialogs: any[] = []\n\t\n\t// Subject for dialog opening requests\n\tprivate dialogSubject = new Subject<DialogTarget>()\n\t\n\t// Subject for dialog dismissal requests\n\tprivate dismissSubject = new Subject<string>()\n\n\t// Private constructor for singleton pattern\n\tprivate constructor() {\n\t\tthis.setupDialogOpeningLogic()\n\t\tthis.setupDialogDismissLogic()\n\t}\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\t\n\t/**\n\t * Sets up the main dialog opening logic using RxJS pipes\n\t */\n\tprivate setupDialogOpeningLogic() {\n\t\tthis.dialogSubject\n\t\t\t.pipe(\n\t\t\t\tswitchMap(target =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<DialogHereMortyEvent>(window, DialogHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\tmap(e => e.detail),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(target).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\tconst uid = target.type === 'confirm' \n\t\t\t\t\t\t\t\t\t? `confirm-dialog-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`\n\t\t\t\t\t\t\t\t\t: `dialog-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(DialogWhereAreYouRicky, {\n\t\t\t\t\t\t\t\t\t\tdetail: { uid },\n\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// Store uid in target for later use\n\t\t\t\t\t\t\t\t;(target as any).uid = uid\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\tswitchMap(([response, target]) => {\n\t\t\t\t\tlet dialog: ConfirmDialog | any\n\t\t\t\t\tlet targetContainer: HTMLElement\n\t\t\t\t\t\n\t\t\t\t\tif (response?.dialog) {\n\t\t\t\t\t\t// Use existing dialog\n\t\t\t\t\t\tdialog = response.dialog\n\t\t\t\t\t\ttargetContainer = dialog.parentElement as HTMLElement\n\t\t\t\t\t\treturn of({ dialog, target, targetContainer })\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Determine container - use responding theme or fallback\n\t\t\t\t\t\tif (response?.theme) {\n\t\t\t\t\t\t\ttargetContainer = response.theme as HTMLElement\n\t\t\t\t\t\t\treturn of({ dialog: null, target, targetContainer })\n\t\t\t\t\t\t} else if (target.options.targetContainer) {\n\t\t\t\t\t\t\ttargetContainer = target.options.targetContainer\n\t\t\t\t\t\t\treturn of({ dialog: null, target, targetContainer })\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Use the same theme discovery pattern as sheet service\n\t\t\t\t\t\t\twindow.dispatchEvent(new CustomEvent(ThemeWhereAreYou))\n\t\t\t\t\t\t\treturn fromEvent<ThemeHereIAmEvent>(window, ThemeHereIAm).pipe(\n\t\t\t\t\t\t\t\ttake(1),\n\t\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\t\tmap(e => e.detail.theme),\n\t\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t\t\tmap(theme => ({\n\t\t\t\t\t\t\t\t\tdialog: null,\n\t\t\t\t\t\t\t\t\ttarget,\n\t\t\t\t\t\t\t\t\ttargetContainer: theme || document.body\n\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttap(({ dialog, target, targetContainer }) => {\n\t\t\t\t\tif (!dialog) {\n\t\t\t\t\t\t// Create appropriate dialog type\n\t\t\t\t\t\tif (target.type === 'confirm') {\n\t\t\t\t\t\t\tdialog = document.createElement('confirm-dialog') as ConfirmDialog\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdialog = document.createElement('schmancy-dialog')\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tdialog.setAttribute('uid', (target as any).uid)\n\t\t\t\t\t\ttargetContainer.appendChild(dialog)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tmap(({ dialog, target, targetContainer }) => {\n\t\t\t\t\t// Return the actual dialog element that was created\n\t\t\t\t\tif (!dialog) {\n\t\t\t\t\t\tdialog = targetContainer.querySelector(`[uid=\"${(target as any).uid}\"]`)\n\t\t\t\t\t}\n\t\t\t\t\treturn { dialog, target, targetContainer }\n\t\t\t\t}),\n\t\t\t\ttap(({ dialog, target }) => {\n\t\t\t\t\tif (target.type === 'confirm') {\n\t\t\t\t\t\t// Configure confirm dialog\n\t\t\t\t\t\tconst confirmDialog = dialog as ConfirmDialog\n\t\t\t\t\t\tconst options = target.options\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (options.title) confirmDialog.title = options.title\n\t\t\t\t\t\tif (options.subtitle) confirmDialog.subtitle = options.subtitle\n\t\t\t\t\t\tif (options.message) confirmDialog.message = options.message\n\t\t\t\t\t\tif (options.confirmText) confirmDialog.confirmText = options.confirmText\n\t\t\t\t\t\tif (options.cancelText) confirmDialog.cancelText = options.cancelText\n\t\t\t\t\t\tif (options.variant) confirmDialog.variant = options.variant\n\t\t\t\t\t\tif (options.confirmColor) confirmDialog.confirmColor = options.confirmColor\n\t\t\t\t\t\tif (options.width) confirmDialog.style.setProperty('--dialog-width', options.width)\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Handle custom content if provided\n\t\t\t\t\t\tif (options.content) {\n\t\t\t\t\t\t\tconst contentContainer = document.createElement('div')\n\t\t\t\t\t\t\tcontentContainer.slot = 'content'\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (typeof options.content === 'function') {\n\t\t\t\t\t\t\t\tconst result = options.content()\n\t\t\t\t\t\t\t\tif (result instanceof HTMLElement) {\n\t\t\t\t\t\t\t\t\tcontentContainer.appendChild(result)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\trender(result, contentContainer)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (options.content instanceof HTMLElement) {\n\t\t\t\t\t\t\t\tcontentContainer.appendChild(options.content)\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\trender(options.content, contentContainer)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tconfirmDialog.appendChild(contentContainer)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add to active dialogs\n\t\t\t\t\t\tthis.activeDialogs.push(confirmDialog)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Configure component dialog\n\t\t\t\t\t\tif (target.content) {\n\t\t\t\t\t\t\tconst directContentContainer = document.createElement('div')\n\t\t\t\t\t\t\tdirectContentContainer.style.height = '100%'\n\t\t\t\t\t\t\tdirectContentContainer.style.width = '100%'\n\t\t\t\t\t\t\tdirectContentContainer.classList.add('schmancy-dialog-content-container')\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Render the content directly\n\t\t\t\t\t\t\tif (typeof target.content === 'function') {\n\t\t\t\t\t\t\t\tconst result = target.content()\n\t\t\t\t\t\t\t\tif (result instanceof HTMLElement) {\n\t\t\t\t\t\t\t\t\tdirectContentContainer.appendChild(result)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\trender(result, directContentContainer)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (target.content instanceof HTMLElement) {\n\t\t\t\t\t\t\t\tdirectContentContainer.appendChild(target.content)\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\trender(target.content, directContentContainer)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdialog.appendChild(directContentContainer)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Set width from options\n\t\t\t\t\t\tif (target.options.width) {\n\t\t\t\t\t\t\tdialog.style.setProperty('--dialog-width', target.options.width)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add to active raw dialogs\n\t\t\t\t\t\tthis.activeRawDialogs.push(dialog)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttap(({ dialog, target }) => {\n\t\t\t\t\t// Show dialog and handle promise resolution\n\t\t\t\t\tconst position = target.options.position || this.getCenteredPosition()\n\t\t\t\t\t\n\t\t\t\t\tdialog.show(position).then((result: boolean) => {\n\t\t\t\t\t\tif (target.resolve) {\n\t\t\t\t\t\t\ttarget.resolve(result)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Cleanup\n\t\t\t\t\t\tif (target.type === 'confirm') {\n\t\t\t\t\t\t\tconst index = this.activeDialogs.indexOf(dialog)\n\t\t\t\t\t\t\tif (index !== -1) {\n\t\t\t\t\t\t\t\tthis.activeDialogs.splice(index, 1)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Clean up content\n\t\t\t\t\t\t\tconst contentEl = dialog.querySelector('[slot=\"content\"]')\n\t\t\t\t\t\t\tif (contentEl) {\n\t\t\t\t\t\t\t\tdialog.removeChild(contentEl)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst index = this.activeRawDialogs.indexOf(dialog)\n\t\t\t\t\t\t\tif (index !== -1) {\n\t\t\t\t\t\t\t\tthis.activeRawDialogs.splice(index, 1)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Clean up content\n\t\t\t\t\t\t\tconst contentContainer = dialog.querySelector('.schmancy-dialog-content-container')\n\t\t\t\t\t\t\tif (contentContainer && contentContainer.parentNode) {\n\t\t\t\t\t\t\t\tcontentContainer.parentNode.removeChild(contentContainer)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove dialog from DOM\n\t\t\t\t\t\tif (dialog.parentElement) {\n\t\t\t\t\t\t\tdialog.parentElement.removeChild(dialog)\n\t\t\t\t\t\t}\n\t\t\t\t\t}).catch((error: any) => {\n\t\t\t\t\t\tif (target.reject) {\n\t\t\t\t\t\t\ttarget.reject(error)\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t\n\t\t\t\t\t// Set up event listeners for callbacks\n\t\t\t\t\tif (target.options.onConfirm) {\n\t\t\t\t\t\tconst onConfirm = (_e: Event) => {\n\t\t\t\t\t\t\ttarget.options.onConfirm!()\n\t\t\t\t\t\t\tdialog.removeEventListener('confirm', onConfirm)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdialog.addEventListener('confirm', onConfirm)\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (target.options.onCancel) {\n\t\t\t\t\t\tconst onCancel = (_e: Event) => {\n\t\t\t\t\t\t\ttarget.options.onCancel!()\n\t\t\t\t\t\t\tdialog.removeEventListener('cancel', onCancel)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdialog.addEventListener('cancel', onCancel)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\t\n\t/**\n\t * Sets up the dialog dismissal logic\n\t */\n\tprivate setupDialogDismissLogic() {\n\t\tthis.dismissSubject\n\t\t\t.pipe(\n\t\t\t\tswitchMap(uid =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<DialogHereMortyEvent>(window, DialogHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\tmap(e => e.detail),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(uid).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(DialogWhereAreYouRicky, { \n\t\t\t\t\t\t\t\t\t\tdetail: { uid },\n\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\ttap(([response]) => {\n\t\t\t\t\tif (response?.dialog) {\n\t\t\t\t\t\t// Hide the dialog\n\t\t\t\t\t\tresponse.dialog.hide(false)\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove from tracking arrays\n\t\t\t\t\t\tconst confirmIndex = this.activeDialogs.indexOf(response.dialog)\n\t\t\t\t\t\tif (confirmIndex !== -1) {\n\t\t\t\t\t\t\tthis.activeDialogs.splice(confirmIndex, 1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tconst rawIndex = this.activeRawDialogs.indexOf(response.dialog)\n\t\t\t\t\t\tif (rawIndex !== -1) {\n\t\t\t\t\t\t\tthis.activeRawDialogs.splice(rawIndex, 1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove dialog from DOM immediately\n\t\t\t\t\t\tif (response.dialog.parentElement) {\n\t\t\t\t\t\t\tresponse.dialog.parentElement.removeChild(response.dialog)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\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\treturn new Promise((resolve, reject) => {\n\t\t\t// Apply default options\n\t\t\tconst completeOptions = {\n\t\t\t\t...DialogService.DEFAULT_OPTIONS,\n\t\t\t\t...options,\n\t\t\t}\n\n\t\t\t// If no position is provided, center the dialog\n\t\t\tif (!completeOptions.position) {\n\t\t\t\tcompleteOptions.position = this.getCenteredPosition()\n\t\t\t}\n\n\t\t\t// Create dialog target and emit to subject\n\t\t\tconst target: DialogTarget = {\n\t\t\t\toptions: completeOptions,\n\t\t\t\ttype: 'confirm',\n\t\t\t\tcontent: completeOptions.content,\n\t\t\t\tresolve,\n\t\t\t\treject,\n\t\t\t}\n\n\t\t\tthis.dialogSubject.next(target)\n\t\t})\n\t}\n\n\t/**\n\t * Show a dialog with custom component content\n\t * Always renders content directly without any headers or action buttons\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tpublic component(\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions: Omit<DialogOptions, 'content' | 'message'> = {},\n\t): Promise<boolean> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\t// If no position is provided, center the dialog\n\t\t\tif (!options.position) {\n\t\t\t\toptions.position = this.getCenteredPosition()\n\t\t\t}\n\n\t\t\t// Create dialog target and emit to subject\n\t\t\tconst target: DialogTarget = {\n\t\t\t\toptions: options as DialogOptions,\n\t\t\t\ttype: 'component',\n\t\t\t\tcontent,\n\t\t\t\tresolve,\n\t\t\t\treject,\n\t\t\t}\n\n\t\t\tthis.dialogSubject.next(target)\n\t\t})\n\t}\n\n\t/**\n\t * Dismiss the most recently opened dialog (either confirm or component type)\n\t * @returns true if a dialog was dismissed, false if no dialogs were open\n\t */\n\tpublic dismiss(): boolean {\n\t\t// Try component dialog first (they're more likely to be on top)\n\t\tif (this.activeRawDialogs.length > 0) {\n\t\t\t// Get the most recently opened raw dialog (last in the array)\n\t\t\tconst dialog = this.activeRawDialogs[this.activeRawDialogs.length - 1]\n\t\t\tconst uid = dialog.getAttribute('uid')\n\t\t\t\n\t\t\tif (uid) {\n\t\t\t\tthis.dismissSubject.next(uid)\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Fall back to confirm dialogs\n\t\tif (this.activeDialogs.length > 0) {\n\t\t\t// Get the most recently opened dialog (last in the array)\n\t\t\tconst dialog = this.activeDialogs[this.activeDialogs.length - 1]\n\t\t\tconst uid = dialog.getAttribute('uid')\n\t\t\t\n\t\t\tif (uid) {\n\t\t\t\tthis.dismissSubject.next(uid)\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\n\t\treturn false\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,\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 * 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/**\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 when dialog is closed\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 * Show a simple dialog without title or actions, just content\n\t * This is an alias for component() since all component dialogs are now simple by design\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tsimple: (\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions?: Omit<DialogOptions, 'content' | 'message' | 'title' | 'confirmText' | 'cancelText'>,\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"],"names":["DialogWhereAreYouRicky","DialogHereMorty","DialogService","constructor","this","activeDialogs","activeRawDialogs","dialogSubject","Subject","dismissSubject","setupDialogOpeningLogic","setupDialogDismissLogic","getInstance","instance","pipe","switchMap","forkJoin","fromEvent","window","takeUntil","timer","map","e","detail","defaultIfEmpty","of","target","tap","uid","type","Date","now","Math","random","toString","substring","dispatchEvent","CustomEvent","bubbles","composed","response","dialog","targetContainer","parentElement","theme","options","ThemeWhereAreYou","ThemeHereIAm","take","document","body","createElement","setAttribute","appendChild","querySelector","confirmDialog","title","subtitle","message","confirmText","cancelText","variant","confirmColor","width","style","setProperty","content","contentContainer","slot","result","HTMLElement","render","push","directContentContainer","height","classList","add","position","getCenteredPosition","show","then","resolve","index","indexOf","splice","contentEl","removeChild","parentNode","catch","error","reject","onConfirm","_e","removeEventListener","addEventListener","onCancel","subscribe","hide","confirmIndex","rawIndex","Promise","completeOptions","DEFAULT_OPTIONS","next","dismiss","length","getAttribute","event","confirm","x","innerWidth","y","innerHeight","_s","$dialog","ask","danger","component","simple"],"mappings":"kGACaA,EAAyB,uBACzBC,EAAkB,kBCsClBC,EAAN,MAAMA,CAAAA,CA0BJ,aAAAC,CAZRC,KAAQC,cAAiC,CAAA,EAGzCD,KAAQE,iBAA0B,CAAA,EAGlCF,KAAQG,cAAgB,IAAIC,UAG5BJ,KAAQK,eAAiB,IAAID,UAI5BJ,KAAKM,wBAAAA,EACLN,KAAKO,wBAAAA,CACN,CAKA,oBAAcC,CAIb,OAHKV,EAAcW,WAClBX,EAAcW,SAAW,IAAIX,GAEvBA,EAAcW,QACtB,CAKQ,yBAAAH,CACPN,KAAKG,cACHO,KACAC,EAAAA,aACCC,EAAAA,SAAS,CACRC,YAAgCC,OAAQjB,CAAAA,EAAiBa,KACxDK,YAAUC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3C,EAAcU,YAAAA,EAAcyG,UAAUnD,EAASrB,CAAAA,EAQvDyE,OAAQ,CACPpD,EACArB,IAEO3C,EAAcU,YAAAA,EAAcyG,UAAUnD,EAASrB,CAAAA,EAOvD2D,QAAS,IACDtG,EAAcU,YAAAA,EAAc4F,QAAAA,CAAAA"}
|
|
1
|
+
{"version":3,"file":"dialog-service-JNWTLfAy.cjs","sources":["../src/dialog/dialog-events.ts","../src/dialog/dialog-service.ts"],"sourcesContent":["// Dialog discovery event constants\r\nexport const DialogWhereAreYouRicky = 'are-you-there-dialog'\r\nexport const DialogHereMorty = 'yes-dialog-here'\r\n\r\n// Event interfaces\r\nexport interface DialogWhereAreYouRickyEvent extends CustomEvent {\r\n detail: {\r\n uid: string\r\n }\r\n}\r\n\r\nexport interface DialogHereMortyEvent extends CustomEvent {\r\n detail: {\r\n dialog: any // Will be schmancy-dialog instance\r\n theme?: any // Will be schmancy-theme instance\r\n }\r\n}","import { render, TemplateResult } from 'lit'\nimport { defaultIfEmpty, forkJoin, fromEvent, map, of, Subject, switchMap, takeUntil, tap, timer, take } from 'rxjs'\nimport { ConfirmDialog } from './dailog'\nimport { DialogHereMorty, DialogHereMortyEvent, DialogWhereAreYouRicky } from './dialog-events'\nimport { ThemeWhereAreYou, ThemeHereIAm, ThemeHereIAmEvent } from '../theme/theme.component'\n\n/**\n * Dialog service options interface with component support\n */\nexport interface DialogOptions {\n\ttitle?: string\n\tsubtitle?: string\n\tmessage?: string\n\tconfirmText?: string\n\tcancelText?: string\n\tvariant?: 'default' | 'danger'\n\tconfirmColor?: 'primary' | 'error' | 'warning' | 'success' // Button color for confirm action\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\thideActions?: boolean // Set to true to hide all buttons and title\n\ttargetContainer?: HTMLElement // Container to append dialog to (defaults to document.body)\n}\n\ninterface DialogTarget {\n\toptions: DialogOptions\n\ttype: 'confirm' | 'component'\n\tcontent?: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult)\n\tresolve?: (value: boolean) => void\n\treject?: (reason?: any) => 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\tsubtitle: undefined,\n\t\tconfirmText: undefined,\n\t\tcancelText: undefined,\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\t\n\t// Track component dialogs (schmancy-dialog instances)\n\tprivate activeRawDialogs: any[] = []\n\t\n\t// Subject for dialog opening requests\n\tprivate dialogSubject = new Subject<DialogTarget>()\n\t\n\t// Subject for dialog dismissal requests\n\tprivate dismissSubject = new Subject<string>()\n\n\t// Private constructor for singleton pattern\n\tprivate constructor() {\n\t\tthis.setupDialogOpeningLogic()\n\t\tthis.setupDialogDismissLogic()\n\t}\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\t\n\t/**\n\t * Sets up the main dialog opening logic using RxJS pipes\n\t */\n\tprivate setupDialogOpeningLogic() {\n\t\tthis.dialogSubject\n\t\t\t.pipe(\n\t\t\t\tswitchMap(target =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<DialogHereMortyEvent>(window, DialogHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\tmap(e => e.detail),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(target).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\tconst uid = target.type === 'confirm' \n\t\t\t\t\t\t\t\t\t? `confirm-dialog-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`\n\t\t\t\t\t\t\t\t\t: `dialog-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(DialogWhereAreYouRicky, {\n\t\t\t\t\t\t\t\t\t\tdetail: { uid },\n\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// Store uid in target for later use\n\t\t\t\t\t\t\t\t;(target as any).uid = uid\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\tswitchMap(([response, target]) => {\n\t\t\t\t\tlet dialog: ConfirmDialog | any\n\t\t\t\t\tlet targetContainer: HTMLElement\n\t\t\t\t\t\n\t\t\t\t\tif (response?.dialog) {\n\t\t\t\t\t\t// Use existing dialog\n\t\t\t\t\t\tdialog = response.dialog\n\t\t\t\t\t\ttargetContainer = dialog.parentElement as HTMLElement\n\t\t\t\t\t\treturn of({ dialog, target, targetContainer })\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Determine container - use responding theme or fallback\n\t\t\t\t\t\tif (response?.theme) {\n\t\t\t\t\t\t\ttargetContainer = response.theme as HTMLElement\n\t\t\t\t\t\t\treturn of({ dialog: null, target, targetContainer })\n\t\t\t\t\t\t} else if (target.options.targetContainer) {\n\t\t\t\t\t\t\ttargetContainer = target.options.targetContainer\n\t\t\t\t\t\t\treturn of({ dialog: null, target, targetContainer })\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Use the same theme discovery pattern as sheet service\n\t\t\t\t\t\t\twindow.dispatchEvent(new CustomEvent(ThemeWhereAreYou))\n\t\t\t\t\t\t\treturn fromEvent<ThemeHereIAmEvent>(window, ThemeHereIAm).pipe(\n\t\t\t\t\t\t\t\ttake(1),\n\t\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\t\tmap(e => e.detail.theme),\n\t\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t\t\tmap(theme => ({\n\t\t\t\t\t\t\t\t\tdialog: null,\n\t\t\t\t\t\t\t\t\ttarget,\n\t\t\t\t\t\t\t\t\ttargetContainer: theme || document.body\n\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttap(({ dialog, target, targetContainer }) => {\n\t\t\t\t\tif (!dialog) {\n\t\t\t\t\t\t// Create appropriate dialog type\n\t\t\t\t\t\tif (target.type === 'confirm') {\n\t\t\t\t\t\t\tdialog = document.createElement('confirm-dialog') as ConfirmDialog\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdialog = document.createElement('schmancy-dialog')\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tdialog.setAttribute('uid', (target as any).uid)\n\t\t\t\t\t\ttargetContainer.appendChild(dialog)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tmap(({ dialog, target, targetContainer }) => {\n\t\t\t\t\t// Return the actual dialog element that was created\n\t\t\t\t\tif (!dialog) {\n\t\t\t\t\t\tdialog = targetContainer.querySelector(`[uid=\"${(target as any).uid}\"]`)\n\t\t\t\t\t}\n\t\t\t\t\treturn { dialog, target, targetContainer }\n\t\t\t\t}),\n\t\t\t\ttap(({ dialog, target }) => {\n\t\t\t\t\tif (target.type === 'confirm') {\n\t\t\t\t\t\t// Configure confirm dialog\n\t\t\t\t\t\tconst confirmDialog = dialog as ConfirmDialog\n\t\t\t\t\t\tconst options = target.options\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (options.title) confirmDialog.title = options.title\n\t\t\t\t\t\tif (options.subtitle) confirmDialog.subtitle = options.subtitle\n\t\t\t\t\t\tif (options.message) confirmDialog.message = options.message\n\t\t\t\t\t\tif (options.confirmText) confirmDialog.confirmText = options.confirmText\n\t\t\t\t\t\tif (options.cancelText) confirmDialog.cancelText = options.cancelText\n\t\t\t\t\t\tif (options.variant) confirmDialog.variant = options.variant\n\t\t\t\t\t\tif (options.confirmColor) confirmDialog.confirmColor = options.confirmColor\n\t\t\t\t\t\tif (options.width) confirmDialog.style.setProperty('--dialog-width', options.width)\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Handle custom content if provided\n\t\t\t\t\t\tif (options.content) {\n\t\t\t\t\t\t\tconst contentContainer = document.createElement('div')\n\t\t\t\t\t\t\tcontentContainer.slot = 'content'\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (typeof options.content === 'function') {\n\t\t\t\t\t\t\t\tconst result = options.content()\n\t\t\t\t\t\t\t\tif (result instanceof HTMLElement) {\n\t\t\t\t\t\t\t\t\tcontentContainer.appendChild(result)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\trender(result, contentContainer)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (options.content instanceof HTMLElement) {\n\t\t\t\t\t\t\t\tcontentContainer.appendChild(options.content)\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\trender(options.content, contentContainer)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tconfirmDialog.appendChild(contentContainer)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add to active dialogs\n\t\t\t\t\t\tthis.activeDialogs.push(confirmDialog)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Configure component dialog\n\t\t\t\t\t\tif (target.content) {\n\t\t\t\t\t\t\tconst directContentContainer = document.createElement('div')\n\t\t\t\t\t\t\tdirectContentContainer.style.height = '100%'\n\t\t\t\t\t\t\tdirectContentContainer.style.width = '100%'\n\t\t\t\t\t\t\tdirectContentContainer.classList.add('schmancy-dialog-content-container')\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Render the content directly\n\t\t\t\t\t\t\tif (typeof target.content === 'function') {\n\t\t\t\t\t\t\t\tconst result = target.content()\n\t\t\t\t\t\t\t\tif (result instanceof HTMLElement) {\n\t\t\t\t\t\t\t\t\tdirectContentContainer.appendChild(result)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\trender(result, directContentContainer)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (target.content instanceof HTMLElement) {\n\t\t\t\t\t\t\t\tdirectContentContainer.appendChild(target.content)\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\trender(target.content, directContentContainer)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdialog.appendChild(directContentContainer)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Set width from options\n\t\t\t\t\t\tif (target.options.width) {\n\t\t\t\t\t\t\tdialog.style.setProperty('--dialog-width', target.options.width)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add to active raw dialogs\n\t\t\t\t\t\tthis.activeRawDialogs.push(dialog)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttap(({ dialog, target }) => {\n\t\t\t\t\t// Show dialog and handle promise resolution\n\t\t\t\t\tconst position = target.options.position || this.getCenteredPosition()\n\t\t\t\t\t\n\t\t\t\t\tdialog.show(position).then((result: boolean) => {\n\t\t\t\t\t\tif (target.resolve) {\n\t\t\t\t\t\t\ttarget.resolve(result)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Cleanup\n\t\t\t\t\t\tif (target.type === 'confirm') {\n\t\t\t\t\t\t\tconst index = this.activeDialogs.indexOf(dialog)\n\t\t\t\t\t\t\tif (index !== -1) {\n\t\t\t\t\t\t\t\tthis.activeDialogs.splice(index, 1)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Clean up content\n\t\t\t\t\t\t\tconst contentEl = dialog.querySelector('[slot=\"content\"]')\n\t\t\t\t\t\t\tif (contentEl) {\n\t\t\t\t\t\t\t\tdialog.removeChild(contentEl)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst index = this.activeRawDialogs.indexOf(dialog)\n\t\t\t\t\t\t\tif (index !== -1) {\n\t\t\t\t\t\t\t\tthis.activeRawDialogs.splice(index, 1)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Clean up content\n\t\t\t\t\t\t\tconst contentContainer = dialog.querySelector('.schmancy-dialog-content-container')\n\t\t\t\t\t\t\tif (contentContainer && contentContainer.parentNode) {\n\t\t\t\t\t\t\t\tcontentContainer.parentNode.removeChild(contentContainer)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove dialog from DOM\n\t\t\t\t\t\tif (dialog.parentElement) {\n\t\t\t\t\t\t\tdialog.parentElement.removeChild(dialog)\n\t\t\t\t\t\t}\n\t\t\t\t\t}).catch((error: any) => {\n\t\t\t\t\t\tif (target.reject) {\n\t\t\t\t\t\t\ttarget.reject(error)\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t\n\t\t\t\t\t// Set up event listeners for callbacks\n\t\t\t\t\tif (target.options.onConfirm) {\n\t\t\t\t\t\tconst onConfirm = (_e: Event) => {\n\t\t\t\t\t\t\ttarget.options.onConfirm!()\n\t\t\t\t\t\t\tdialog.removeEventListener('confirm', onConfirm)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdialog.addEventListener('confirm', onConfirm)\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (target.options.onCancel) {\n\t\t\t\t\t\tconst onCancel = (_e: Event) => {\n\t\t\t\t\t\t\ttarget.options.onCancel!()\n\t\t\t\t\t\t\tdialog.removeEventListener('cancel', onCancel)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdialog.addEventListener('cancel', onCancel)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\t\n\t/**\n\t * Sets up the dialog dismissal logic\n\t */\n\tprivate setupDialogDismissLogic() {\n\t\tthis.dismissSubject\n\t\t\t.pipe(\n\t\t\t\tswitchMap(uid =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<DialogHereMortyEvent>(window, DialogHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\tmap(e => e.detail),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(uid).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(DialogWhereAreYouRicky, { \n\t\t\t\t\t\t\t\t\t\tdetail: { uid },\n\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\ttap(([response]) => {\n\t\t\t\t\tif (response?.dialog) {\n\t\t\t\t\t\t// Hide the dialog\n\t\t\t\t\t\tresponse.dialog.hide(false)\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove from tracking arrays\n\t\t\t\t\t\tconst confirmIndex = this.activeDialogs.indexOf(response.dialog)\n\t\t\t\t\t\tif (confirmIndex !== -1) {\n\t\t\t\t\t\t\tthis.activeDialogs.splice(confirmIndex, 1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tconst rawIndex = this.activeRawDialogs.indexOf(response.dialog)\n\t\t\t\t\t\tif (rawIndex !== -1) {\n\t\t\t\t\t\t\tthis.activeRawDialogs.splice(rawIndex, 1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove dialog from DOM immediately\n\t\t\t\t\t\tif (response.dialog.parentElement) {\n\t\t\t\t\t\t\tresponse.dialog.parentElement.removeChild(response.dialog)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\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\treturn new Promise((resolve, reject) => {\n\t\t\t// Apply default options\n\t\t\tconst completeOptions = {\n\t\t\t\t...DialogService.DEFAULT_OPTIONS,\n\t\t\t\t...options,\n\t\t\t}\n\n\t\t\t// If no position is provided, center the dialog\n\t\t\tif (!completeOptions.position) {\n\t\t\t\tcompleteOptions.position = this.getCenteredPosition()\n\t\t\t}\n\n\t\t\t// Create dialog target and emit to subject\n\t\t\tconst target: DialogTarget = {\n\t\t\t\toptions: completeOptions,\n\t\t\t\ttype: 'confirm',\n\t\t\t\tcontent: completeOptions.content,\n\t\t\t\tresolve,\n\t\t\t\treject,\n\t\t\t}\n\n\t\t\tthis.dialogSubject.next(target)\n\t\t})\n\t}\n\n\t/**\n\t * Show a dialog with custom component content\n\t * Always renders content directly without any headers or action buttons\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tpublic component(\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions: Omit<DialogOptions, 'content' | 'message'> = {},\n\t): Promise<boolean> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\t// If no position is provided, center the dialog\n\t\t\tif (!options.position) {\n\t\t\t\toptions.position = this.getCenteredPosition()\n\t\t\t}\n\n\t\t\t// Create dialog target and emit to subject\n\t\t\tconst target: DialogTarget = {\n\t\t\t\toptions: options as DialogOptions,\n\t\t\t\ttype: 'component',\n\t\t\t\tcontent,\n\t\t\t\tresolve,\n\t\t\t\treject,\n\t\t\t}\n\n\t\t\tthis.dialogSubject.next(target)\n\t\t})\n\t}\n\n\t/**\n\t * Dismiss the most recently opened dialog (either confirm or component type)\n\t * @returns true if a dialog was dismissed, false if no dialogs were open\n\t */\n\tpublic dismiss(): boolean {\n\t\t// Try component dialog first (they're more likely to be on top)\n\t\tif (this.activeRawDialogs.length > 0) {\n\t\t\t// Get the most recently opened raw dialog (last in the array)\n\t\t\tconst dialog = this.activeRawDialogs[this.activeRawDialogs.length - 1]\n\t\t\tconst uid = dialog.getAttribute('uid')\n\t\t\t\n\t\t\tif (uid) {\n\t\t\t\tthis.dismissSubject.next(uid)\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Fall back to confirm dialogs\n\t\tif (this.activeDialogs.length > 0) {\n\t\t\t// Get the most recently opened dialog (last in the array)\n\t\t\tconst dialog = this.activeDialogs[this.activeDialogs.length - 1]\n\t\t\tconst uid = dialog.getAttribute('uid')\n\t\t\t\n\t\t\tif (uid) {\n\t\t\t\tthis.dismissSubject.next(uid)\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\n\t\treturn false\n\t}\n\n\t/**\n\t * Close the most recently opened dialog (alias for dismiss)\n\t * @returns true if a dialog was closed, false if no dialogs were open\n\t */\n\tpublic close(): boolean {\n\t\treturn this.dismiss()\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,\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 * 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/**\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 when dialog is closed\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 * Show a simple dialog without title or actions, just content\n\t * This is an alias for component() since all component dialogs are now simple by design\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tsimple: (\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions?: Omit<DialogOptions, 'content' | 'message' | 'title' | 'confirmText' | 'cancelText'>,\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\t/**\n\t * Close the most recently opened dialog (alias for dismiss)\n\t * @returns true if a dialog was closed, false if no dialogs were open\n\t */\n\tclose: (): boolean => {\n\t\treturn DialogService.getInstance().close()\n\t},\n}\n\nexport default DialogService"],"names":["DialogWhereAreYouRicky","DialogHereMorty","DialogService","constructor","this","activeDialogs","activeRawDialogs","dialogSubject","Subject","dismissSubject","setupDialogOpeningLogic","setupDialogDismissLogic","instance","pipe","switchMap","forkJoin","fromEvent","window","takeUntil","timer","map","e","detail","defaultIfEmpty","of","target","tap","uid","type","Date","now","Math","random","toString","substring","dispatchEvent","CustomEvent","bubbles","composed","response","dialog","targetContainer","parentElement","theme","options","ThemeWhereAreYou","ThemeHereIAm","take","document","body","createElement","setAttribute","appendChild","querySelector","confirmDialog","title","subtitle","message","confirmText","cancelText","variant","confirmColor","width","style","setProperty","content","contentContainer","slot","result","HTMLElement","render","push","directContentContainer","height","classList","add","position","getCenteredPosition","show","then","resolve","index","indexOf","splice","contentEl","removeChild","parentNode","catch","error","reject","onConfirm","_e","removeEventListener","addEventListener","onCancel","subscribe","hide","confirmIndex","rawIndex","Promise","completeOptions","DEFAULT_OPTIONS","next","dismiss","length","getAttribute","close","event","confirm","x","innerWidth","y","innerHeight","_s","$dialog","getInstance","ask","danger","component","simple"],"mappings":"kGACaA,EAAyB,uBACzBC,EAAkB,kBCsClBC,EAAN,MAAMA,CAAAA,CA0BJ,aAAAC,CAZRC,KAAQC,cAAiC,CAAA,EAGzCD,KAAQE,iBAA0B,CAAA,EAGlCF,KAAQG,cAAgB,IAAIC,UAG5BJ,KAAQK,eAAiB,IAAID,UAI5BJ,KAAKM,wBAAAA,EACLN,KAAKO,wBAAAA,CACN,CAKA,OAAA,cAIC,OAHKT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,CAAAA,EAO5CwE,IAAK,CAAC3D,EAAiBkD,IACfzG,EAAciH,YAAAA,EAAcC,IAAI3D,EAASkD,CAAAA,EAOjDU,OAASzE,GACD1C,EAAciH,YAAAA,EAAcE,OAAOzE,CAAAA,EAO3C0E,UAAW,CACVrD,EACArB,IAEO1C,EAAciH,YAAAA,EAAcG,UAAUrD,EAASrB,CAAAA,EAQvD2E,OAAQ,CACPtD,EACArB,IAEO1C,EAAciH,YAAAA,EAAcG,UAAUrD,EAASrB,CAAAA,EAOvD2D,QAAS,IACDrG,EAAciH,YAAAA,EAAcZ,QAAAA,EAOpCG,MAAO,IACCxG,EAAciH,YAAAA,EAAcT,MAAAA,CAAAA"}
|
package/dist/dialog.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./dialog-content-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./dialog-content-tGl9B67L.cjs"),i=require("./dialog-service-JNWTLfAy.cjs");Object.defineProperty(exports,"ConfirmDialog",{enumerable:!0,get:()=>e.ConfirmDialog}),Object.defineProperty(exports,"SchmancyDialog",{enumerable:!0,get:()=>e.SchmancyDialog}),Object.defineProperty(exports,"SchmancyDialogContent",{enumerable:!0,get:()=>e.SchmancyDialogContent}),exports.$dialog=i.$dialog,exports.DialogService=i.DialogService;
|
|
2
2
|
//# sourceMappingURL=dialog.cjs.map
|
package/dist/dialog.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as i, S as r, a as c } from "./dialog-content-
|
|
2
|
-
import { $ as g, D as l } from "./dialog-service-
|
|
1
|
+
import { C as i, S as r, a as c } from "./dialog-content-C_paCOeM.js";
|
|
2
|
+
import { $ as g, D as l } from "./dialog-service-DZv4KB89.js";
|
|
3
3
|
export {
|
|
4
4
|
g as $dialog,
|
|
5
5
|
i as ConfirmDialog,
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("./animated-text-CtXY3MHV.cjs");const c=require("./area.component-DQ_erV9e.cjs"),t=require("./utils-C9nzOWpR.cjs");require("./autocomplete-PHnzqAII.cjs");const r=require("./avatar-CagKP9HD.cjs"),w=require("./boat-B_xZilsk.cjs");require("./spinner-CV62BBoF.cjs");const b=require("./icon-button-DbvjV5zJ.cjs");require("./media-CIuTybvD.cjs");const T=require("./checkbox-BAuVXvYL.cjs");require("./chips-Dg2otqDI.cjs");const I=require("./circular-progress-DZUJU-z3.cjs"),y=require("./code-preview-CYHNaPek.cjs"),M=require("./payment-card-form-ccF9dfGC.cjs"),d=require("./date-range-Cf9ldt-N.cjs"),R=require("./date-range-inline-Czq1wHs1.cjs"),g=require("./delay-FgtrEHdo.cjs"),l=require("./dialog-content-tiwbeegi.cjs"),p=require("./dialog-service-DUDhcx9X.cjs"),u=require("./ripple-C2BHbhcS.cjs");require("./divider-2yg9r1tF.cjs");const s=require("./dropdown-content-DJ4CA3ug.cjs"),f=require("./timezone-UBBApQoU.cjs");require("./form-Dpokur4M.cjs"),require("./icon-mhchC8Qw.cjs");const C=require("./input-DzNoI9qU.cjs"),o=require("./flex-DWnX0ZPR.cjs"),h=require("./list-DRbkWHho.cjs");require("./menu-DEbZxoXr.cjs");const i=require("./notification-service-B6nHqzq5.cjs");require("./option-BPmOG_Hw.cjs"),require("./progress-BqZ7yHQe.cjs");const O=require("./radio-button-WmbuT_YW.cjs"),A=require("./rxjs-utils.cjs");require("rxjs"),require("./index-DyJ0oDpR.cjs");const N=require("./select-CPnSionr.cjs"),m=require("./sheet-eCDoMdHF.cjs"),P=require("./slider-DBNoXRWS.cjs"),S=require("./schmancy-steps-container-CjAsrjKf.cjs"),a=require("./context-object-K_1gDFu-.cjs"),e=require("./selector-hook-DB8RFC1y.cjs"),j=require("./surface-ClfeUI6q.cjs"),D=require("./table-Rqnb4AJl.cjs");require("./tabs-compatibility-B1bE7hSG.cjs"),require("./textarea-Dlnyyrbq.cjs");const n=require("./theme.component-RtV3l-Ns.cjs"),v=require("./theme.interface-Xg5Zi46a.cjs");require("./theme-button-Cao8AH8r.cjs");const q=require("./tooltip-WpE4e-fO.cjs"),x=require("./tree-Dn0t7MUR.cjs"),E=require("./types.cjs"),B=require("./typewriter-DwLZUKKQ.cjs"),H=require("./typography-BhCrqK_b.cjs"),F=require("./intersection-CVvaDv96.cjs");exports.FINDING_MORTIES=c.FINDING_MORTIES,exports.HERE_RICKY=c.HERE_RICKY,exports.HISTORY_STRATEGY=c.HISTORY_STRATEGY,Object.defineProperty(exports,"SchmancyArea",{enumerable:!0,get:()=>c.SchmancyArea}),exports.area=c.area,exports.routerHistory=c.routerHistory,exports.buildQueryString=t.buildQueryString,exports.compareActiveRoutes=t.compareActiveRoutes,exports.compareCustomElementConstructors=t.compareCustomElementConstructors,exports.compareRouteActions=t.compareRouteActions,exports.createRouteCacheKey=t.createRouteCacheKey,exports.debounce=t.debounce,exports.decodeRouteState=t.decodeRouteState,exports.deepMerge=t.deepMerge,exports.encodeRouteState=t.encodeRouteState,exports.extractQueryParams=t.extractQueryParams,exports.getTagName=t.getTagName,exports.isObject=t.isObject,exports.normalizeTagName=t.normalizeTagName,exports.sanitizeRouteState=t.sanitizeRouteState,exports.$drawer=r.$drawer,exports.HereMorty=r.HereMorty,Object.defineProperty(exports,"ScBadgeV2",{enumerable:!0,get:()=>r.ScBadgeV2}),Object.defineProperty(exports,"SchmancyAvatar",{enumerable:!0,get:()=>r.SchmancyAvatar}),Object.defineProperty(exports,"SchmancyBadgeV2",{enumerable:!0,get:()=>r.SchmancyBadgeV2}),Object.defineProperty(exports,"SchmancyContentDrawer",{enumerable:!0,get:()=>r.SchmancyContentDrawer}),exports.SchmancyContentDrawerID=r.SchmancyContentDrawerID,Object.defineProperty(exports,"SchmancyContentDrawerMain",{enumerable:!0,get:()=>r.SchmancyContentDrawerMain}),exports.SchmancyContentDrawerMaxHeight=r.SchmancyContentDrawerMaxHeight,exports.SchmancyContentDrawerMinWidth=r.SchmancyContentDrawerMinWidth,Object.defineProperty(exports,"SchmancyContentDrawerSheet",{enumerable:!0,get:()=>r.SchmancyContentDrawerSheet}),exports.SchmancyContentDrawerSheetMode=r.SchmancyContentDrawerSheetMode,exports.SchmancyContentDrawerSheetState=r.SchmancyContentDrawerSheetState,Object.defineProperty(exports,"SchmancyDrawerAppbar",{enumerable:!0,get:()=>r.SchmancyDrawerAppbar}),exports.SchmancyDrawerNavbarMode=r.SchmancyDrawerNavbarMode,exports.SchmancyDrawerNavbarState=r.SchmancyDrawerNavbarState,Object.defineProperty(exports,"SchmancyNavigationDrawer",{enumerable:!0,get:()=>r.SchmancyNavigationDrawer}),Object.defineProperty(exports,"SchmancyNavigationDrawerContent",{enumerable:!0,get:()=>r.SchmancyNavigationDrawerContent}),Object.defineProperty(exports,"SchmancyNavigationDrawerSidebar",{enumerable:!0,get:()=>r.SchmancyNavigationDrawerSidebar}),Object.defineProperty(exports,"SchmancyTeleportation",{enumerable:!0,get:()=>r.SchmancyTeleportation}),exports.WhereAreYouRicky=r.WhereAreYouRicky,exports.schmancyContentDrawer=r.schmancyContentDrawer,exports.schmancyNavDrawer=r.schmancyNavDrawer,exports.teleport=r.teleport,Object.defineProperty(exports,"SchmancyBoat",{enumerable:!0,get:()=>w.SchmancyBoat}),Object.defineProperty(exports,"SchmancyButton",{enumerable:!0,get:()=>b.SchmancyButton}),Object.defineProperty(exports,"SchmnacyIconButton",{enumerable:!0,get:()=>b.SchmnacyIconButton}),Object.defineProperty(exports,"SchmancyCheckbox",{enumerable:!0,get:()=>T.SchmancyCheckbox}),Object.defineProperty(exports,"SchmancyCircularProgress",{enumerable:!0,get:()=>I.SchmancyCircularProgress}),Object.defineProperty(exports,"SchmancyCode",{enumerable:!0,get:()=>y.SchmancyCode}),Object.defineProperty(exports,"SchmancyCodeHighlight",{enumerable:!0,get:()=>y.SchmancyCode}),Object.defineProperty(exports,"SchmancyCodePreview",{enumerable:!0,get:()=>y.SchmancyCodePreview}),Object.defineProperty(exports,"SchmancyPaymentCardForm",{enumerable:!0,get:()=>M.SchmancyPaymentCardForm}),Object.defineProperty(exports,"SchmancyDateRange",{enumerable:!0,get:()=>d.SchmancyDateRange}),exports.validateInitialDateRange=d.validateInitialDateRange,Object.defineProperty(exports,"SchmancyDateRangeInline",{enumerable:!0,get:()=>R.SchmancyDateRangeInline}),Object.defineProperty(exports,"SchmancyDelay",{enumerable:!0,get:()=>g.SchmancyDelay}),exports.delayContext=g.delayContext,Object.defineProperty(exports,"ConfirmDialog",{enumerable:!0,get:()=>l.ConfirmDialog}),Object.defineProperty(exports,"SchmancyDialog",{enumerable:!0,get:()=>l.SchmancyDialog}),Object.defineProperty(exports,"SchmancyDialogContent",{enumerable:!0,get:()=>l.SchmancyDialogContent}),exports.$dialog=p.$dialog,exports.DialogService=p.DialogService,exports.color=u.color,exports.fullHeight=u.fullHeight,exports.ripple=u.ripple,Object.defineProperty(exports,"SchmancyDropdown",{enumerable:!0,get:()=>s.SchmancyDropdown}),Object.defineProperty(exports,"SchmancyDropdownContent",{enumerable:!0,get:()=>s.SchmancyDropdownContent}),Object.defineProperty(exports,"SchmancyCountriesSelect",{enumerable:!0,get:()=>f.SchmancyCountriesSelect}),Object.defineProperty(exports,"SchmancyTimezonesSelect",{enumerable:!0,get:()=>f.SchmancyTimezonesSelect}),Object.defineProperty(exports,"SchmancyInput",{enumerable:!0,get:()=>C.SchmancyInput}),Object.defineProperty(exports,"SchmancyInputCompat",{enumerable:!0,get:()=>C.SchmancyInputCompat}),Object.defineProperty(exports,"SchmancyFlex",{enumerable:!0,get:()=>o.SchmancyFlex}),Object.defineProperty(exports,"SchmancyFlexV2",{enumerable:!0,get:()=>o.SchmancyFlexV2}),Object.defineProperty(exports,"SchmancyGrid",{enumerable:!0,get:()=>o.SchmancyGrid}),Object.defineProperty(exports,"SchmancyScroll",{enumerable:!0,get:()=>o.SchmancyScroll}),Object.defineProperty(exports,"List",{enumerable:!0,get:()=>h.List}),Object.defineProperty(exports,"SchmancyListItem",{enumerable:!0,get:()=>h.SchmancyListItem}),exports.SchmancyListTypeContext=h.SchmancyListTypeContext,exports.$notify=i.$notify,exports.NotificationAudioService=i.NotificationAudioService,Object.defineProperty(exports,"SchmancyNotification",{enumerable:!0,get:()=>i.SchmancyNotification}),Object.defineProperty(exports,"SchmancyNotificationContainer",{enumerable:!0,get:()=>i.SchmancyNotificationContainer}),Object.defineProperty(exports,"RadioButton",{enumerable:!0,get:()=>O.RadioButton}),Object.defineProperty(exports,"RadioGroup",{enumerable:!0,get:()=>O.RadioGroup}),exports.mutationObserver=A.mutationObserver,Object.defineProperty(exports,"SchmancySelect",{enumerable:!0,get:()=>N.SchmancySelect}),exports.SchmancySheetPosition=m.SchmancySheetPosition,exports.SheetHereMorty=m.SheetHereMorty,exports.SheetWhereAreYouRicky=m.SheetWhereAreYouRicky,exports.sheet=m.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:()=>S.SchmancyStep}),Object.defineProperty(exports,"SchmancyStepsContainer",{enumerable:!0,get:()=>S.SchmancyStepsContainer}),exports.StepsController=S.StepsController,exports.stepsContext=S.stepsContext,exports.BaseStore=a.BaseStore,exports.IndexedDBStorageManager=a.IndexedDBStorageManager,exports.LocalStorageManager=a.LocalStorageManager,exports.MemoryStorageManager=a.MemoryStorageManager,exports.SchmancyArrayStore=a.SchmancyArrayStore,exports.SchmancyStoreObject=a.SchmancyStoreObject,exports.SessionStorageManager=a.SessionStorageManager,exports.StoreError=a.StoreError,exports.createStorageManager=a.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:()=>j.SchmancySurface}),exports.SchmancySurfaceTypeContext=j.SchmancySurfaceTypeContext,Object.defineProperty(exports,"SchmancyDataTable",{enumerable:!0,get:()=>D.SchmancyDataTable}),Object.defineProperty(exports,"SchmancyTableRow",{enumerable:!0,get:()=>D.SchmancyTableRow}),Object.defineProperty(exports,"SchmancyThemeComponent",{enumerable:!0,get:()=>n.SchmancyThemeComponent}),exports.ThemeHereIAm=n.ThemeHereIAm,exports.ThemeWhereAreYou=n.ThemeWhereAreYou,exports.formateTheme=n.formateTheme,exports.tailwindStyles=n.tailwindStyles,exports.SchmancyTheme=v.SchmancyTheme,Object.defineProperty(exports,"SchmancyTooltip",{enumerable:!0,get:()=>q.SchmancyTooltip}),exports.tooltip=q.tooltip,Object.defineProperty(exports,"SchmancyTree",{enumerable:!0,get:()=>x.SchmancyTree}),exports.SchmancyEvents=E.SchmancyEvents,Object.defineProperty(exports,"TypewriterElement",{enumerable:!0,get:()=>B.TypewriterElement}),Object.defineProperty(exports,"SchmancyTypography",{enumerable:!0,get:()=>H.SchmancyTypography}),exports.intersection$=F.intersection$;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("./animated-text-CtXY3MHV.cjs");const c=require("./area.component-DQ_erV9e.cjs"),t=require("./utils-C9nzOWpR.cjs");require("./autocomplete-CrhgxhFI.cjs");const r=require("./avatar-nwqyt3uc.cjs"),w=require("./boat-B_xZilsk.cjs");require("./spinner-CV62BBoF.cjs");const b=require("./icon-button-DbvjV5zJ.cjs");require("./media-CIuTybvD.cjs");const T=require("./checkbox-BAuVXvYL.cjs");require("./chips-Dg2otqDI.cjs");const I=require("./circular-progress-DZUJU-z3.cjs"),S=require("./code-preview-CYHNaPek.cjs"),M=require("./payment-card-form-ccF9dfGC.cjs"),d=require("./date-range-9NUFmKqd.cjs"),R=require("./date-range-inline-Czq1wHs1.cjs"),g=require("./delay-FgtrEHdo.cjs"),l=require("./dialog-content-tGl9B67L.cjs"),p=require("./dialog-service-JNWTLfAy.cjs"),u=require("./ripple-C2BHbhcS.cjs");require("./divider-2yg9r1tF.cjs");const s=require("./dropdown-content-DJ4CA3ug.cjs"),f=require("./timezone-UBBApQoU.cjs");require("./form-Dpokur4M.cjs"),require("./icon-mhchC8Qw.cjs");const C=require("./input-DzNoI9qU.cjs"),o=require("./flex-DWnX0ZPR.cjs"),h=require("./list-DRbkWHho.cjs");require("./menu-DEbZxoXr.cjs");const i=require("./notification-service-B6nHqzq5.cjs");require("./option-BPmOG_Hw.cjs"),require("./progress-BqZ7yHQe.cjs");const O=require("./radio-button-WmbuT_YW.cjs"),A=require("./rxjs-utils.cjs");require("rxjs"),require("./index-DyJ0oDpR.cjs");const N=require("./select-CPnSionr.cjs"),m=require("./sheet-eCDoMdHF.cjs"),P=require("./slider-DBNoXRWS.cjs"),y=require("./schmancy-steps-container-CjAsrjKf.cjs"),a=require("./context-object-K_1gDFu-.cjs"),e=require("./selector-hook-DB8RFC1y.cjs"),j=require("./surface-ClfeUI6q.cjs"),D=require("./table-Rqnb4AJl.cjs");require("./tabs-compatibility-B1bE7hSG.cjs"),require("./textarea-Dlnyyrbq.cjs");const n=require("./theme.component-RtV3l-Ns.cjs"),v=require("./theme.interface-Xg5Zi46a.cjs");require("./theme-button-Cao8AH8r.cjs");const q=require("./tooltip-WpE4e-fO.cjs"),x=require("./tree-Dn0t7MUR.cjs"),E=require("./types.cjs"),B=require("./typewriter-Fq4uV6Gm.cjs"),H=require("./typography-BhCrqK_b.cjs"),F=require("./intersection-CVvaDv96.cjs"),Y=require("./search-DWW8IoOp.cjs");exports.FINDING_MORTIES=c.FINDING_MORTIES,exports.HERE_RICKY=c.HERE_RICKY,exports.HISTORY_STRATEGY=c.HISTORY_STRATEGY,Object.defineProperty(exports,"SchmancyArea",{enumerable:!0,get:()=>c.SchmancyArea}),exports.area=c.area,exports.routerHistory=c.routerHistory,exports.buildQueryString=t.buildQueryString,exports.compareActiveRoutes=t.compareActiveRoutes,exports.compareCustomElementConstructors=t.compareCustomElementConstructors,exports.compareRouteActions=t.compareRouteActions,exports.createRouteCacheKey=t.createRouteCacheKey,exports.debounce=t.debounce,exports.decodeRouteState=t.decodeRouteState,exports.deepMerge=t.deepMerge,exports.encodeRouteState=t.encodeRouteState,exports.extractQueryParams=t.extractQueryParams,exports.getTagName=t.getTagName,exports.isObject=t.isObject,exports.normalizeTagName=t.normalizeTagName,exports.sanitizeRouteState=t.sanitizeRouteState,exports.$drawer=r.$drawer,exports.HereMorty=r.HereMorty,Object.defineProperty(exports,"ScBadgeV2",{enumerable:!0,get:()=>r.ScBadgeV2}),Object.defineProperty(exports,"SchmancyAvatar",{enumerable:!0,get:()=>r.SchmancyAvatar}),Object.defineProperty(exports,"SchmancyBadgeV2",{enumerable:!0,get:()=>r.SchmancyBadgeV2}),Object.defineProperty(exports,"SchmancyContentDrawer",{enumerable:!0,get:()=>r.SchmancyContentDrawer}),exports.SchmancyContentDrawerID=r.SchmancyContentDrawerID,Object.defineProperty(exports,"SchmancyContentDrawerMain",{enumerable:!0,get:()=>r.SchmancyContentDrawerMain}),exports.SchmancyContentDrawerMaxHeight=r.SchmancyContentDrawerMaxHeight,exports.SchmancyContentDrawerMinWidth=r.SchmancyContentDrawerMinWidth,Object.defineProperty(exports,"SchmancyContentDrawerSheet",{enumerable:!0,get:()=>r.SchmancyContentDrawerSheet}),exports.SchmancyContentDrawerSheetMode=r.SchmancyContentDrawerSheetMode,exports.SchmancyContentDrawerSheetState=r.SchmancyContentDrawerSheetState,Object.defineProperty(exports,"SchmancyDrawerAppbar",{enumerable:!0,get:()=>r.SchmancyDrawerAppbar}),exports.SchmancyDrawerNavbarMode=r.SchmancyDrawerNavbarMode,exports.SchmancyDrawerNavbarState=r.SchmancyDrawerNavbarState,Object.defineProperty(exports,"SchmancyNavigationDrawer",{enumerable:!0,get:()=>r.SchmancyNavigationDrawer}),Object.defineProperty(exports,"SchmancyNavigationDrawerContent",{enumerable:!0,get:()=>r.SchmancyNavigationDrawerContent}),Object.defineProperty(exports,"SchmancyNavigationDrawerSidebar",{enumerable:!0,get:()=>r.SchmancyNavigationDrawerSidebar}),Object.defineProperty(exports,"SchmancyTeleportation",{enumerable:!0,get:()=>r.SchmancyTeleportation}),exports.WhereAreYouRicky=r.WhereAreYouRicky,exports.schmancyContentDrawer=r.schmancyContentDrawer,exports.schmancyNavDrawer=r.schmancyNavDrawer,exports.teleport=r.teleport,Object.defineProperty(exports,"SchmancyBoat",{enumerable:!0,get:()=>w.SchmancyBoat}),Object.defineProperty(exports,"SchmancyButton",{enumerable:!0,get:()=>b.SchmancyButton}),Object.defineProperty(exports,"SchmnacyIconButton",{enumerable:!0,get:()=>b.SchmnacyIconButton}),Object.defineProperty(exports,"SchmancyCheckbox",{enumerable:!0,get:()=>T.SchmancyCheckbox}),Object.defineProperty(exports,"SchmancyCircularProgress",{enumerable:!0,get:()=>I.SchmancyCircularProgress}),Object.defineProperty(exports,"SchmancyCode",{enumerable:!0,get:()=>S.SchmancyCode}),Object.defineProperty(exports,"SchmancyCodeHighlight",{enumerable:!0,get:()=>S.SchmancyCode}),Object.defineProperty(exports,"SchmancyCodePreview",{enumerable:!0,get:()=>S.SchmancyCodePreview}),Object.defineProperty(exports,"SchmancyPaymentCardForm",{enumerable:!0,get:()=>M.SchmancyPaymentCardForm}),Object.defineProperty(exports,"SchmancyDateRange",{enumerable:!0,get:()=>d.SchmancyDateRange}),exports.validateInitialDateRange=d.validateInitialDateRange,Object.defineProperty(exports,"SchmancyDateRangeInline",{enumerable:!0,get:()=>R.SchmancyDateRangeInline}),Object.defineProperty(exports,"SchmancyDelay",{enumerable:!0,get:()=>g.SchmancyDelay}),exports.delayContext=g.delayContext,Object.defineProperty(exports,"ConfirmDialog",{enumerable:!0,get:()=>l.ConfirmDialog}),Object.defineProperty(exports,"SchmancyDialog",{enumerable:!0,get:()=>l.SchmancyDialog}),Object.defineProperty(exports,"SchmancyDialogContent",{enumerable:!0,get:()=>l.SchmancyDialogContent}),exports.$dialog=p.$dialog,exports.DialogService=p.DialogService,exports.color=u.color,exports.fullHeight=u.fullHeight,exports.ripple=u.ripple,Object.defineProperty(exports,"SchmancyDropdown",{enumerable:!0,get:()=>s.SchmancyDropdown}),Object.defineProperty(exports,"SchmancyDropdownContent",{enumerable:!0,get:()=>s.SchmancyDropdownContent}),Object.defineProperty(exports,"SchmancyCountriesSelect",{enumerable:!0,get:()=>f.SchmancyCountriesSelect}),Object.defineProperty(exports,"SchmancyTimezonesSelect",{enumerable:!0,get:()=>f.SchmancyTimezonesSelect}),Object.defineProperty(exports,"SchmancyInput",{enumerable:!0,get:()=>C.SchmancyInput}),Object.defineProperty(exports,"SchmancyInputCompat",{enumerable:!0,get:()=>C.SchmancyInputCompat}),Object.defineProperty(exports,"SchmancyFlex",{enumerable:!0,get:()=>o.SchmancyFlex}),Object.defineProperty(exports,"SchmancyFlexV2",{enumerable:!0,get:()=>o.SchmancyFlexV2}),Object.defineProperty(exports,"SchmancyGrid",{enumerable:!0,get:()=>o.SchmancyGrid}),Object.defineProperty(exports,"SchmancyScroll",{enumerable:!0,get:()=>o.SchmancyScroll}),Object.defineProperty(exports,"List",{enumerable:!0,get:()=>h.List}),Object.defineProperty(exports,"SchmancyListItem",{enumerable:!0,get:()=>h.SchmancyListItem}),exports.SchmancyListTypeContext=h.SchmancyListTypeContext,exports.$notify=i.$notify,exports.NotificationAudioService=i.NotificationAudioService,Object.defineProperty(exports,"SchmancyNotification",{enumerable:!0,get:()=>i.SchmancyNotification}),Object.defineProperty(exports,"SchmancyNotificationContainer",{enumerable:!0,get:()=>i.SchmancyNotificationContainer}),Object.defineProperty(exports,"RadioButton",{enumerable:!0,get:()=>O.RadioButton}),Object.defineProperty(exports,"RadioGroup",{enumerable:!0,get:()=>O.RadioGroup}),exports.mutationObserver=A.mutationObserver,Object.defineProperty(exports,"SchmancySelect",{enumerable:!0,get:()=>N.SchmancySelect}),exports.SchmancySheetPosition=m.SchmancySheetPosition,exports.SheetHereMorty=m.SheetHereMorty,exports.SheetWhereAreYouRicky=m.SheetWhereAreYouRicky,exports.sheet=m.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:()=>y.SchmancyStep}),Object.defineProperty(exports,"SchmancyStepsContainer",{enumerable:!0,get:()=>y.SchmancyStepsContainer}),exports.StepsController=y.StepsController,exports.stepsContext=y.stepsContext,exports.BaseStore=a.BaseStore,exports.IndexedDBStorageManager=a.IndexedDBStorageManager,exports.LocalStorageManager=a.LocalStorageManager,exports.MemoryStorageManager=a.MemoryStorageManager,exports.SchmancyArrayStore=a.SchmancyArrayStore,exports.SchmancyStoreObject=a.SchmancyStoreObject,exports.SessionStorageManager=a.SessionStorageManager,exports.StoreError=a.StoreError,exports.createStorageManager=a.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:()=>j.SchmancySurface}),exports.SchmancySurfaceTypeContext=j.SchmancySurfaceTypeContext,Object.defineProperty(exports,"SchmancyDataTable",{enumerable:!0,get:()=>D.SchmancyDataTable}),Object.defineProperty(exports,"SchmancyTableRow",{enumerable:!0,get:()=>D.SchmancyTableRow}),Object.defineProperty(exports,"SchmancyThemeComponent",{enumerable:!0,get:()=>n.SchmancyThemeComponent}),exports.ThemeHereIAm=n.ThemeHereIAm,exports.ThemeWhereAreYou=n.ThemeWhereAreYou,exports.formateTheme=n.formateTheme,exports.tailwindStyles=n.tailwindStyles,exports.SchmancyTheme=v.SchmancyTheme,Object.defineProperty(exports,"SchmancyTooltip",{enumerable:!0,get:()=>q.SchmancyTooltip}),exports.tooltip=q.tooltip,Object.defineProperty(exports,"SchmancyTree",{enumerable:!0,get:()=>x.SchmancyTree}),exports.SchmancyEvents=E.SchmancyEvents,Object.defineProperty(exports,"TypewriterElement",{enumerable:!0,get:()=>B.TypewriterElement}),Object.defineProperty(exports,"SchmancyTypography",{enumerable:!0,get:()=>H.SchmancyTypography}),exports.intersection$=F.intersection$,exports.similarity=Y.similarity;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import "./animated-text-D26Fv13t.js";
|
|
2
2
|
import { F as d, H as g, b as u, S as D, a as w, r as T } from "./area.component-BCcq9Nb7.js";
|
|
3
3
|
import { l as I, h as M, c as R, f as A, j as v, a as N, b as H, d as B, e as E, k as F, g as O, i as $, n as j, s as k } from "./utils-03Coa8AW.js";
|
|
4
|
-
import "./autocomplete-
|
|
5
|
-
import { $ as P, H as Y, a as z, r as G, S as V, g as W, d as K, h as _, e as q, f as Q, i as J, b as U, c as X, k as Z, m as aa, n as ea, o as ra, l as ta, p as oa, q as sa, W as ca, s as na, j as ma, t as Sa } from "./avatar-
|
|
4
|
+
import "./autocomplete-CkycjWy4.js";
|
|
5
|
+
import { $ as P, H as Y, a as z, r as G, S as V, g as W, d as K, h as _, e as q, f as Q, i as J, b as U, c as X, k as Z, m as aa, n as ea, o as ra, l as ta, p as oa, q as sa, W as ca, s as na, j as ma, t as Sa } from "./avatar-2RMudsVg.js";
|
|
6
6
|
import { S as ya } from "./boat-C_BvtlNQ.js";
|
|
7
7
|
import "./spinner-CbA-FXRK.js";
|
|
8
|
-
import { S as
|
|
8
|
+
import { S as ha, a as la } from "./icon-button-BGvSPuE-.js";
|
|
9
9
|
import "./media-BO-aZBTp.js";
|
|
10
10
|
import { S as xa } from "./checkbox-BSYgpRsc.js";
|
|
11
11
|
import "./chips-Dn8RpKCE.js";
|
|
12
12
|
import { S as da } from "./circular-progress-B1RjFzcp.js";
|
|
13
13
|
import { S as ua, S as Da, a as wa } from "./code-preview-JlSLKkKg.js";
|
|
14
14
|
import { S as ba } from "./payment-card-form-Cs5bP5Di.js";
|
|
15
|
-
import { S as Ma, v as Ra } from "./date-range-
|
|
15
|
+
import { S as Ma, v as Ra } from "./date-range-8o_f5N7V.js";
|
|
16
16
|
import { S as va } from "./date-range-inline-B_K4YPtB.js";
|
|
17
17
|
import { S as Ha, d as Ba } from "./delay-D415_oVH.js";
|
|
18
|
-
import { C as Fa, S as Oa, a as $a } from "./dialog-content-
|
|
19
|
-
import { $ as ka, D as La } from "./dialog-service-
|
|
18
|
+
import { C as Fa, S as Oa, a as $a } from "./dialog-content-C_paCOeM.js";
|
|
19
|
+
import { $ as ka, D as La } from "./dialog-service-DZv4KB89.js";
|
|
20
20
|
import { c as Ya, f as za, r as Ga } from "./ripple-BumgqsDT.js";
|
|
21
21
|
import "./divider-Dn26vIou.js";
|
|
22
22
|
import { S as Wa, a as Ka } from "./dropdown-content-DOnGrBxV.js";
|
|
@@ -27,7 +27,7 @@ import { S as Ua, a as Xa } from "./input-Cpo-ws8k.js";
|
|
|
27
27
|
import { S as ae, c as ee, a as re, b as te } from "./flex-DV2W2Zgu.js";
|
|
28
28
|
import { L as se, a as ce, S as ne } from "./list-BTyoQ42F.js";
|
|
29
29
|
import "./menu-DWCDQvGY.js";
|
|
30
|
-
import { $ as Se, N as ie, S as ye, a as
|
|
30
|
+
import { $ as Se, N as ie, S as ye, a as pe } from "./notification-service-L_h9_d4v.js";
|
|
31
31
|
import "./option-vRGeXw_u.js";
|
|
32
32
|
import "./progress-DM_jha7D.js";
|
|
33
33
|
import { a as le, R as fe } from "./radio-button-YDzqdRA-.js";
|
|
@@ -39,10 +39,10 @@ import { S as De, b as we, a as Te, s as be } from "./sheet-Cw2qLdzN.js";
|
|
|
39
39
|
import { S as Me, a as Re } from "./slider-C7Z1bPq7.js";
|
|
40
40
|
import { S as ve, a as Ne, b as He, s as Be } from "./schmancy-steps-container-CoARMXfB.js";
|
|
41
41
|
import { B as Fe, I as Oe, L as $e, M as je, S as ke, a as Le, b as Pe, d as Ye, c as ze } from "./context-object-CDDP4bTk.js";
|
|
42
|
-
import { p as Ve, a as We, v as Ke, G as _e, c as qe, E as Qe, z as Je, C as Ue, B as Xe, x as Ze, w as ar, y as er, D as rr, F as tr, u as or, A as sr, b as cr, r as nr, d as mr, q as Sr, f as ir, g as yr, i as
|
|
42
|
+
import { p as Ve, a as We, v as Ke, G as _e, c as qe, E as Qe, z as Je, C as Ue, B as Xe, x as Ze, w as ar, y as er, D as rr, F as tr, u as or, A as sr, b as cr, r as nr, d as mr, q as Sr, f as ir, g as yr, i as pr, j as hr, k as lr, l as fr, o as xr, h as Cr, n as dr, m as gr, e as ur, s as Dr, t as wr } from "./selector-hook-CIpuCUbr.js";
|
|
43
43
|
import { a as br, S as Ir } from "./surface-By8o7nWa.js";
|
|
44
44
|
import { a as Rr, S as Ar } from "./table-CvMo5lOi.js";
|
|
45
|
-
import "./tabs-compatibility-
|
|
45
|
+
import "./tabs-compatibility-BEXurIiZ.js";
|
|
46
46
|
import "./textarea-DM3lgEUp.js";
|
|
47
47
|
import { S as Nr, a as Hr, T as Br, f as Er, t as Fr } from "./theme.component-ColRTbY5.js";
|
|
48
48
|
import { S as $r } from "./theme.interface-C5Kj6WjD.js";
|
|
@@ -50,9 +50,10 @@ import "./theme-button-C4JWRMiC.js";
|
|
|
50
50
|
import { S as kr, t as Lr } from "./tooltip-nwQwCEgl.js";
|
|
51
51
|
import { S as Yr } from "./tree-BDmB7KmQ.js";
|
|
52
52
|
import { SchmancyEvents as Gr } from "./types.js";
|
|
53
|
-
import { T as Wr } from "./typewriter-
|
|
53
|
+
import { T as Wr } from "./typewriter-DMKxup-I.js";
|
|
54
54
|
import { S as _r } from "./typography-DYCOngD7.js";
|
|
55
55
|
import { i as Qr } from "./intersection-CJxzz8c-.js";
|
|
56
|
+
import { s as Ur } from "./search-6Hr7K1gh.js";
|
|
56
57
|
export {
|
|
57
58
|
ka as $dialog,
|
|
58
59
|
P as $drawer,
|
|
@@ -77,7 +78,7 @@ export {
|
|
|
77
78
|
G as SchmancyAvatar,
|
|
78
79
|
V as SchmancyBadgeV2,
|
|
79
80
|
ya as SchmancyBoat,
|
|
80
|
-
|
|
81
|
+
ha as SchmancyButton,
|
|
81
82
|
xa as SchmancyCheckbox,
|
|
82
83
|
da as SchmancyCircularProgress,
|
|
83
84
|
ua as SchmancyCode,
|
|
@@ -115,7 +116,7 @@ export {
|
|
|
115
116
|
ta as SchmancyNavigationDrawerContent,
|
|
116
117
|
oa as SchmancyNavigationDrawerSidebar,
|
|
117
118
|
ye as SchmancyNotification,
|
|
118
|
-
|
|
119
|
+
pe as SchmancyNotificationContainer,
|
|
119
120
|
ba as SchmancyPaymentCardForm,
|
|
120
121
|
te as SchmancyScroll,
|
|
121
122
|
ge as SchmancySelect,
|
|
@@ -185,8 +186,8 @@ export {
|
|
|
185
186
|
yr as getFieldValue,
|
|
186
187
|
O as getTagName,
|
|
187
188
|
Qr as intersection$,
|
|
188
|
-
|
|
189
|
-
|
|
189
|
+
pr as isArray,
|
|
190
|
+
hr as isDate,
|
|
190
191
|
lr as isIterable,
|
|
191
192
|
fr as isMap,
|
|
192
193
|
xr as isNil,
|
|
@@ -205,6 +206,7 @@ export {
|
|
|
205
206
|
Dr as select,
|
|
206
207
|
wr as selectItem,
|
|
207
208
|
be as sheet,
|
|
209
|
+
Ur as similarity,
|
|
208
210
|
Be as stepsContext,
|
|
209
211
|
Fr as tailwindStyles,
|
|
210
212
|
Sa as teleport,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/nav-drawer.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./avatar-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./avatar-nwqyt3uc.cjs");exports.$drawer=e.$drawer,Object.defineProperty(exports,"SchmancyDrawerAppbar",{enumerable:!0,get:()=>e.SchmancyDrawerAppbar}),exports.SchmancyDrawerNavbarMode=e.SchmancyDrawerNavbarMode,exports.SchmancyDrawerNavbarState=e.SchmancyDrawerNavbarState,Object.defineProperty(exports,"SchmancyNavigationDrawer",{enumerable:!0,get:()=>e.SchmancyNavigationDrawer}),Object.defineProperty(exports,"SchmancyNavigationDrawerContent",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerContent}),Object.defineProperty(exports,"SchmancyNavigationDrawerSidebar",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerSidebar}),exports.schmancyNavDrawer=e.schmancyNavDrawer;
|
|
2
2
|
//# sourceMappingURL=nav-drawer.cjs.map
|
package/dist/nav-drawer.js
CHANGED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
function w(s, u) {
|
|
2
|
+
if (!s || !u) return 0;
|
|
3
|
+
if (s === u) return 1;
|
|
4
|
+
const r = s.toLowerCase().trim(), o = u.toLowerCase().trim();
|
|
5
|
+
if (r === o) return 1;
|
|
6
|
+
if (o.startsWith(r))
|
|
7
|
+
return 0.95 + 0.05 * (r.length / o.length);
|
|
8
|
+
const c = o.split(/[\s\-_]+/);
|
|
9
|
+
for (const n of c) if (n.startsWith(r))
|
|
10
|
+
return 0.85 * (1 - c.indexOf(n) / c.length * 0.1);
|
|
11
|
+
if (o.includes(r))
|
|
12
|
+
return 0.7 * (1 - o.indexOf(r) / o.length * 0.2);
|
|
13
|
+
if (function(n, l) {
|
|
14
|
+
let e = 0, t = 0;
|
|
15
|
+
for (; e < n.length && t < l.length; ) n[e] === l[t] && e++, t++;
|
|
16
|
+
return e === n.length;
|
|
17
|
+
}(r, o)) return 0.5;
|
|
18
|
+
const x = function(n, l) {
|
|
19
|
+
if (n.length < 2 || l.length < 2) return 0;
|
|
20
|
+
const e = m(n), t = m(l);
|
|
21
|
+
let f = 0;
|
|
22
|
+
const h = new Array(t.length).fill(!1);
|
|
23
|
+
for (const g of e) for (let i = 0; i < t.length; i++) if (!h[i] && t[i] === g) {
|
|
24
|
+
f++, h[i] = !0;
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
return 2 * f / (e.length + t.length);
|
|
28
|
+
}(r, o), a = Math.max(r.length, o.length), d = function(n, l) {
|
|
29
|
+
if (n.length === 0) return l.length;
|
|
30
|
+
if (l.length === 0) return n.length;
|
|
31
|
+
const e = [];
|
|
32
|
+
for (let t = 0; t <= l.length; t++) e[t] = [t];
|
|
33
|
+
for (let t = 0; t <= n.length; t++) e[0][t] = t;
|
|
34
|
+
for (let t = 1; t <= l.length; t++) for (let f = 1; f <= n.length; f++) {
|
|
35
|
+
const h = n[f - 1] === l[t - 1] ? 0 : 1;
|
|
36
|
+
e[t][f] = Math.min(e[t - 1][f] + 1, e[t][f - 1] + 1, e[t - 1][f - 1] + h);
|
|
37
|
+
}
|
|
38
|
+
return e[l.length][n.length];
|
|
39
|
+
}(r, o), p = a ? 1 - d / a : 0, b = function(n, l) {
|
|
40
|
+
const e = (h) => h.split("").reduce((g, i) => (g[i] = (g[i] || 0) + 1, g), {}), t = e(n), f = e(l);
|
|
41
|
+
return Object.keys(t).every((h) => (f[h] || 0) >= t[h]);
|
|
42
|
+
}(r, o) ? 0.3 : 0;
|
|
43
|
+
return Math.max(0.4 * x, 0.4 * p, b);
|
|
44
|
+
}
|
|
45
|
+
function m(s) {
|
|
46
|
+
const u = [];
|
|
47
|
+
for (let r = 0; r < s.length - 1; r++) u.push(s.substring(r, r + 2));
|
|
48
|
+
return u;
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
w as s
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=search-6Hr7K1gh.js.map
|