{"version":3,"file":"siemens-element-ng-modal.mjs","sources":["../../../../projects/element-ng/modal/modalref.ts","../../../../projects/element-ng/modal/si-modal.component.ts","../../../../projects/element-ng/modal/si-modal.component.html","../../../../projects/element-ng/modal/si-modal.service.ts","../../../../projects/element-ng/modal/modal.helpers.ts","../../../../projects/element-ng/modal/index.ts","../../../../projects/element-ng/modal/siemens-element-ng-modal.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { ElementRef } from '@angular/core';\nimport { ReplaySubject, Subject } from 'rxjs';\n\nimport { ModalOptions } from './si-modal.service';\n\n/**\n * Reference to a modal dialog\n * @typeParam T - the type of the content\n * @typeParam CT - the close type\n */\nexport class ModalRef<T = never, CT = any> {\n  /** Emits the close value when the modal is hidden. */\n  hidden = new Subject<CT | undefined>();\n  /** Allows messaging state to consumer w/o closing the dialog. */\n  message = new Subject<CT | undefined>();\n  /** Emits the modal element reference when it is shown. */\n  shown = new ReplaySubject<ElementRef>(1);\n  /**\n   * The modal options passed during creation.\n   *\n   * @defaultValue `{}`\n   * @see {@link SiModalService}\n   */\n  data: ModalOptions = {};\n  /** @defaultValue true */\n  ignoreBackdropClick = true;\n  /**\n   * Custom class for modal-dialog\n   *\n   * @defaultValue ''\n   */\n  dialogClass = '';\n  /**\n   * The layer of the modal. The modal with the highest layer will be shown on top.\n   *\n   * @defaultValue 0\n   */\n  layer = 0;\n  /** The default close value of the modal. */\n  closeValue?: CT;\n\n  get content(): T {\n    return undefined as unknown as T;\n  }\n\n  /** Set the input of a component shown in the modal. */\n  setInput(input: string, value: unknown): void {}\n\n  /**\n   * @defaultValue `() => false`\n   */\n  isCurrent: () => boolean = () => false;\n  /**\n   * @defaultValue `() => {}`\n   */\n  detach: () => void = () => {};\n  /**\n   * Close the modal with a custom close value.\n   *\n   * @defaultValue `() => {}`\n   */\n  hide: (reason?: CT) => void = () => {};\n\n  /**\n   * When `data.disableAutoHide` is set, messages the `reason`, otherwise calls {@link hide}.\n   */\n  messageOrHide(reason?: CT): void {\n    if (this.data.messageInsteadOfAutoHide) {\n      this.message.next(reason);\n    } else {\n      this.hide(reason);\n    }\n  }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { A11yModule } from '@angular/cdk/a11y';\nimport {\n  AfterViewInit,\n  Component,\n  ComponentRef,\n  DestroyRef,\n  effect,\n  ElementRef,\n  inject,\n  input,\n  OnInit,\n  signal,\n  TemplateRef,\n  Type,\n  untracked,\n  viewChild,\n  ViewContainerRef,\n  DOCUMENT,\n  NgZone\n} from '@angular/core';\n\nimport { ModalRef } from './modalref';\n\n@Component({\n  selector: 'si-modal',\n  imports: [A11yModule],\n  templateUrl: './si-modal.component.html',\n  host: {\n    class: 'modal d-block',\n    role: 'dialog',\n    'aria-modal': 'true',\n    '[attr.aria-labelledby]': 'titleId',\n    'animate.leave': 'dialog-leave',\n    '[style.--element-animations-enabled]': 'modalRef.data.animated === false ? 0 : null',\n    '(mousedown)': 'clickStarted($event)',\n    '(mouseup)': 'onClickStop($event)',\n    '(window:keydown.esc)': 'onEsc($event)'\n  }\n})\nexport class SiModalComponent implements OnInit, AfterViewInit {\n  readonly content = input.required<TemplateRef<unknown> | Type<unknown>>();\n  componentRef?: ComponentRef<unknown>;\n\n  private readonly document = inject(DOCUMENT);\n  private readonly ngZone = inject(NgZone);\n  private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n  protected readonly modalRef = inject(ModalRef<unknown, unknown>);\n\n  protected readonly dialogClass = this.modalRef.dialogClass ?? '';\n  protected readonly titleId = this.modalRef.data?.ariaLabelledBy ?? '';\n\n  private readonly contentContainer = viewChild.required('contentContainer', {\n    read: ViewContainerRef\n  });\n\n  private readonly show = signal(true);\n  private clickStartInDialog = false;\n  private origBodyOverflow?: string;\n  private backdropGhostClickPrevention = true;\n\n  constructor() {\n    inject(DestroyRef).onDestroy(() => this.restoreBodyOverflow());\n    effect(() => {\n      const content = this.content();\n      const viewContainer = this.contentContainer();\n      untracked(() => this.attachContent(content, viewContainer));\n    });\n  }\n\n  ngOnInit(): void {\n    if (this.modalRef.layer === 1) {\n      // Lock only the background; overflowing content scrolls in the modal container.\n      this.origBodyOverflow = this.document.body.style.overflow;\n      this.document.body.style.overflow = 'hidden';\n    }\n    this.ngZone.runOutsideAngular(() =>\n      setTimeout(() => (this.backdropGhostClickPrevention = false), 300)\n    );\n  }\n\n  ngAfterViewInit(): void {\n    queueMicrotask(() => this.modalRef.shown.next(this.elementRef));\n  }\n\n  private attachContent(\n    content: TemplateRef<unknown> | Type<unknown>,\n    viewContainer: ViewContainerRef\n  ): void {\n    viewContainer.clear();\n    this.componentRef = undefined;\n    if (content instanceof TemplateRef) {\n      viewContainer.createEmbeddedView(content, {\n        modalRef: this.modalRef,\n        ...this.modalRef.data.inputValues\n      });\n      return;\n    }\n\n    this.componentRef = viewContainer.createComponent(content, {\n      environmentInjector: this.modalRef.data.environmentInjector,\n      bindings: this.modalRef.data.bindings\n    });\n    for (const [key, value] of Object.entries(this.modalRef.data.inputValues ?? {})) {\n      this.componentRef.setInput(key, value);\n    }\n  }\n\n  /** @internal */\n  hideDialog(param?: unknown): void {\n    if (!this.show()) {\n      return;\n    }\n\n    this.show.set(false);\n    this.restoreBodyOverflow();\n    this.modalRef?.hidden.next(param);\n    this.modalRef?.hidden.complete();\n    this.modalRef?.message.complete();\n\n    this.modalRef.detach();\n  }\n\n  private restoreBodyOverflow(): void {\n    if (this.origBodyOverflow !== undefined) {\n      this.document.body.style.overflow = this.origBodyOverflow;\n      this.origBodyOverflow = undefined;\n    }\n  }\n\n  protected clickStarted(event: MouseEvent): void {\n    this.clickStartInDialog = event.target !== this.elementRef.nativeElement;\n  }\n\n  protected onClickStop(event: MouseEvent): void {\n    const clickedInBackdrop =\n      event.target === this.elementRef.nativeElement && !this.clickStartInDialog;\n    if (this.modalRef?.ignoreBackdropClick || !clickedInBackdrop) {\n      this.clickStartInDialog = false;\n      return;\n    }\n\n    if (!this.backdropGhostClickPrevention) {\n      // Called when backdrop close is allowed and user clicks on the backdrop\n      this.modalRef.messageOrHide(this.modalRef.closeValue);\n    } else {\n      // When in ghost click prevention mode, avoid text selection\n      this.document.getSelection()?.removeAllRanges();\n    }\n  }\n\n  protected onEsc(event: Event): void {\n    if (this.modalRef?.data.keyboard && this.modalRef?.isCurrent()) {\n      event.preventDefault();\n      this.modalRef.messageOrHide(this.modalRef.closeValue);\n    }\n  }\n}\n","<div cdkTrapFocus cdkTrapFocusAutoCapture [class]=\"`modal-dialog ${dialogClass}`\">\n  <div class=\"modal-content\">\n    <ng-container #contentContainer />\n  </div>\n</div>\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport {\n  Binding,\n  ComponentRef,\n  EnvironmentInjector,\n  inject,\n  Injectable,\n  Injector,\n  inputBinding,\n  StaticProvider,\n  TemplateRef,\n  Type\n} from '@angular/core';\nimport { areAnimationsDisabled, isRTL } from '@siemens/element-ng/common';\nimport { SiNoTranslateService, SiTranslateService } from '@siemens/element-translate-ng/translate';\n\nimport { ModalRef } from './modalref';\nimport { SiModalComponent } from './si-modal.component';\n\nexport interface ModalDependencyInjectionOptions {\n  /** Additional providers for the modal. */\n  providers?: StaticProvider[];\n  /** Optional element Injector. */\n  injector?: Injector;\n  /** Optional environment Injector. */\n  environmentInjector?: EnvironmentInjector;\n}\n\nexport interface ModalOptions<T = Record<string, any>> extends ModalDependencyInjectionOptions {\n  /**\n   * Angular bindings for component content, created with `inputBinding`, `outputBinding`, or\n   * `twoWayBinding`. Ignored for template content.\n   */\n  bindings?: Binding[];\n  /**\n   * Use this to assign values to either `@Input()` or `input()` fields of the provided component.\n   * If a template is used, the values are available in the template context.\n   */\n  inputValues?: Record<string, unknown>;\n  /** When set to true, clicking the backdrop has no effect. */\n  ignoreBackdropClick?: boolean;\n  /** When set to true, backdrop click or Esc don't close the modal. Instead a message will be sent. */\n  messageInsteadOfAutoHide?: boolean;\n  /** Handle Esc to close/message. */\n  keyboard?: boolean;\n  /** Whether to enable animation. */\n  animated?: boolean;\n  /** Additional CSS class. */\n  class?: string;\n  /** aria-labelled-by value. */\n  ariaLabelledBy?: string;\n}\n\nclass ModalRefImpl<T = never, CT = void> extends ModalRef<T, CT> {\n  modalCompRef?: ComponentRef<SiModalComponent>;\n  overlayRef?: OverlayRef;\n\n  override get content(): T {\n    return this.modalCompRef?.instance.componentRef?.instance as T;\n  }\n\n  override setInput(input: string, value: unknown): void {\n    this.modalCompRef?.instance.componentRef?.setInput(input, value);\n  }\n\n  constructor(layer: number, data: ModalOptions, closeValue?: CT) {\n    super();\n    this.layer = layer;\n    this.data = data;\n    this.ignoreBackdropClick = data.ignoreBackdropClick !== false;\n    this.dialogClass = data?.class ?? '';\n    this.closeValue = closeValue;\n  }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class SiModalService {\n  private modalsCount = 0;\n  private readonly overlay = inject(Overlay);\n  private injector = inject(Injector);\n\n  /**\n   * Shows a modal with the given content and configuration.\n   * @param content - Content to be displayed in the modal can  be a template reference or a component.\n   * @param config - Configuration for the modal.\n   * @param closeValue - Default closing value which can be overridden by calling `modalRef.hide(value)`.\n   * @returns A reference to the modal.\n   */\n  show<T, CT = any>(\n    content: TemplateRef<any> | (new (...args: any[]) => T),\n    config: ModalOptions<T>,\n    closeValue?: CT\n  ): ModalRef<T, CT> {\n    const modalRef = new ModalRefImpl<T, CT>(++this.modalsCount, config, closeValue);\n    const siModalRef = this.attachComponent(content, modalRef);\n    modalRef.modalCompRef = siModalRef;\n    modalRef.detach = () => this.detach(modalRef);\n    modalRef.hide = (param?: CT) => modalRef.modalCompRef?.instance.hideDialog(param);\n    modalRef.isCurrent = () => modalRef.layer === this.modalsCount;\n    // Initialize the modal view so content is available before show() returns.\n    siModalRef.changeDetectorRef.detectChanges();\n\n    return modalRef;\n  }\n\n  private attachComponent<T, CT>(\n    content: TemplateRef<unknown> | Type<T>,\n    modalRef: ModalRefImpl<T, CT>\n  ): ComponentRef<SiModalComponent> {\n    const providers: StaticProvider[] = [{ provide: ModalRef, useValue: modalRef }];\n    modalRef.data.providers?.forEach(p => providers.push(p));\n    const injector = Injector.create({\n      providers,\n      parent: modalRef.data.injector ?? this.buildInjector()\n    });\n\n    modalRef.overlayRef = this.overlay.create({\n      positionStrategy: this.overlay.position().global().centerHorizontally().centerVertically(),\n      direction: isRTL() ? 'rtl' : 'ltr',\n      hasBackdrop: modalRef.layer === 1,\n      disableAnimations: modalRef.data.animated === false || areAnimationsDisabled()\n    });\n    const compPortal = new ComponentPortal(SiModalComponent, null, injector, undefined, [\n      inputBinding('content', () => content)\n    ]);\n    return modalRef.overlayRef.attach(compPortal);\n  }\n\n  protected detach(modalRef: ModalRef<unknown, any>): void {\n    const ref = modalRef as ModalRefImpl<unknown>;\n    if (ref.modalCompRef) {\n      ref.modalCompRef = undefined;\n      ref.overlayRef?.detach();\n      ref.overlayRef = undefined;\n      ref.shown.complete();\n      this.modalsCount--;\n    }\n  }\n\n  // TODO remove once translation must be defined at application start\n  // Notification service is provided in 'root'. If no translation is defined, SiNoTranslateService is not provided\n  protected buildInjector(): Injector {\n    let injector = this.injector;\n    if (!injector.get(SiTranslateService, null)) {\n      injector = Injector.create({\n        providers: [{ provide: SiTranslateService, useClass: SiNoTranslateService, deps: [] }],\n        parent: this.injector\n      });\n    }\n    return injector;\n  }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { ModalOptions } from './si-modal.service';\n\nlet idCounter = 1;\n\nexport const createModalConfig = (inputs?: { [key: string]: any }): ModalOptions => {\n  if (inputs) {\n    Object.keys(inputs).forEach(k => inputs![k] === undefined && delete inputs![k]);\n  } else {\n    inputs = {};\n  }\n  const config: ModalOptions<any> = {\n    inputValues: inputs as { [key: string]: any },\n    ignoreBackdropClick: true,\n    keyboard: false,\n    animated: true,\n    class: 'modal-dialog-centered'\n  };\n  const id = `__si-modal-id-${idCounter++}`;\n  config.inputValues!.titleId = id;\n  config.ariaLabelledBy = id;\n  return config;\n};\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-modal.service';\nexport * from './modalref';\nexport * from './modal.helpers';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AASA;;;;AAIG;MACU,QAAQ,CAAA;;AAEnB,IAAA,MAAM,GAAG,IAAI,OAAO,EAAkB;;AAEtC,IAAA,OAAO,GAAG,IAAI,OAAO,EAAkB;;AAEvC,IAAA,KAAK,GAAG,IAAI,aAAa,CAAa,CAAC,CAAC;AACxC;;;;;AAKG;IACH,IAAI,GAAiB,EAAE;;IAEvB,mBAAmB,GAAG,IAAI;AAC1B;;;;AAIG;IACH,WAAW,GAAG,EAAE;AAChB;;;;AAIG;IACH,KAAK,GAAG,CAAC;;AAET,IAAA,UAAU;AAEV,IAAA,IAAI,OAAO,GAAA;AACT,QAAA,OAAO,SAAyB;IAClC;;AAGA,IAAA,QAAQ,CAAC,KAAa,EAAE,KAAc,IAAS;AAE/C;;AAEG;AACH,IAAA,SAAS,GAAkB,MAAM,KAAK;AACtC;;AAEG;AACH,IAAA,MAAM,GAAe,MAAK,EAAE,CAAC;AAC7B;;;;AAIG;AACH,IAAA,IAAI,GAA0B,MAAK,EAAE,CAAC;AAEtC;;AAEG;AACH,IAAA,aAAa,CAAC,MAAW,EAAA;AACvB,QAAA,IAAI,IAAI,CAAC,IAAI,CAAC,wBAAwB,EAAE;AACtC,YAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;QAC3B;aAAO;AACL,YAAA,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;QACnB;IACF;AACD;;AC7ED;;;AAGG;MAwCU,gBAAgB,CAAA;IAClB,OAAO,GAAG,KAAK,CAAC,QAA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