All files / info-page si-info-page.component.ts

100% Statements 7/7
100% Branches 0/0
100% Functions 0/0
100% Lines 7/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51                                              1x           2x           2x   2x   2x   2x             2x    
/**
 * Copyright (c) Siemens 2016 - 2025
 * SPDX-License-Identifier: MIT
 */
import { NgClass } from '@angular/common';
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
import { SiIconComponent } from '@siemens/element-ng/icon';
import { Link, SiLinkDirective } from '@siemens/element-ng/link';
import { SiTranslatePipe, TranslatableString } from '@siemens/element-translate-ng/translate';
 
/**
 * The component displays application info messages. A message uses an icon and a title, optionally a copy text,
 * instructions and a link. Replace the integrated icon by content projection of another icon or image with the
 * CSS class `.si-info-image`. Use content projection with the CSS class `si-info-actions` to inject more buttons
 * and options to interact with the page.
 */
@Component({
  selector: 'si-info-page',
  imports: [NgClass, SiLinkDirective, SiIconComponent, SiTranslatePipe],
  templateUrl: './si-info-page.component.html',
  styleUrl: './si-info-page.component.scss',
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class SiInfoPageComponent {
  /**
   * The element warning icon.
   *
   * @defaultValue 'element-warning-filled'
   */
  readonly icon = input<string>('element-warning-filled');
  /**
   * Icon color class, see {@link https://element.siemens.io/fundamentals/typography/#color-variants-classes}
   *
   * @defaultValue 'status-warning'
   */
  readonly iconColor = input<string | undefined>('status-warning');
  /** A short and concise title to explain the error. */
  readonly titleText = input.required<TranslatableString>();
  /** A more detailed explanation of the error, outlining the reasoning for it and how a user can resolve it. */
  readonly copyText = input<TranslatableString>();
  /** A detailed instruction on how a user can resolve the error. */
  readonly instructions = input<TranslatableString>();
  /**
   * Use the link object if you have one option to follow. A link object
   * has a title to be displayed and can be configured with an external link,
   * a router link, or a custom action. If you want to provide multiple options,
   * add your own content into the component.
   */
  readonly link = input<Link>();
}