@eherve/angular-material-display-dialog 0.0.0-stage → 22.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eherve-angular-material-display-dialog.mjs","names":["i2","i2","i3"],"sources":["../../../projects/display-dialog/src/lib/display-dialog.intl.ts","../../../projects/display-dialog/src/lib/internal/confirmation-dialog/confirmation-dialog.component.ts","../../../projects/display-dialog/src/lib/internal/json-dialog/json-dialog.component.ts","../../../projects/display-dialog/src/lib/display-dialog-host.ts","../../../projects/display-dialog/src/lib/display-dialog.component.ts","../../../projects/display-dialog/src/lib/display-dialog.component.html","../../../projects/display-dialog/src/lib/display-dialog.service.ts","../../../projects/display-dialog/src/lib/display-dialog.module.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\nexport interface DisplayDialogMessages {\n loadingLabel: string;\n closeLabel: string;\n emptyLabel: string;\n errorLabel: string;\n actionErrorLabel: string;\n jsonTitle: string;\n jsonButtonLabel: string;\n recordLabel: string;\n confirmTitle: string;\n confirmOk: string;\n confirmCancel: string;\n emptyContentLabel: string;\n}\n\n@Injectable({providedIn: 'root'})\nexport class DisplayDialogIntl {\n readonly changes = new Subject<void>();\n messages: DisplayDialogMessages = {\n loadingLabel: 'Chargement des données',\n closeLabel: 'Fermer',\n emptyLabel: 'Aucune donnée à afficher.',\n errorLabel: 'Impossible de charger les données.',\n actionErrorLabel: \"Impossible d’exécuter cette action.\",\n jsonTitle: 'Données JSON',\n jsonButtonLabel: 'Afficher les données JSON',\n recordLabel: 'Record',\n confirmTitle: 'Confirmation',\n confirmOk: 'Oui',\n confirmCancel: 'Non',\n emptyContentLabel: 'Aucun contenu à afficher.',\n };\n}\n","import { ChangeDetectionStrategy, ChangeDetectorRef, Component, inject } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';\nimport { MatButtonModule } from '@angular/material/button';\nimport { DisplayDialogConfirmOptions } from '../../display-dialog.types';\nimport { DisplayDialogIntl } from '../../display-dialog.intl';\n\n@Component({\n selector: 'ngx-mat-display-confirmation',\n imports: [MatDialogModule, MatButtonModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <h2 mat-dialog-title>{{data.title ?? intl.messages.confirmTitle}}</h2>\n <mat-dialog-content>{{data.message}}</mat-dialog-content>\n <mat-dialog-actions align=\"end\">\n <button mat-button [mat-dialog-close]=\"false\">{{data.cancel ?? intl.messages.confirmCancel}}</button>\n <button mat-button [mat-dialog-close]=\"true\">{{data.ok ?? intl.messages.confirmOk}}</button>\n </mat-dialog-actions>`,\n})\nexport class DisplayConfirmationDialog {\n readonly data = inject<DisplayDialogConfirmOptions>(MAT_DIALOG_DATA);\n readonly intl = inject(DisplayDialogIntl);\n\n constructor() {\n const changeDetectorRef = inject(ChangeDetectorRef);\n this.intl.changes.pipe(takeUntilDestroyed()).subscribe(() => changeDetectorRef.markForCheck());\n }\n}\n","import { ChangeDetectionStrategy, ChangeDetectorRef, Component, inject } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { JsonPipe } from '@angular/common';\nimport { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';\nimport { MatButtonModule } from '@angular/material/button';\nimport { DisplayDialogJsonSource } from '../../display-dialog-host';\nimport { DisplayDialogIntl } from '../../display-dialog.intl';\n\n@Component({\n selector: 'ngx-mat-display-json',\n imports: [MatDialogModule, MatButtonModule, JsonPipe],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <h2 mat-dialog-title>{{data.title}}</h2>\n <mat-dialog-content>\n @for (source of data.sources; track $index) {\n <h3>{{source.label}}</h3><pre>{{source.value | json}}</pre>\n }\n </mat-dialog-content>\n <mat-dialog-actions><button mat-button mat-dialog-close>{{intl.messages.closeLabel}}</button></mat-dialog-actions>`,\n styles: ['pre {white-space: pre-wrap; overflow-wrap: anywhere;}'],\n})\nexport class DisplayJsonDialog {\n readonly data = inject<{title: string; sources: readonly DisplayDialogJsonSource[]}>(MAT_DIALOG_DATA);\n readonly intl = inject(DisplayDialogIntl);\n\n constructor() {\n const changeDetectorRef = inject(ChangeDetectorRef);\n this.intl.changes.pipe(takeUntilDestroyed()).subscribe(() => changeDetectorRef.markForCheck());\n }\n}\n","import { Injectable, InjectionToken, inject } from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport { firstValueFrom } from 'rxjs';\nimport { DisplayDialogConfirmOptions } from './display-dialog.types';\nimport { DisplayConfirmationDialog } from './internal/confirmation-dialog/confirmation-dialog.component';\nimport { DisplayJsonDialog } from './internal/json-dialog/json-dialog.component';\nexport interface DisplayDialogJsonSource { label: string; value: unknown; }\nexport interface DisplayDialogHost {\n confirm(options: DisplayDialogConfirmOptions): Promise<boolean>;\n showJson(title: string, sources: readonly DisplayDialogJsonSource[]): void;\n}\n@Injectable({providedIn: 'root'})\nclass DefaultDisplayDialogHost implements DisplayDialogHost {\n private readonly dialog = inject(MatDialog);\n async confirm(options: DisplayDialogConfirmOptions): Promise<boolean> {\n return (await firstValueFrom(this.dialog.open(DisplayConfirmationDialog, {data: options}).afterClosed())) === true;\n }\n showJson(title: string, sources: readonly DisplayDialogJsonSource[]): void {\n this.dialog.open(DisplayJsonDialog, {width: '80vw', maxHeight: '90vh', data: {title, sources}});\n }\n}\nexport const DISPLAY_DIALOG_HOST = new InjectionToken<DisplayDialogHost>('DISPLAY_DIALOG_HOST', {providedIn: 'root', factory: () => inject(DefaultDisplayDialogHost)});\n","/** @format */\n\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n Inject,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Optional,\n SimpleChanges,\n Type,\n inject,\n reflectComponentType,\n ErrorHandler,\n} from '@angular/core';\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\nimport { Subject, firstValueFrom, isObservable, takeUntil } from 'rxjs';\nimport {\n SectionTabsDisplayCard,\n SectionTabsDisplayCardAction,\n SectionTabsDisplayOptions,\n SectionTabsDisplaySection,\n} from '@eherve/angular-material-section-tabs';\n\nimport {\n DisplayDialogCardMenuOption,\n DisplayDialogCardActionContext,\n DisplayDialogCardActionState,\n DisplayDialogCardAction,\n DisplayDialogSectionCard,\n DisplayDialogSection,\n DisplayDialogSectionsOptions,\n DisplayDialogComponentOptions,\n DisplayDialogSingleSectionOptions,\n DisplayDialogTabOptions,\n DisplayDialogTabsOptions,\n DisplayDialogOptions,\n DisplayDialogTitle,\n DisplayDialogActionPosition,\n DisplayDialogConfirmOptions,\n DisplayDialogActionContext,\n DisplayDialogActionState,\n DisplayDialogActionButton,\n DisplayDialogRuntimeActionButton,\n DisplayDialogData,\n DisplayDialogConnection,\n DisplayDialogActionComponent,\n} from './display-dialog.types';\nimport { DISPLAY_DIALOG_HOST } from './display-dialog-host';\nimport { DisplayDialogIntl } from './display-dialog.intl';\n\ntype ComponentInputs = Record<string, unknown>;\n\ntype DisplayDialogRuntimeAction<TRecord extends object> = DisplayDialogRuntimeActionButton<TRecord> | (DisplayDialogActionComponent<TRecord> & {componentInputs: ComponentInputs; isVisible: boolean});\n\ninterface DisplayDialogRuntimeCardMenuOption {\n id: string;\n label: string;\n icon?: string;\n tooltip?: string;\n ariaLabel?: string;\n disabled: boolean;\n handle: () => void;\n}\n\ninterface DisplayDialogRuntimeCardAction {\n id?: string;\n type: 'icon' | 'button';\n icon?: string;\n label?: string;\n tooltip?: string;\n ariaLabel?: string;\n color?: string;\n disabled: boolean;\n menuOptions?: DisplayDialogRuntimeCardMenuOption[];\n handle: () => void;\n}\n\ntype DisplayDialogRenderKind = 'tabs' | 'sections' | 'component' | 'section' | 'empty';\n\ninterface DisplayDialogTabRenderState<TRecord extends object> {\n label: string;\n icon?: string;\n svgIcon?: string;\n badge?: number;\n renderState: DisplayDialogRenderState<TRecord>;\n}\n\ninterface DisplayDialogRenderState<TRecord extends object> {\n kind: DisplayDialogRenderKind;\n tabs?: DisplayDialogTabRenderState<TRecord>[];\n sectionsOptions?: SectionTabsDisplayOptions;\n sectionsMenuHeader?: string;\n component?: Type<unknown>;\n componentInputs?: ComponentInputs;\n componentOverflow?: boolean;\n singleSectionOptions?: SectionTabsDisplayOptions;\n}\n\n@Component({\n selector: 'app-display-dialog',\n templateUrl: './display-dialog.component.html',\n styleUrls: ['./display-dialog.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false,\n})\nexport class DisplayDialog<TRecord extends object> implements OnInit, OnChanges, OnDestroy {\n readonly intl = inject(DisplayDialogIntl);\n @Input() data?: DisplayDialogData<TRecord>;\n\n loading = true;\n loadingLabel = this.intl.messages.loadingLabel;\n errorLabel = '';\n title = '';\n subtitle = '';\n closeLabel = this.intl.messages.closeLabel;\n showCloseButton = false;\n handlingAction = false;\n actions: DisplayDialogRuntimeAction<TRecord>[] = [];\n actionErrorLabel = '';\n renderState: DisplayDialogRenderState<TRecord> = { kind: 'empty' };\n readonly recordChange = new EventEmitter<TRecord>();\n readonly isDialog: boolean;\n\n private readonly changeDetectorRef = inject(ChangeDetectorRef);\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly componentInputNamesByType = new WeakMap<Type<unknown>, ReadonlySet<string>>();\n private initializeVersion = 0;\n private destroyed = false;\n private recordErrorKind?: 'empty' | 'error';\n private actionFailed = false;\n private connection?: DisplayDialogConnection<TRecord>;\n private readonly cancelLoad = new Subject<void>();\n private dialogDataResolved?: DisplayDialogData<TRecord>;\n private record?: TRecord;\n private readonly host = inject(DISPLAY_DIALOG_HOST);\n private readonly errorHandler = inject(ErrorHandler);\n private readonly intlSubscription = this.intl.changes.subscribe(() => this.refreshIntlLabels());\n\n constructor(\n @Optional() @Inject(MAT_DIALOG_DATA) private readonly dialogData: DisplayDialogData<TRecord> | null,\n @Optional() private readonly dialogRef: MatDialogRef<DisplayDialog<TRecord>> | null,\n ) {\n this.isDialog = this.dialogRef !== null;\n }\n\n ngOnInit(): void {\n if (!this.data && this.dialogData) this.data = this.dialogData;\n void this.initialize();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['data'] && !changes['data'].firstChange) void this.initialize();\n }\n\n ngOnDestroy(): void {\n this.destroyed = true;\n this.intlSubscription.unsubscribe();\n ++this.initializeVersion;\n this.cancelLoad.next();\n this.cancelLoad.complete();\n this.releaseConnection();\n this.recordChange.complete();\n }\n\n openJsonDataDialog(): void {\n if (this.record === undefined) return;\n this.host.showJson(this.resolveJsonDialogTitle(), [{label: this.intl.messages.recordLabel, value: this.record}]);\n }\n\n close(result?: unknown): void {\n this.dialogRef?.close(result);\n }\n\n getActions(position: DisplayDialogActionPosition): DisplayDialogRuntimeAction<TRecord>[] {\n return this.actions.filter(action => (action.position ?? 'bottom') === position && action.isVisible);\n }\n\n trackAction(index: number, action: DisplayDialogRuntimeAction<TRecord>): string | number {\n return 'component' in action ? index : action.label || action.icon || index;\n }\n\n async handleAction(action: DisplayDialogRuntimeActionButton<TRecord>): Promise<void> {\n if (this.record === undefined || this.destroyed || !this.dialogDataResolved) return;\n const context = this.buildActionContext(action);\n if (!this.resolveActionState(action.visible, context, true) || this.resolveActionState(action.disabled, context, false)) return;\n await this.runAction(action.confirm, () => action.handle(context), action.closeOnHandle);\n }\n\n private async runAction(confirm: string | DisplayDialogConfirmOptions | undefined, handle: () => unknown | Promise<unknown>, closeOnHandle?: boolean): Promise<void> {\n if (this.handlingAction || this.destroyed) return;\n const version = this.initializeVersion;\n this.handlingAction = true;\n this.actionErrorLabel = '';\n this.actionFailed = false;\n this.changeDetectorRef.markForCheck();\n try {\n if (!(await this.confirmAction(confirm)) || this.destroyed || version !== this.initializeVersion) return;\n const result = await handle();\n if (this.destroyed || version !== this.initializeVersion) return;\n this.refreshDisplayState();\n if (closeOnHandle) this.close(result);\n } catch (error) {\n this.reportError(error);\n if (!this.destroyed && version === this.initializeVersion) {\n this.actionFailed = true;\n this.actionErrorLabel = this.intl.messages.actionErrorLabel;\n }\n } finally {\n if (!this.destroyed && version === this.initializeVersion) {\n this.handlingAction = false;\n this.changeDetectorRef.markForCheck();\n }\n }\n }\n\n private resolveJsonDialogTitle(): string {\n const title = (this.elementRef.nativeElement as HTMLElement)\n .querySelector<HTMLElement>('.display-dialog-title-content h2')\n ?.textContent?.trim();\n return title || this.intl.messages.jsonTitle;\n }\n\n private async initialize(): Promise<void> {\n if (this.destroyed) return;\n const version = ++this.initializeVersion;\n this.cancelLoad.next();\n this.releaseConnection();\n const data = this.data ?? this.dialogData ?? undefined;\n\n this.loading = true;\n this.errorLabel = '';\n this.recordErrorKind = undefined;\n this.actionErrorLabel = '';\n this.actionFailed = false;\n\n this.record = undefined;\n this.dialogDataResolved = data;\n this.actions = [];\n this.handlingAction = false;\n this.renderState = { kind: 'empty' };\n this.changeDetectorRef.markForCheck();\n\n if (!data) {\n this.finishWithoutRecord('empty');\n return;\n }\n\n this.loadingLabel = data.loadingLabel ?? this.intl.messages.loadingLabel;\n this.closeLabel = data.closeLabel ?? this.intl.messages.closeLabel;\n this.showCloseButton = data.showCloseButton ?? !!this.dialogRef;\n\n try {\n this.connection = data.connect?.();\n const record = 'record' in data && data.record != null ? data.record : await this.resolveRecord(data);\n if (this.destroyed || version !== this.initializeVersion) return;\n\n if (!record) {\n this.finishWithoutRecord('empty');\n return;\n }\n\n this.record = record;\n this.notifyRecord(record);\n\n this.refreshDisplayState();\n this.loading = false;\n this.changeDetectorRef.detectChanges();\n } catch (err) {\n if (this.destroyed || version !== this.initializeVersion) return;\n this.reportError(err);\n this.finishWithoutRecord('error');\n }\n }\n\n private async resolveRecord(data: DisplayDialogData<TRecord>): Promise<TRecord | null> {\n if ('record' in data && data.record !== undefined && data.record !== null) return data.record;\n\n if (!data.loadRecord) return null;\n\n const loadedRecord = data.loadRecord();\n if (isObservable(loadedRecord)) return firstValueFrom(loadedRecord.pipe(takeUntil(this.cancelLoad)), {defaultValue: null});\n return loadedRecord;\n }\n\n private buildRenderState(data: DisplayDialogData<TRecord>, record: TRecord): DisplayDialogRenderState<TRecord> {\n return this.buildOptionsRenderState(data, this.resolveDisplayOptions(data, record), record);\n }\n\n private resolveDisplayOptions(\n data: DisplayDialogData<TRecord>,\n record: TRecord,\n ): DisplayDialogOptions<TRecord> {\n if (typeof data.displayOptions !== 'function') return data.displayOptions;\n return data.displayOptions({ record, data });\n }\n\n private buildOptionsRenderState(\n data: DisplayDialogData<TRecord>,\n displayOptions: DisplayDialogOptions<TRecord>,\n record: TRecord,\n ): DisplayDialogRenderState<TRecord> {\n if (this.isTabsOptions(displayOptions)) {\n return {\n kind: 'tabs',\n tabs: displayOptions.tabs.map(tab => this.buildTabRenderState(data, tab, record)),\n };\n }\n\n if (this.isSectionsOptions(displayOptions)) {\n return {\n kind: 'sections',\n sectionsMenuHeader: displayOptions.menuHeader,\n sectionsOptions: this.buildSectionsOptions(displayOptions, record),\n };\n }\n\n if (this.isComponentOptions(displayOptions)) {\n return {\n kind: 'component',\n component: displayOptions.component,\n componentInputs: this.buildComponentInputs(data, displayOptions, record),\n componentOverflow: displayOptions.overflow ?? true,\n };\n }\n\n if (this.isSingleSectionOptions(displayOptions)) {\n return {\n kind: 'section',\n singleSectionOptions: this.buildSingleSectionOptions(displayOptions, record),\n };\n }\n\n return { kind: 'empty' };\n }\n\n private buildTabRenderState(\n data: DisplayDialogData<TRecord>,\n tab: DisplayDialogTabOptions<TRecord>,\n record: TRecord,\n ): DisplayDialogTabRenderState<TRecord> {\n return {\n label: tab.label,\n icon: tab.icon,\n svgIcon: tab.svgIcon,\n badge: tab.badge,\n renderState: this.buildOptionsRenderState(data, tab.displayOptions, record),\n };\n }\n\n private isTabsOptions(options: DisplayDialogOptions<TRecord>): options is DisplayDialogTabsOptions<TRecord> {\n return 'tabs' in options;\n }\n\n private isSectionsOptions(options: DisplayDialogOptions<TRecord>): options is DisplayDialogSectionsOptions<TRecord> {\n return 'sections' in options;\n }\n\n private isComponentOptions(\n options: DisplayDialogOptions<TRecord>,\n ): options is DisplayDialogComponentOptions<TRecord> {\n return 'component' in options;\n }\n\n private isSingleSectionOptions(\n options: DisplayDialogOptions<TRecord>,\n ): options is DisplayDialogSingleSectionOptions<TRecord> {\n return 'section' in options;\n }\n\n private buildSectionsOptions(\n options: DisplayDialogSectionsOptions<TRecord>,\n record: TRecord,\n ): SectionTabsDisplayOptions {\n const { menuHeader, sections, ...sectionTabsOptions } = options;\n\n return {\n ...sectionTabsOptions,\n data: record,\n sections: this.buildRuntimeSections(sections),\n };\n }\n\n private buildSingleSectionOptions(\n options: DisplayDialogSingleSectionOptions<TRecord>,\n record: TRecord,\n ): SectionTabsDisplayOptions {\n return {\n data: record,\n sections: this.buildRuntimeSections([options.section]),\n showEmptyFields: options.showEmptyFields,\n showEmptyFieldsToggle: options.showEmptyFieldsToggle,\n showEmptyFieldsLabel: options.showEmptyFieldsLabel,\n };\n }\n\n private buildRuntimeSections(sections: DisplayDialogSection<TRecord>[]): SectionTabsDisplaySection[] {\n return sections.map(section => ({\n ...section,\n cards: section.cards.map(card => this.buildRuntimeCard(section, card)),\n })) as SectionTabsDisplaySection[];\n }\n\n private buildRuntimeCard(\n section: DisplayDialogSection<TRecord>,\n card: DisplayDialogSectionCard<TRecord>,\n ): SectionTabsDisplayCard {\n const { actions, ...sectionTabsCard } = card;\n\n return {\n ...sectionTabsCard,\n actions: this.buildRuntimeCardActions(section, card, actions ?? []),\n } as SectionTabsDisplayCard;\n }\n\n private buildRuntimeCardActions(\n section: DisplayDialogSection<TRecord>,\n card: DisplayDialogSectionCard<TRecord>,\n actions: Array<SectionTabsDisplayCardAction | DisplayDialogCardAction<TRecord>>,\n ): DisplayDialogRuntimeCardAction[] {\n return actions.flatMap(action => {\n if (this.isSectionTabsDisplayCardAction(action)) return [action];\n\n const context = this.buildCardActionContext(section, card, action);\n if (!this.resolveCardActionState(action.visible, context, true)) return [];\n\n const menuOptions = this.buildRuntimeCardMenuOptions(section, card, action);\n if (action.menuOptions?.length && !menuOptions.length) return [];\n\n return [\n {\n id: action.id,\n type: action.type,\n icon: action.icon,\n label: action.label,\n tooltip: action.tooltip,\n ariaLabel: action.ariaLabel,\n color: action.color,\n disabled: this.resolveCardActionState(action.disabled, context, false),\n menuOptions: menuOptions.length ? menuOptions : undefined,\n handle: () => {\n if (!menuOptions.length) void this.handleCardAction(section, card, action);\n },\n },\n ];\n });\n }\n\n private isSectionTabsDisplayCardAction(\n action: SectionTabsDisplayCardAction | DisplayDialogCardAction<TRecord>,\n ): action is SectionTabsDisplayCardAction {\n return 'handle' in action && typeof action.handle === 'function';\n }\n\n private buildRuntimeCardMenuOptions(\n section: DisplayDialogSection<TRecord>,\n card: DisplayDialogSectionCard<TRecord>,\n action: DisplayDialogCardAction<TRecord>,\n ): DisplayDialogRuntimeCardMenuOption[] {\n return (action.menuOptions ?? []).flatMap(option => {\n const context = this.buildCardActionContext(section, card, action, option);\n if (!this.resolveCardActionState(option.visible, context, true)) return [];\n\n return [\n {\n id: option.id,\n label: option.label,\n icon: option.icon,\n tooltip: option.tooltip,\n ariaLabel: option.ariaLabel,\n disabled: this.resolveCardActionState(option.disabled, context, false),\n handle: () => void this.handleCardMenuOption(section, card, action, option),\n },\n ];\n });\n }\n\n private buildComponentInputs(\n data: DisplayDialogData<TRecord>,\n displayOptions: DisplayDialogComponentOptions<TRecord>,\n record: TRecord,\n ): ComponentInputs {\n const baseInputs: ComponentInputs = {\n record,\n data,\n displayOptions,\n };\n if (!displayOptions.input) {\n return this.pickDeclaredComponentInputs(displayOptions.component, baseInputs);\n }\n\n const customInputs =\n typeof displayOptions.input === 'function' ?\n displayOptions.input({ record, data, displayOptions })\n : displayOptions.input;\n\n return this.pickDeclaredComponentInputs(displayOptions.component, {\n ...baseInputs,\n ...customInputs,\n });\n }\n\n private pickDeclaredComponentInputs<TComponent>(\n component: Type<TComponent> | undefined,\n inputs: ComponentInputs | undefined,\n ): ComponentInputs {\n if (!component || !inputs) return {};\n\n const declaredInputNames = this.getDeclaredComponentInputNames(component as Type<unknown>);\n if (!declaredInputNames.size) return {};\n\n return Object.entries(inputs).reduce<ComponentInputs>((filteredInputs, [name, value]) => {\n if (declaredInputNames.has(name)) filteredInputs[name] = value;\n return filteredInputs;\n }, {});\n }\n\n private getDeclaredComponentInputNames(component: Type<unknown>): ReadonlySet<string> {\n const cachedInputNames = this.componentInputNamesByType.get(component);\n if (cachedInputNames) return cachedInputNames;\n\n const componentMirror = reflectComponentType(component);\n const inputNames = new Set(componentMirror?.inputs.map(input => input.templateName) ?? []);\n this.componentInputNamesByType.set(component, inputNames);\n return inputNames;\n }\n\n private resolveText(value: DisplayDialogTitle<TRecord> | undefined, record: TRecord): string {\n if (!value) return '';\n return typeof value === 'function' ? value(record) : value;\n }\n\n private refreshDisplayState(): void {\n if (this.record === undefined || !this.dialogDataResolved) return;\n\n this.title = this.resolveText(this.dialogDataResolved.title, this.record);\n this.subtitle = this.resolveText(this.dialogDataResolved.subtitle, this.record);\n this.renderState = this.buildRenderState(this.dialogDataResolved, this.record);\n this.refreshActions();\n }\n\n private refreshActions(): void {\n if (this.record === undefined || !this.dialogDataResolved) {\n this.actions = [];\n return;\n }\n\n const data = this.dialogDataResolved;\n const record = this.record;\n this.actions = [...(data.actions ?? []), ...(this.connection?.actions ?? [])].map(action => {\n if ('component' in action) {\n const custom = typeof action.input === 'function' ? action.input({record, data}) : action.input;\n return {...action, isVisible: true, componentInputs: this.pickDeclaredComponentInputs(action.component, {record, data, ...custom})};\n }\n const context = this.buildActionContext(action);\n return {...action, isVisible: this.resolveActionState(action.visible, context, true), isDisabled: this.resolveActionState(action.disabled, context, false)};\n });\n }\n\n private resolveActionState(\n state: DisplayDialogActionState<TRecord> | undefined,\n context: DisplayDialogActionContext<TRecord>,\n defaultValue: boolean,\n ): boolean {\n if (state === undefined) return defaultValue;\n return typeof state === 'function' ? state(context) : state;\n }\n\n private buildActionContext(action: DisplayDialogActionButton<TRecord>): DisplayDialogActionContext<TRecord> {\n const version = this.initializeVersion;\n return {\n record: this.record as TRecord,\n data: this.dialogDataResolved as DisplayDialogData<TRecord>,\n action,\n close: result => {if (!this.destroyed && version === this.initializeVersion) this.close(result);},\n setRecord: record => {if (!this.destroyed && version === this.initializeVersion) this.setRecord(record);},\n };\n }\n\n private async handleCardAction(section: DisplayDialogSection<TRecord>, card: DisplayDialogSectionCard<TRecord>, action: DisplayDialogCardAction<TRecord>): Promise<void> {\n if (this.record === undefined || this.destroyed || !this.dialogDataResolved) return;\n const context = this.buildCardActionContext(section, card, action);\n if (!this.resolveCardActionState(action.visible, context, true) || this.resolveCardActionState(action.disabled, context, false)) return;\n await this.runAction(action.confirm, () => action.handler?.(context), action.closeOnHandle);\n }\n\n private async handleCardMenuOption(section: DisplayDialogSection<TRecord>, card: DisplayDialogSectionCard<TRecord>, action: DisplayDialogCardAction<TRecord>, option: DisplayDialogCardMenuOption<TRecord>): Promise<void> {\n if (this.record === undefined || this.destroyed || !this.dialogDataResolved) return;\n const context = this.buildCardActionContext(section, card, action, option);\n if (!this.resolveCardActionState(action.visible, context, true) || !this.resolveCardActionState(option.visible, context, true) || this.resolveCardActionState(action.disabled, context, false) || this.resolveCardActionState(option.disabled, context, false)) return;\n await this.runAction(action.confirm, () => action.menuHandler?.(option.id, context), action.closeOnHandle);\n }\n\n private resolveCardActionState(\n state: DisplayDialogCardActionState<TRecord> | undefined,\n context: DisplayDialogCardActionContext<TRecord>,\n defaultValue: boolean,\n ): boolean {\n if (state === undefined) return defaultValue;\n return typeof state === 'function' ? state(context) : state;\n }\n\n private buildCardActionContext(\n section: DisplayDialogSection<TRecord>,\n card: DisplayDialogSectionCard<TRecord>,\n action: DisplayDialogCardAction<TRecord>,\n option?: DisplayDialogCardMenuOption<TRecord>,\n ): DisplayDialogCardActionContext<TRecord> {\n const version = this.initializeVersion;\n return {\n record: this.record as TRecord,\n data: this.dialogDataResolved as DisplayDialogData<TRecord>,\n section,\n card,\n action,\n option,\n close: result => {if (!this.destroyed && version === this.initializeVersion) this.close(result);},\n setRecord: record => {if (!this.destroyed && version === this.initializeVersion) this.setRecord(record);},\n };\n }\n\n private notifyRecord(record: TRecord): void {\n this.recordChange.emit(record);\n try { this.connection?.recordChanged?.(record); } catch (error) { this.reportError(error); }\n }\n\n private releaseConnection(): void {\n const connection = this.connection;\n this.connection = undefined;\n try { connection?.destroy?.(); } catch (error) { this.reportError(error); }\n }\n\n private reportError(error: unknown): void {\n try { this.errorHandler.handleError(error); } catch { /* Resource cleanup must continue even if an application handler throws. */ }\n }\n\n private setRecord(record: TRecord): void {\n if (this.destroyed) return;\n this.record = record;\n this.notifyRecord(record);\n\n this.refreshDisplayState();\n this.changeDetectorRef.markForCheck();\n }\n\n private async confirmAction(confirmOptions: string | DisplayDialogConfirmOptions | undefined): Promise<boolean> {\n if (!confirmOptions) return true;\n if (typeof confirmOptions === 'string') return this.confirm({ message: confirmOptions });\n return this.confirm(confirmOptions);\n }\n\n private async confirm(confirmOptions: DisplayDialogConfirmOptions): Promise<boolean> {\n return (await this.host.confirm(confirmOptions)) === true;\n }\n\n private refreshIntlLabels(): void {\n const data = this.dialogDataResolved;\n const messages = this.intl.messages;\n this.loadingLabel = data?.loadingLabel ?? messages.loadingLabel;\n this.closeLabel = data?.closeLabel ?? messages.closeLabel;\n if (this.recordErrorKind === 'empty') this.errorLabel = data?.emptyLabel ?? data?.errorLabel ?? messages.emptyLabel;\n if (this.recordErrorKind === 'error') this.errorLabel = data?.errorLabel ?? messages.errorLabel;\n if (this.actionFailed) this.actionErrorLabel = messages.actionErrorLabel;\n this.changeDetectorRef.markForCheck();\n }\n\n private finishWithoutRecord(kind: 'empty' | 'error'): void {\n this.loading = false;\n this.handlingAction = false;\n this.recordErrorKind = kind;\n this.refreshIntlLabels();\n this.title = '';\n this.subtitle = '';\n this.actions = [];\n this.renderState = { kind: 'empty' };\n this.changeDetectorRef.detectChanges();\n }\n}\n","<!-- @format -->\n\n@if (loading) {\n <div class=\"display-dialog-loading\">\n <mat-spinner [diameter]=\"72\"></mat-spinner>\n <span>{{ loadingLabel }}</span>\n </div>\n} @else if (errorLabel) {\n <div class=\"display-dialog-empty-state\">\n <mat-icon>info</mat-icon>\n <span>{{ errorLabel }}</span>\n\n @if (showCloseButton) {\n <button mat-stroked-button type=\"button\" (click)=\"close()\">{{ closeLabel }}</button>\n }\n </div>\n} @else {\n @if (title || subtitle || showCloseButton || getActions('top').length) {\n <div mat-dialog-title class=\"display-dialog-title\">\n <div class=\"display-dialog-title-bar\">\n <div class=\"display-dialog-title-content\">\n @if (title) {\n <h2 [innerHTML]=\"title\"></h2>\n }\n @if (subtitle) {\n <p [innerHTML]=\"subtitle\"></p>\n }\n </div>\n\n <div class=\"display-dialog-title-actions\">\n @for (action of getActions('top'); track trackAction($index, action)) {\n <ng-container *ngTemplateOutlet=\"actionTemplate; context: { action }\"></ng-container>\n }\n\n @if (isDialog && data?.showJsonDataButton === true) {\n <button\n mat-icon-button\n type=\"button\"\n \n [matTooltip]=\"intl.messages.jsonButtonLabel\"\n \n [attr.aria-label]=\"intl.messages.jsonButtonLabel\"\n (click)=\"openJsonDataDialog()\">\n <mat-icon>file_json</mat-icon>\n </button>\n }\n\n\n @if (showCloseButton) {\n <button mat-icon-button type=\"button\" [attr.aria-label]=\"closeLabel\" (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </div>\n </div>\n </div>\n }\n\n @if (actionErrorLabel) { <div class=\"display-dialog-action-error\" role=\"alert\">{{ actionErrorLabel }}</div> }\n <div mat-dialog-content class=\"display-dialog-content\">\n <ng-container *ngTemplateOutlet=\"displayDialogContent; context: { $implicit: renderState }\"></ng-container>\n </div>\n\n @if (getActions('bottom').length || getActions('bottom-end').length) {\n <footer class=\"display-dialog-actions\">\n <div class=\"display-dialog-actions-left\">\n @for (action of getActions('bottom'); track trackAction($index, action)) {\n <ng-container *ngTemplateOutlet=\"actionTemplate; context: { action }\"></ng-container>\n }\n </div>\n\n <div class=\"display-dialog-actions-right\">\n @for (action of getActions('bottom-end'); track trackAction($index, action)) {\n <ng-container *ngTemplateOutlet=\"actionTemplate; context: { action }\"></ng-container>\n }\n </div>\n </footer>\n }\n\n @if (handlingAction) {\n <div class=\"display-dialog-handling-action\">\n <mat-spinner [diameter]=\"72\"></mat-spinner>\n </div>\n }\n}\n\n<ng-template #displayDialogContent let-state>\n @switch (state.kind) {\n @case ('tabs') {\n @if (state.tabs?.length) {\n <mat-tab-group class=\"display-dialog-root-tabs\" mat-stretch-tabs=\"false\">\n @for (tab of state.tabs; track tab.label) {\n <mat-tab>\n <ng-template mat-tab-label>\n @if (tab.svgIcon) {\n <mat-icon class=\"display-dialog-root-tab-icon\" [svgIcon]=\"tab.svgIcon\"></mat-icon>\n } @else if (tab.icon) {\n <mat-icon class=\"display-dialog-root-tab-icon\">{{ tab.icon }}</mat-icon>\n }\n <span [innerHTML]=\"tab.label\"></span>\n @if (tab.badge !== undefined && tab.badge !== null) {\n <span class=\"display-dialog-root-tab-badge\">{{ tab.badge }}</span>\n }\n </ng-template>\n\n <ng-container\n *ngTemplateOutlet=\"displayDialogContent; context: { $implicit: tab.renderState }\"></ng-container>\n </mat-tab>\n }\n </mat-tab-group>\n }\n }\n\n @case ('sections') {\n @if (state.sectionsOptions) {\n <app-section-tabs-display\n class=\"display-dialog-section-tabs-display\"\n [menuHeader]=\"state.sectionsMenuHeader\"\n [options]=\"state.sectionsOptions\">\n </app-section-tabs-display>\n }\n }\n\n @case ('component') {\n <div class=\"display-dialog-component-page\" [class.overflow]=\"state.componentOverflow\">\n @if (state.component) {\n <ng-container *ngComponentOutlet=\"state.component; inputs: state.componentInputs\"></ng-container>\n }\n </div>\n }\n\n @case ('section') {\n @if (state.singleSectionOptions) {\n <app-section-tabs-display\n class=\"display-dialog-section-tabs-display display-dialog-single-section-display\"\n [options]=\"state.singleSectionOptions\">\n </app-section-tabs-display>\n }\n }\n\n @default {\n <div class=\"display-dialog-empty-state\">\n <mat-icon>info</mat-icon>\n <span>{{ intl.messages.emptyContentLabel }}</span>\n </div>\n }\n }\n</ng-template>\n\n<ng-template #actionTemplate let-action=\"action\">\n @if (action.component) {\n <ng-container *ngComponentOutlet=\"action.component; inputs: action.componentInputs\"></ng-container>\n } @else if (action.buttonType === 'raised') {\n <button\n class=\"display-dialog-action-btn\"\n mat-raised-button\n type=\"button\"\n [style.--action-color]=\"action.contrastColor\"\n [style.--action-background-color]=\"action.color\"\n [disabled]=\"handlingAction || action.isDisabled\"\n [matTooltip]=\"action.tooltip || ''\"\n (click)=\"handleAction(action)\">\n @if (action.icon) {\n <mat-icon>{{ action.icon }}</mat-icon>\n }\n @if (action.label) {\n <span>{{ action.label }}</span>\n }\n </button>\n } @else {\n <button\n class=\"display-dialog-action-btn\"\n mat-button\n type=\"button\"\n [style.--action-color]=\"action.color\"\n [disabled]=\"handlingAction || action.isDisabled\"\n [matTooltip]=\"action.tooltip || ''\"\n (click)=\"handleAction(action)\">\n @if (action.icon) {\n <mat-icon>{{ action.icon }}</mat-icon>\n }\n @if (action.label) {\n <span>{{ action.label }}</span>\n }\n </button>\n }\n</ng-template>\n","/** @format */\n\nimport { Injectable, inject, DOCUMENT } from '@angular/core';\nimport { MatDialog, MatDialogConfig, MatDialogRef } from '@angular/material/dialog';\nimport { DisplayDialog } from './display-dialog.component';\nimport { DisplayDialogData } from './display-dialog.types';\n\nexport interface DisplayDialogNestedOptions {\n inset?: number;\n minWidth?: number;\n minHeight?: number;\n viewportMargin?: number;\n}\n\nexport type DisplayDialogOpenConfig<TRecord extends object> = MatDialogConfig<DisplayDialogData<TRecord>> & {\n nested?: DisplayDialogNestedOptions | null;\n};\n\nexport const DEFAULT_NESTED_OPTIONS: Required<DisplayDialogNestedOptions> = {\n inset: 64,\n minWidth: 640,\n minHeight: 480,\n viewportMargin: 16,\n};\n\n@Injectable({ providedIn: 'root' })\nexport class DisplayDialogService {\n private readonly document = inject(DOCUMENT);\n private readonly matDialog: MatDialog = inject(MatDialog);\n\n open<TRecord extends object>(\n data: DisplayDialogData<TRecord>,\n config: DisplayDialogOpenConfig<TRecord> = {},\n ): MatDialogRef<DisplayDialog<TRecord>, unknown> {\n const { nested, ...dialogOverrides } = config;\n const nestedDialogConfig = nested === null ? {} : this.buildNestedDialogConfig(nested);\n const dialogConfig: MatDialogConfig<DisplayDialogData<TRecord>> = {\n width: '90vw',\n height: '90vh',\n maxWidth: '90vw',\n maxHeight: '90vh',\n autoFocus: false,\n restoreFocus: false,\n panelClass: 'display-dialog-panel',\n ...nestedDialogConfig,\n ...dialogOverrides,\n data,\n };\n const dialogRef = this.matDialog.open<DisplayDialog<TRecord>, DisplayDialogData<TRecord>, unknown>(\n DisplayDialog,\n dialogConfig,\n );\n\n return dialogRef;\n }\n\n private buildNestedDialogConfig(\n options?: DisplayDialogNestedOptions,\n ): Pick<MatDialogConfig<unknown>, 'width' | 'height' | 'maxWidth' | 'maxHeight'> {\n const parentSurface = this.findParentDialogSurface();\n if (!parentSurface) return {};\n\n const resolvedOptions: Required<DisplayDialogNestedOptions> = {\n ...DEFAULT_NESTED_OPTIONS,\n ...options,\n };\n\n const inset = Math.max(0, resolvedOptions.inset);\n const viewportMargin = Math.max(0, resolvedOptions.viewportMargin);\n const viewportWidth = this.document.documentElement.clientWidth;\n const viewportHeight = this.document.documentElement.clientHeight;\n const availableWidth = Math.max(0, viewportWidth - viewportMargin * 2);\n const availableHeight = Math.max(0, viewportHeight - viewportMargin * 2);\n\n if (availableWidth === 0 || availableHeight === 0) return {};\n\n const parentRect = parentSurface.getBoundingClientRect();\n const minWidth = Math.min(Math.max(0, resolvedOptions.minWidth), availableWidth);\n const minHeight = Math.min(Math.max(0, resolvedOptions.minHeight), availableHeight);\n const width = Math.max(minWidth, Math.min(parentRect.width - inset, availableWidth));\n const height = Math.max(minHeight, Math.min(parentRect.height - inset, availableHeight));\n\n return {\n width: `${Math.round(width)}px`,\n height: `${Math.round(height)}px`,\n maxWidth: `${Math.round(availableWidth)}px`,\n maxHeight: `${Math.round(availableHeight)}px`,\n };\n }\n\n private findParentDialogSurface(): HTMLElement | null {\n const activeElement = this.document.activeElement;\n\n if (activeElement instanceof HTMLElement) {\n const activeSurface = activeElement.closest<HTMLElement>('.mat-mdc-dialog-surface');\n if (activeSurface) return activeSurface;\n }\n\n const visibleSurfaces = Array.from(this.document.querySelectorAll<HTMLElement>('.mat-mdc-dialog-surface')).filter(\n surface => surface.getClientRects().length > 0,\n );\n\n return visibleSurfaces[visibleSurfaces.length - 1] ?? null;\n }\n}\n","/** @format */\n\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatTabsModule } from '@angular/material/tabs';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { SectionTabsModule } from '@eherve/angular-material-section-tabs';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\nimport { DisplayDialog } from './display-dialog.component';\n\n@NgModule({\n declarations: [DisplayDialog],\n imports: [\n CommonModule,\n MatButtonModule,\n MatDialogModule,\n MatIconModule,\n MatTabsModule,\n MatTooltipModule,\n SectionTabsModule,\n MatProgressSpinnerModule,\n ],\n exports: [DisplayDialog],\n})\nexport class DisplayDialogModule {}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmBA,IAAa,oBAAb,MAAa,kBAAiB;CACnB,UAAU,IAAI,QAAO;CAC9B,WAAkC;EAChC,cAAc;EACd,YAAY;EACZ,YAAY;EACZ,YAAY;EACZ,kBAAkB;EAClB,WAAW;EACX,iBAAiB;EACjB,aAAa;EACb,cAAc;EACd,WAAW;EACX,eAAe;EACf,mBAAmB;CACpB;CAfU,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAiB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAjB,OAAA,QAAA,GAAA,sBAAA;EAAA,YAAA;EA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AAwB;CAAA,CAAA;;AAIf,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAmB,YAAA,CAAA;EAd/B,MAAA;EAAS,MAAA,CAAA;GACR,cAAc,CAAC,aAAa;GAC5B,SAAS;IACP;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACD;GACD,SAAS,CAAC,aAAa;EACxB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,43 @@
1
1
  {
2
2
  "name": "@eherve/angular-material-display-dialog",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "22.0.0",
4
+ "author": "Eric Herve <eric.herve.95@gmail.com>",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/eherve/angular-material-extended.git"
8
+ },
9
+ "private": false,
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "peerDependencies": {
14
+ "@angular/animations": "^22.0.0",
15
+ "@angular/cdk": "^22.0.0",
16
+ "@angular/common": "^22.0.0",
17
+ "@angular/core": "^22.0.0",
18
+ "@angular/material": "^22.0.0",
19
+ "rxjs": "^7.8.0",
20
+ "@eherve/angular-material-section-tabs": "^22.0.0"
21
+ },
22
+ "dependencies": {
23
+ "tslib": "^2.3.0"
24
+ },
25
+ "sideEffects": [
26
+ "./styles.css"
27
+ ],
28
+ "exports": {
29
+ "./styles.css": {
30
+ "default": "./styles.css"
31
+ },
32
+ "./package.json": {
33
+ "default": "./package.json"
34
+ },
35
+ ".": {
36
+ "types": "./types/eherve-angular-material-display-dialog.d.ts",
37
+ "default": "./fesm2022/eherve-angular-material-display-dialog.mjs"
38
+ }
39
+ },
40
+ "module": "fesm2022/eherve-angular-material-display-dialog.mjs",
41
+ "typings": "types/eherve-angular-material-display-dialog.d.ts",
42
+ "type": "module"
6
43
  }
package/styles.css ADDED
@@ -0,0 +1 @@
1
+ .display-dialog-panel .mat-mdc-dialog-surface { display: flex; flex-direction: column; overflow: hidden; }
@@ -0,0 +1,347 @@
1
+ import * as i0 from "@angular/core";
2
+ import { EventEmitter, InjectionToken, OnChanges, OnDestroy, OnInit, SimpleChanges, Type } from "@angular/core";
3
+ import { Observable, Subject } from "rxjs";
4
+ import * as i8 from "@eherve/angular-material-section-tabs";
5
+ import { SectionTabsDisplayCard, SectionTabsDisplayCardAction, SectionTabsDisplayOptions, SectionTabsDisplaySection } from "@eherve/angular-material-section-tabs";
6
+ import * as i4 from "@angular/material/dialog";
7
+ import { MatDialogConfig, MatDialogRef } from "@angular/material/dialog";
8
+ import * as i2 from "@angular/common";
9
+ import * as i3 from "@angular/material/button";
10
+ import * as i5 from "@angular/material/icon";
11
+ import * as i6 from "@angular/material/tabs";
12
+ import * as i7 from "@angular/material/tooltip";
13
+ import * as i9 from "@angular/material/progress-spinner";
14
+ type ComponentInputs$1 = Record<string, unknown>;
15
+ export type DisplayDialogRecord = {
16
+ _id?: string;
17
+ };
18
+ export type DisplayDialogRecordLoader<TRecord extends object> = () => Promise<TRecord> | Observable<TRecord>;
19
+ export interface DisplayDialogComponentContext<TRecord extends object> {
20
+ record: TRecord;
21
+ data: DisplayDialogData<TRecord>;
22
+ displayOptions: DisplayDialogComponentOptions<TRecord>;
23
+ }
24
+ export type DisplayDialogComponentInput<TRecord extends object> = ComponentInputs$1 | ((context: DisplayDialogComponentContext<TRecord>) => ComponentInputs$1);
25
+ export interface DisplayDialogCardMenuOption<TRecord extends object = DisplayDialogRecord> {
26
+ id: string;
27
+ label: string;
28
+ icon?: string;
29
+ tooltip?: string;
30
+ ariaLabel?: string;
31
+ visible?: DisplayDialogCardActionState<TRecord>;
32
+ disabled?: DisplayDialogCardActionState<TRecord>;
33
+ }
34
+ export interface DisplayDialogCardActionContext<TRecord extends object = DisplayDialogRecord> {
35
+ record: TRecord;
36
+ data: DisplayDialogData<TRecord>;
37
+ section: DisplayDialogSection<TRecord>;
38
+ card: DisplayDialogSectionCard<TRecord>;
39
+ action: DisplayDialogCardAction<TRecord>;
40
+ option?: DisplayDialogCardMenuOption<TRecord>;
41
+ close: (result?: unknown) => void;
42
+ setRecord: (record: TRecord) => void;
43
+ }
44
+ export type DisplayDialogCardActionState<TRecord extends object = DisplayDialogRecord> = boolean | ((context: DisplayDialogCardActionContext<TRecord>) => boolean);
45
+ export interface DisplayDialogCardActionBase<TRecord extends object = DisplayDialogRecord> {
46
+ id?: string;
47
+ type: 'icon' | 'button';
48
+ icon?: string;
49
+ label?: string;
50
+ tooltip?: string;
51
+ ariaLabel?: string;
52
+ color?: string;
53
+ visible?: DisplayDialogCardActionState<TRecord>;
54
+ disabled?: DisplayDialogCardActionState<TRecord>;
55
+ closeOnHandle?: boolean;
56
+ confirm?: string | DisplayDialogConfirmOptions;
57
+ menuOptions?: DisplayDialogCardMenuOption<TRecord>[];
58
+ handler?: (context: DisplayDialogCardActionContext<TRecord>) => unknown | Promise<unknown>;
59
+ menuHandler?: (optionId: string, context: DisplayDialogCardActionContext<TRecord>) => unknown | Promise<unknown>;
60
+ }
61
+ export type DisplayDialogCardAction<TRecord extends object = DisplayDialogRecord> = (DisplayDialogCardActionBase<TRecord> & {
62
+ type: 'icon';
63
+ icon: string;
64
+ }) | (DisplayDialogCardActionBase<TRecord> & {
65
+ type: 'button';
66
+ label: string;
67
+ });
68
+ export type DisplayDialogSectionCard<TRecord extends object = DisplayDialogRecord> = Omit<SectionTabsDisplayCard, 'actions'> & {
69
+ actions?: Array<SectionTabsDisplayCardAction | DisplayDialogCardAction<TRecord>>;
70
+ };
71
+ export type DisplayDialogSection<TRecord extends object = DisplayDialogRecord> = Omit<SectionTabsDisplaySection, 'cards'> & {
72
+ cards: DisplayDialogSectionCard<TRecord>[];
73
+ };
74
+ export type DisplayDialogSectionsOptions<TRecord extends object = DisplayDialogRecord> = Omit<SectionTabsDisplayOptions, 'data' | 'sections'> & {
75
+ sections: DisplayDialogSection<TRecord>[];
76
+ menuHeader?: string;
77
+ };
78
+ export interface DisplayDialogComponentOptions<TRecord extends object = DisplayDialogRecord> {
79
+ component: Type<unknown>;
80
+ input?: DisplayDialogComponentInput<TRecord>;
81
+ overflow?: boolean;
82
+ }
83
+ export interface DisplayDialogSingleSectionOptions<TRecord extends object = DisplayDialogRecord> {
84
+ section: DisplayDialogSection<TRecord>;
85
+ showEmptyFields?: boolean;
86
+ showEmptyFieldsToggle?: boolean;
87
+ showEmptyFieldsLabel?: string;
88
+ }
89
+ export type DisplayDialogTabDisplayOptions<TRecord extends object = DisplayDialogRecord> = DisplayDialogSectionsOptions<TRecord> | DisplayDialogComponentOptions<TRecord> | DisplayDialogSingleSectionOptions<TRecord>;
90
+ export interface DisplayDialogTabOptions<TRecord extends object = DisplayDialogRecord> {
91
+ label: string;
92
+ icon?: string;
93
+ svgIcon?: string;
94
+ badge?: number;
95
+ displayOptions: DisplayDialogTabDisplayOptions<TRecord>;
96
+ }
97
+ export interface DisplayDialogTabsOptions<TRecord extends object = DisplayDialogRecord> {
98
+ tabs: DisplayDialogTabOptions<TRecord>[];
99
+ }
100
+ export type DisplayDialogOptions<TRecord extends object = DisplayDialogRecord> = DisplayDialogTabDisplayOptions<TRecord> | DisplayDialogTabsOptions<TRecord>;
101
+ export interface DisplayDialogOptionsContext<TRecord extends object = DisplayDialogRecord> {
102
+ record: TRecord;
103
+ data: DisplayDialogData<TRecord>;
104
+ }
105
+ export type DisplayDialogOptionsFactory<TRecord extends object = DisplayDialogRecord> = (context: DisplayDialogOptionsContext<TRecord>) => DisplayDialogOptions<TRecord>;
106
+ export type DisplayDialogOptionsSource<TRecord extends object = DisplayDialogRecord> = DisplayDialogOptions<TRecord> | DisplayDialogOptionsFactory<TRecord>;
107
+ export type DisplayDialogTitle<TRecord extends object> = string | ((record: TRecord) => string);
108
+ export type DisplayDialogActionPosition = 'bottom' | 'bottom-end' | 'top';
109
+ export interface DisplayDialogConfirmOptions {
110
+ title?: string;
111
+ message: string;
112
+ ok?: string;
113
+ cancel?: string;
114
+ }
115
+ export interface DisplayDialogActionContext<TRecord extends object = DisplayDialogRecord> {
116
+ record: TRecord;
117
+ data: DisplayDialogData<TRecord>;
118
+ action: DisplayDialogActionButton<TRecord>;
119
+ close: (result?: unknown) => void;
120
+ setRecord: (record: TRecord) => void;
121
+ }
122
+ export type DisplayDialogActionState<TRecord extends object = DisplayDialogRecord> = boolean | ((context: DisplayDialogActionContext<TRecord>) => boolean);
123
+ export interface DisplayDialogActionButton<TRecord extends object = DisplayDialogRecord> {
124
+ label?: string;
125
+ icon?: string;
126
+ position?: DisplayDialogActionPosition;
127
+ buttonType?: 'text' | 'raised';
128
+ color?: string;
129
+ contrastColor?: string;
130
+ tooltip?: string;
131
+ visible?: DisplayDialogActionState<TRecord>;
132
+ disabled?: DisplayDialogActionState<TRecord>;
133
+ closeOnHandle?: boolean;
134
+ confirm?: string | DisplayDialogConfirmOptions;
135
+ handle: (context: DisplayDialogActionContext<TRecord>) => unknown | Promise<unknown>;
136
+ }
137
+ export interface DisplayDialogRuntimeActionButton<TRecord extends object = DisplayDialogRecord> extends DisplayDialogActionButton<TRecord> {
138
+ isVisible: boolean;
139
+ isDisabled: boolean;
140
+ }
141
+ export interface DisplayDialogDataCommon<TRecord extends object> {
142
+ title?: DisplayDialogTitle<TRecord>;
143
+ subtitle?: DisplayDialogTitle<TRecord>;
144
+ loadingLabel?: string;
145
+ errorLabel?: string;
146
+ emptyLabel?: string;
147
+ closeLabel?: string;
148
+ showCloseButton?: boolean;
149
+ showJsonDataButton?: boolean;
150
+ actions?: DisplayDialogAction<TRecord>[];
151
+ connect?: () => DisplayDialogConnection<TRecord>;
152
+ displayOptions: DisplayDialogOptionsSource<TRecord>;
153
+ }
154
+ export type DisplayDialogDataWithRecord<TRecord extends object> = DisplayDialogDataCommon<TRecord> & {
155
+ record: TRecord;
156
+ loadRecord?: never;
157
+ };
158
+ export type DisplayDialogDataWithLoader<TRecord extends object> = DisplayDialogDataCommon<TRecord> & {
159
+ record?: never;
160
+ loadRecord: DisplayDialogRecordLoader<TRecord>;
161
+ };
162
+ export type DisplayDialogData<TRecord extends object = DisplayDialogRecord> = DisplayDialogDataWithRecord<TRecord> | DisplayDialogDataWithLoader<TRecord>;
163
+ export interface DisplayDialogConnection<TRecord extends object> {
164
+ actions?: readonly DisplayDialogAction<TRecord>[];
165
+ recordChanged?(record: TRecord): void;
166
+ destroy?(): void;
167
+ }
168
+ export interface DisplayDialogActionComponent<TRecord extends object = DisplayDialogRecord> {
169
+ component: Type<unknown>;
170
+ position?: DisplayDialogActionPosition;
171
+ input?: Record<string, unknown> | ((context: {
172
+ record: TRecord;
173
+ data: DisplayDialogData<TRecord>;
174
+ }) => Record<string, unknown>);
175
+ }
176
+ export type DisplayDialogAction<TRecord extends object = DisplayDialogRecord> = DisplayDialogActionButton<TRecord> | DisplayDialogActionComponent<TRecord>;
177
+ export interface DisplayDialogMessages {
178
+ loadingLabel: string;
179
+ closeLabel: string;
180
+ emptyLabel: string;
181
+ errorLabel: string;
182
+ actionErrorLabel: string;
183
+ jsonTitle: string;
184
+ jsonButtonLabel: string;
185
+ recordLabel: string;
186
+ confirmTitle: string;
187
+ confirmOk: string;
188
+ confirmCancel: string;
189
+ emptyContentLabel: string;
190
+ }
191
+ export declare class DisplayDialogIntl {
192
+ readonly changes: Subject<void>;
193
+ messages: DisplayDialogMessages;
194
+ static ɵfac: i0.ɵɵFactoryDeclaration<DisplayDialogIntl, never>;
195
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
196
+ }
197
+ declare namespace display_dialog_component_d_exports {
198
+ export { DisplayDialog };
199
+ }
200
+ type ComponentInputs = Record<string, unknown>;
201
+ type DisplayDialogRuntimeAction<TRecord extends object> = DisplayDialogRuntimeActionButton<TRecord> | (DisplayDialogActionComponent<TRecord> & {
202
+ componentInputs: ComponentInputs;
203
+ isVisible: boolean;
204
+ });
205
+ type DisplayDialogRenderKind = 'tabs' | 'sections' | 'component' | 'section' | 'empty';
206
+ interface DisplayDialogTabRenderState<TRecord extends object> {
207
+ label: string;
208
+ icon?: string;
209
+ svgIcon?: string;
210
+ badge?: number;
211
+ renderState: DisplayDialogRenderState<TRecord>;
212
+ }
213
+ interface DisplayDialogRenderState<TRecord extends object> {
214
+ kind: DisplayDialogRenderKind;
215
+ tabs?: DisplayDialogTabRenderState<TRecord>[];
216
+ sectionsOptions?: SectionTabsDisplayOptions;
217
+ sectionsMenuHeader?: string;
218
+ component?: Type<unknown>;
219
+ componentInputs?: ComponentInputs;
220
+ componentOverflow?: boolean;
221
+ singleSectionOptions?: SectionTabsDisplayOptions;
222
+ }
223
+ export declare class DisplayDialog<TRecord extends object> implements OnInit, OnChanges, OnDestroy {
224
+ private readonly dialogData;
225
+ private readonly dialogRef;
226
+ readonly intl: DisplayDialogIntl;
227
+ data?: DisplayDialogData<TRecord>;
228
+ loading: boolean;
229
+ loadingLabel: string;
230
+ errorLabel: string;
231
+ title: string;
232
+ subtitle: string;
233
+ closeLabel: string;
234
+ showCloseButton: boolean;
235
+ handlingAction: boolean;
236
+ actions: DisplayDialogRuntimeAction<TRecord>[];
237
+ actionErrorLabel: string;
238
+ renderState: DisplayDialogRenderState<TRecord>;
239
+ readonly recordChange: EventEmitter<TRecord>;
240
+ readonly isDialog: boolean;
241
+ private readonly changeDetectorRef;
242
+ private readonly elementRef;
243
+ private readonly componentInputNamesByType;
244
+ private initializeVersion;
245
+ private destroyed;
246
+ private recordErrorKind?;
247
+ private actionFailed;
248
+ private connection?;
249
+ private readonly cancelLoad;
250
+ private dialogDataResolved?;
251
+ private record?;
252
+ private readonly host;
253
+ private readonly errorHandler;
254
+ private readonly intlSubscription;
255
+ constructor(dialogData: DisplayDialogData<TRecord> | null, dialogRef: MatDialogRef<DisplayDialog<TRecord>> | null);
256
+ ngOnInit(): void;
257
+ ngOnChanges(changes: SimpleChanges): void;
258
+ ngOnDestroy(): void;
259
+ openJsonDataDialog(): void;
260
+ close(result?: unknown): void;
261
+ getActions(position: DisplayDialogActionPosition): DisplayDialogRuntimeAction<TRecord>[];
262
+ trackAction(index: number, action: DisplayDialogRuntimeAction<TRecord>): string | number;
263
+ handleAction(action: DisplayDialogRuntimeActionButton<TRecord>): Promise<void>;
264
+ private runAction;
265
+ private resolveJsonDialogTitle;
266
+ private initialize;
267
+ private resolveRecord;
268
+ private buildRenderState;
269
+ private resolveDisplayOptions;
270
+ private buildOptionsRenderState;
271
+ private buildTabRenderState;
272
+ private isTabsOptions;
273
+ private isSectionsOptions;
274
+ private isComponentOptions;
275
+ private isSingleSectionOptions;
276
+ private buildSectionsOptions;
277
+ private buildSingleSectionOptions;
278
+ private buildRuntimeSections;
279
+ private buildRuntimeCard;
280
+ private buildRuntimeCardActions;
281
+ private isSectionTabsDisplayCardAction;
282
+ private buildRuntimeCardMenuOptions;
283
+ private buildComponentInputs;
284
+ private pickDeclaredComponentInputs;
285
+ private getDeclaredComponentInputNames;
286
+ private resolveText;
287
+ private refreshDisplayState;
288
+ private refreshActions;
289
+ private resolveActionState;
290
+ private buildActionContext;
291
+ private handleCardAction;
292
+ private handleCardMenuOption;
293
+ private resolveCardActionState;
294
+ private buildCardActionContext;
295
+ private notifyRecord;
296
+ private releaseConnection;
297
+ private reportError;
298
+ private setRecord;
299
+ private confirmAction;
300
+ private confirm;
301
+ private refreshIntlLabels;
302
+ private finishWithoutRecord;
303
+ static ɵfac: i0.ɵɵFactoryDeclaration<DisplayDialog<any>, [{
304
+ optional: true;
305
+ }, {
306
+ optional: true;
307
+ }]>;
308
+ static ɵcmp: i0.ɵɵComponentDeclaration<DisplayDialog<any>, "app-display-dialog", never, {
309
+ "data": {
310
+ "alias": "data";
311
+ "required": false;
312
+ };
313
+ }, {}, never, never, false, never>;
314
+ }
315
+ export interface DisplayDialogNestedOptions {
316
+ inset?: number;
317
+ minWidth?: number;
318
+ minHeight?: number;
319
+ viewportMargin?: number;
320
+ }
321
+ export type DisplayDialogOpenConfig<TRecord extends object> = MatDialogConfig<DisplayDialogData<TRecord>> & {
322
+ nested?: DisplayDialogNestedOptions | null;
323
+ };
324
+ export declare const DEFAULT_NESTED_OPTIONS: Required<DisplayDialogNestedOptions>;
325
+ export declare class DisplayDialogService {
326
+ private readonly document;
327
+ private readonly matDialog;
328
+ open<TRecord extends object>(data: DisplayDialogData<TRecord>, config?: DisplayDialogOpenConfig<TRecord>): MatDialogRef<DisplayDialog<TRecord>, unknown>;
329
+ private buildNestedDialogConfig;
330
+ private findParentDialogSurface;
331
+ static ɵfac: i0.ɵɵFactoryDeclaration<DisplayDialogService, never>;
332
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
333
+ }
334
+ export declare class DisplayDialogModule {
335
+ static ɵfac: i0.ɵɵFactoryDeclaration<DisplayDialogModule, never>;
336
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DisplayDialogModule, [typeof DisplayDialog], [typeof i2.CommonModule, typeof i3.MatButtonModule, typeof i4.MatDialogModule, typeof i5.MatIconModule, typeof i6.MatTabsModule, typeof i7.MatTooltipModule, typeof i8.SectionTabsModule, typeof i9.MatProgressSpinnerModule], [typeof DisplayDialog]>;
337
+ static ɵinj: i0.ɵɵInjectorDeclaration<DisplayDialogModule>;
338
+ }
339
+ export interface DisplayDialogJsonSource {
340
+ label: string;
341
+ value: unknown;
342
+ }
343
+ export interface DisplayDialogHost {
344
+ confirm(options: DisplayDialogConfirmOptions): Promise<boolean>;
345
+ showJson(title: string, sources: readonly DisplayDialogJsonSource[]): void;
346
+ }
347
+ export declare const DISPLAY_DIALOG_HOST: InjectionToken<DisplayDialogHost>;