{"version":3,"file":"siemens-element-ng-main-detail-container.mjs","sources":["../../../../projects/element-ng/main-detail-container/si-main-detail-container.component.ts","../../../../projects/element-ng/main-detail-container/si-main-detail-container.component.html","../../../../projects/element-ng/main-detail-container/si-main-detail-container.module.ts","../../../../projects/element-ng/main-detail-container/index.ts","../../../../projects/element-ng/main-detail-container/siemens-element-ng-main-detail-container.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n  booleanAttribute,\n  ChangeDetectorRef,\n  Component,\n  computed,\n  DestroyRef,\n  ElementRef,\n  inject,\n  input,\n  model,\n  OnChanges,\n  OnInit,\n  output,\n  signal,\n  SimpleChanges,\n  viewChild\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { elementBack } from '@siemens/element-icons';\nimport { addIcons, SiIconComponent } from '@siemens/element-ng/icon';\nimport {\n  BOOTSTRAP_BREAKPOINTS,\n  ElementDimensions,\n  ResizeObserverService\n} from '@siemens/element-ng/resize-observer';\nimport { SiSplitComponent, SiSplitPartComponent, SplitUnit } from '@siemens/element-ng/split';\nimport { SiTranslatePipe, t, TranslatableString } from '@siemens/element-translate-ng/translate';\nimport { timer } from 'rxjs';\n\n@Component({\n  selector: 'si-main-detail-container',\n  imports: [\n    NgTemplateOutlet,\n    SiSplitComponent,\n    SiSplitPartComponent,\n    SiTranslatePipe,\n    SiIconComponent\n  ],\n  templateUrl: './si-main-detail-container.component.html',\n  styleUrl: './si-main-detail-container.component.scss',\n  host: {\n    class: 'si-layout-inner',\n    '[class.animate]': 'animate()',\n    '[style.opacity]': 'opacity()'\n  }\n})\nexport class SiMainDetailContainerComponent implements OnInit, OnChanges {\n  protected readonly icons = addIcons({ elementBack });\n\n  private readonly animationDuration = 500;\n  private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n  private readonly resizeObserver = inject(ResizeObserverService);\n  private readonly changeDetectorRef = inject(ChangeDetectorRef);\n  private readonly destroyRef = inject(DestroyRef);\n  private readonly splitElement = viewChild('splitElement', { read: ElementRef });\n  private readonly mainSplitPart = viewChild('mainSplitPart', { read: SiSplitPartComponent });\n\n  /**\n   * A numeric value defining the minimum width in px, which the container needs\n   * to be displayed in its large layout. Whenever smaller than\n   * this threshold, the small layout will be used. Default is\n   * value is BOOTSTRAP_BREAKPOINTS.mdMinimum.\n   *\n   * @defaultValue BOOTSTRAP_BREAKPOINTS.mdMinimum\n   */\n  readonly largeLayoutBreakpoint = input(BOOTSTRAP_BREAKPOINTS.mdMinimum);\n\n  /**\n   * Whether the main-detail layout component has a large size or not,\n   * `true` if the container´s width matches or exceeds the `largeLayoutBreakpoint`.\n   */\n  hasLargeSize!: boolean;\n\n  /**\n   * Emits whether the components size is large enough to display\n   * main and details views next to each other or not.\n   */\n  readonly hasLargeSizeChange = output<boolean>();\n\n  /**\n   * Whether the details are currently active or not, mostly relevant in the\n   * responsive scenario when the viewport only shows either the main or the detail.\n   *\n   * @defaultValue false\n   */\n  readonly detailsActive = model(false);\n\n  /**\n   * The heading of the main-detail layout component, usually a page heading.\n   *\n   * @defaultValue ''\n   */\n  readonly heading = input<TranslatableString>('');\n\n  /**\n   * Whether the heading should be truncated (single line) or not.\n   * Default value is `false`.\n   *\n   * @defaultValue false\n   */\n  readonly truncateHeading = input(false, { transform: booleanAttribute });\n\n  /**\n   * The heading of the detail area.\n   *\n   * @defaultValue ''\n   */\n  readonly detailsHeading = input<TranslatableString>('');\n\n  /**\n   * Whether the main and detail parts should be resizable by a splitter or not.\n   * This is only supported in the 'large' scenario (when `hasLargeSize` is `true`).\n   * Default value is `false`.\n   *\n   * @defaultValue false\n   */\n  readonly resizableParts = input(false, { transform: booleanAttribute });\n\n  /**\n   * You can hide the back button in the mobile view by setting true. Required\n   * in add, edit workflows on mobile sizes. During add or edit, the back button\n   * should be hidden. Default value is `false`.\n   *\n   * @defaultValue false\n   */\n  readonly hideBackButton = input(false, { transform: booleanAttribute });\n\n  /**\n   * Details back button text. Required for a11y.\n   *\n   * @defaultValue\n   * ```\n   * t(() => $localize`:@@SI_MAIN_DETAIL_CONTAINER.BACK:Back`)\n   * ```\n   */\n  readonly detailsBackButtonText = input(t(() => $localize`:@@SI_MAIN_DETAIL_CONTAINER.BACK:Back`));\n\n  /**\n   * CSS class(es) applied to the outermost container. Per default, Bootstrap classes\n   * to handle responsive paddings are applied: `px-6 pt-6 px-md-9`.\n   *\n   * @defaultValue 'px-6 pt-6 px-md-9'\n   */\n  readonly containerClass = input('px-6 pt-6 px-md-9');\n\n  /**\n   * CSS class(es) applied to the main container. In combination with `containerClass`,\n   * this allows for settings individual padding and margin values on the individual containers.\n   *\n   * @defaultValue 'pb-6'\n   */\n  readonly mainContainerClass = input('pb-6');\n\n  /**\n   * CSS class(es) applied to the detail container. In combination with `containerClass`,\n   * this allows for settings individual padding and margin values on the individual containers.\n   *\n   * @defaultValue 'pb-6'\n   */\n  readonly detailContainerClass = input('pb-6');\n\n  /**\n   * Unit used for the main split part when {@link resizableParts} is enabled.\n   *\n   * @defaultValue 'px'\n   */\n  readonly mainContainerWidthUnit = input<SplitUnit>('px');\n\n  /**\n   * The size of the main container. When {@link resizableParts} is enabled,\n   * the value is interpreted using {@link mainContainerWidthUnit} and updates as the splitter is moved.\n   * With `mainContainerWidthUnit=\"fr\"`, numeric values must be from `0` to `100` (inclusive).\n   * The main and detail fractional weights are the value and `100 - value`;\n   * out-of-range values fall back to `32` and `68`.\n   * In the static layout, numeric values represent a percentage from `0` to `100`\n   * (inclusive); out-of-range values leave both containers without max-size constraints.\n   * Pixel widths are not limited to the `0` to `100` range.\n   *\n   * With `'default'`, resizable pixel layouts use {@link minMainSize}, resizable fractional\n   * layouts use main and detail weights of `32` and `68`, and static layouts use `50%`.\n   *\n   * @defaultValue 'default'\n   */\n  readonly mainContainerWidth = model<number | 'default'>('default');\n  /**\n   * Sets the minimal width of the main container in pixel.\n   *\n   * @defaultValue 300\n   */\n  readonly minMainSize = input(300);\n  /**\n   * Sets the minimal width of the detail container in pixel.\n   *\n   * @defaultValue 300\n   */\n  readonly minDetailSize = input(300);\n  /**\n   * An optional stateId to uniquely identify a component instance.\n   * Required for persistence of ui state.\n   */\n  readonly stateId = input<string>();\n\n  /**\n   * The attribute is set to true when the detail area is not visible to ensure that the user\n   * can't tab to details area when it is hidden.\n   */\n  protected preventFocusDetails = false;\n\n  private readonly actualMainContainerWidth = computed(() => {\n    const mainContainerWidth = this.mainContainerWidth();\n    if (mainContainerWidth !== 'default') {\n      return mainContainerWidth;\n    }\n\n    if (!this.resizableParts()) {\n      return 50;\n    }\n\n    return this.mainContainerWidthUnit() === 'px' ? this.minMainSize() : 32;\n  });\n\n  protected splitSizes: [number, number] = this.getSplitSizes();\n  // The max size to limit the main container in the static flex layout (if less than 50%), otherwise not set.\n  protected maxMainSize: string = this.getMaxSize(0);\n  // The max size to limit the detail container in the static flex layout (if less than 50%), otherwise not set.\n  protected maxDetailSize: string = this.getMaxSize(1);\n\n  protected readonly mainStateId = computed(() => {\n    const stateId = this.stateId();\n    return stateId ? `${stateId}-main` : undefined;\n  });\n\n  protected readonly detailStateId = computed(() => {\n    const stateId = this.stateId();\n    return stateId ? `${stateId}-detail` : undefined;\n  });\n\n  protected readonly animate = signal(false);\n\n  protected readonly opacity = signal('0');\n\n  ngOnChanges(changes: SimpleChanges<this>): void {\n    if (changes.detailsActive) {\n      this.updateDetailsFocusable();\n      this.doAnimation(changes.detailsActive.currentValue);\n    }\n    if (\n      changes.mainContainerWidth ||\n      changes.resizableParts ||\n      changes.mainContainerWidthUnit ||\n      changes.minMainSize\n    ) {\n      this.splitSizes = this.getSplitSizes();\n      this.maxMainSize = this.getMaxSize(0);\n      this.maxDetailSize = this.getMaxSize(1);\n    }\n  }\n\n  ngOnInit(): void {\n    this.resizeObserver\n      .observe(this.elementRef.nativeElement, 100, true)\n      .pipe(takeUntilDestroyed(this.destroyRef))\n      .subscribe(dimensions => this.determineLayout(dimensions));\n  }\n\n  protected onSplitSizesChange(sizes: number[]): void {\n    if (this.mainContainerWidthUnit() === 'px') {\n      this.mainContainerWidth.set(this.getMainSizePx(sizes[0]));\n    } else {\n      this.mainContainerWidth.set(sizes[0]);\n    }\n  }\n\n  protected detailsBackClicked(): void {\n    this.detailsActive.set(false);\n    this.doAnimation(false);\n  }\n\n  /**\n   * Get the max size to limit in the static flex layout (if less than 50%), otherwise not set\n   */\n  private getMaxSize(part: 0 | 1): string {\n    const mainContainerWidth = this.mainContainerWidth();\n    if (\n      this.resizableParts() ||\n      mainContainerWidth === 'default' ||\n      !this.hasLargeSize ||\n      mainContainerWidth < 0 ||\n      mainContainerWidth > 100\n    ) {\n      return '';\n    }\n\n    const size = part === 0 ? mainContainerWidth : 100 - mainContainerWidth;\n    return size > 50 ? '' : size + '%';\n  }\n\n  private getSplitSizes(): [number, number] {\n    const mainSize = this.actualMainContainerWidth();\n    if (!this.resizableParts()) {\n      return mainSize >= 0 && mainSize <= 100 ? [mainSize, 100 - mainSize] : [50, 50];\n    }\n\n    if (this.mainContainerWidthUnit() === 'fr') {\n      return mainSize >= 0 && mainSize <= 100 ? [mainSize, 100 - mainSize] : [32, 68];\n    }\n\n    // The main size is in pixels; the detail part fills the remaining space with 1fr.\n    return [mainSize, 1];\n  }\n\n  private getMainSizePx(fallbackPercentage: number): number {\n    const mainPartSize = this.mainSplitPart()?.expandedSize();\n    if (mainPartSize !== undefined) {\n      return Math.round(mainPartSize);\n    }\n\n    const splitWidth = this.splitElement()?.nativeElement.getBoundingClientRect().width;\n    return splitWidth ? Math.round((splitWidth * fallbackPercentage) / 100) : this.minMainSize();\n  }\n\n  private determineLayout(dimensions: ElementDimensions): void {\n    const newHasLargeSize = dimensions.width >= this.largeLayoutBreakpoint();\n    if (this.hasLargeSize !== newHasLargeSize) {\n      this.hasLargeSize = newHasLargeSize;\n      this.maxMainSize = this.getMaxSize(0);\n      this.maxDetailSize = this.getMaxSize(1);\n      this.updateDetailsFocusable();\n      this.hasLargeSizeChange.emit(this.hasLargeSize);\n      this.changeDetectorRef.markForCheck();\n    }\n    if (this.opacity() === '0') {\n      this.opacity.set('');\n    }\n  }\n\n  private doAnimation(detailsActive: boolean): void {\n    this.animate.set(true);\n    timer(this.animationDuration)\n      .pipe(takeUntilDestroyed(this.destroyRef))\n      .subscribe(() => this.animate.set(false));\n    this.detailsActive.set(detailsActive);\n  }\n\n  private updateDetailsFocusable(): void {\n    this.preventFocusDetails = !this.hasLargeSize && !this.detailsActive();\n  }\n}\n","@if (resizableParts() && hasLargeSize) {\n  <div class=\"main-detail-layout d-flex flex-column\" [class]=\"containerClass()\">\n    <ng-container *ngTemplateOutlet=\"headingTemplate\" />\n    <si-split\n      #splitElement\n      class=\"w-100 flex-grow-1\"\n      orientation=\"horizontal\"\n      [stateId]=\"stateId()\"\n      (sizesChange)=\"onSplitSizesChange($event)\"\n    >\n      <si-split-part\n        #mainSplitPart\n        [unit]=\"mainContainerWidthUnit()\"\n        [size]=\"splitSizes[0]\"\n        [showHeader]=\"false\"\n        [minSize]=\"minMainSize()\"\n        [stateId]=\"mainStateId()\"\n      >\n        <ng-container *ngTemplateOutlet=\"mainTemplate\" />\n      </si-split-part>\n      <si-split-part\n        unit=\"fr\"\n        [size]=\"splitSizes[1]\"\n        [showHeader]=\"false\"\n        [minSize]=\"minDetailSize()\"\n        [stateId]=\"detailStateId()\"\n      >\n        <ng-container *ngTemplateOutlet=\"detailTemplate\" />\n      </si-split-part>\n    </si-split>\n  </div>\n} @else {\n  <div\n    class=\"main-detail-layout d-flex flex-column\"\n    [class]=\"containerClass()\"\n    [class.large-size]=\"hasLargeSize\"\n  >\n    <ng-container *ngTemplateOutlet=\"headingTemplate\" />\n    <div\n      class=\"main-detail-container d-flex flex-grow-1\"\n      [class.details-active]=\"detailsActive() && !hasLargeSize\"\n    >\n      <ng-container\n        *ngTemplateOutlet=\"\n          mainTemplate;\n          context: { customClass: hasLargeSize ? 'col-3 ps-0 pe-4' : 'col-6 px-0' }\n        \"\n      />\n      <ng-container\n        *ngTemplateOutlet=\"\n          detailTemplate;\n          context: { customClass: hasLargeSize ? 'col-9 ps-4 pe-0' : 'col-6 px-0' }\n        \"\n      />\n    </div>\n  </div>\n}\n\n<!-- Templates -->\n<ng-template #headingTemplate>\n  @if (heading()) {\n    <div class=\"si-layout-header\">\n      <h2 class=\"si-layout-title si-layout-top-element\" [class.text-truncate]=\"truncateHeading()\">{{\n        heading() | translate\n      }}</h2>\n    </div>\n  }\n</ng-template>\n\n<ng-template #mainTemplate let-customClass=\"customClass\">\n  <div\n    class=\"main-container d-flex flex-column\"\n    [class]=\"[mainContainerClass(), customClass ? customClass : '']\"\n    [style.max-inline-size]=\"maxMainSize\"\n  >\n    <div class=\"main-search-actions d-flex align-items-center\">\n      <ng-content select=\"[slot=mainSearch]\" />\n      <ng-content select=\"[slot=mainActions]\" />\n    </div>\n    <div class=\"main-data-container d-flex\">\n      <ng-content select=\"[slot=mainData]\" />\n    </div>\n  </div>\n</ng-template>\n\n<ng-template #detailTemplate let-customClass=\"customClass\">\n  <div\n    class=\"detail-container d-flex flex-column\"\n    [class]=\"[detailContainerClass(), customClass ? customClass : '']\"\n    [style.max-inline-size]=\"maxDetailSize\"\n    [attr.inert]=\"preventFocusDetails ? '' : null\"\n  >\n    <div class=\"detail-heading-actions d-flex align-items-center\">\n      @if (!this.hasLargeSize && !this.hideBackButton()) {\n        <button type=\"button\" class=\"btn btn-circle btn-secondary\" (click)=\"detailsBackClicked()\">\n          <si-icon [icon]=\"icons.elementBack\" />\n          <span class=\"visually-hidden\">{{ detailsBackButtonText() | translate }}</span>\n        </button>\n      }\n      @if (detailsHeading()) {\n        <span class=\"detail-heading si-h4 me-auto ms-6 my-auto text-truncate\">{{\n          detailsHeading() | translate\n        }}</span>\n      }\n      <ng-content select=\"[slot=detailActions]\" />\n    </div>\n    <ng-content select=\"[slot=details]\" />\n  </div>\n</ng-template>\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { NgModule } from '@angular/core';\n\nimport { SiMainDetailContainerComponent } from './si-main-detail-container.component';\n\n@NgModule({\n  imports: [SiMainDetailContainerComponent],\n  exports: [SiMainDetailContainerComponent]\n})\nexport class SiMainDetailContainerModule {}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-main-detail-container.component';\nexport * from './si-main-detail-container.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;AAGG;MAgDU,8BAA8B,CAAA;AACtB,IAAA,KAAK,GAAG,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;IAEnC,iBAAiB,GAAG,GAAG;AACvB,IAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC;AACxD,IAAA,cAAc,GAAG,MAAM,CAAC,qBAAqB,CAAC;AAC9C,IAAA,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC7C,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IAC/B,YAAY,GAAG,SAAS,CAAC,cAAc,oFAAI,IAAI,EAAE,UAAU,EAAA,CAAG;IAC9D,aAAa,GAAG,SAAS,CAAC,eAAe,qFAAI,IAAI,EAAE,oBAAoB,EAAA,CAAG;AAE3F;;;;;;;AAOG;AACM,IAAA,qBAAqB,GAAG,KAAK,CAAC,qBAAqB,CAAC,SAAS;8FAAC;AAEvE;;;AAGG;AACH,IAAA,YAAY;AAEZ;;;AAGG;IACM,kBAAkB,GAAG,MAAM,EAAW;AAE/C;;;;;AAKG;IACM,aAAa,GAAG,KAAK,CAAC,KAAK;sFAAC;AAErC;;;;AAIG;IACM,OAAO,GAAG,KAAK,CAAqB,EAAE;gFAAC;AAEhD;;;;;AAKG;IACM,eAAe,GAAG,KAAK,CAAC,KAAK,uFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAExE;;;;AAIG;IACM,cAAc,GAAG,KAAK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