File

feature-libs/product-configurator/rulebased/components/conflict-description/configurator-conflict-description.component.ts

Metadata

changeDetection ChangeDetectionStrategy.OnPush
selector cx-configurator-conflict-description
templateUrl ./configurator-conflict-description.component.html

Index

Properties
Methods
Inputs
HostBindings

Constructor

constructor()

Inputs

currentGroup
Type : Configurator.Group

HostBindings

tabindex
Type : string
Default value : '0'

Methods

displayConflictDescription
displayConflictDescription(group: Configurator.Group)

Verifies whether the conflict description should be displayed for the current group.

Parameters :
Name Type Optional Description
group Configurator.Group No
  • Current group
Returns : boolean
  • 'True' if the conflict description should be displayed, otherwise 'false'.

Properties

currentGroup
Type : Configurator.Group
Decorators :
@Input()
groupType
Default value : Configurator.GroupType
iconTypes
Default value : ICON_TYPE
tabindex
Type : string
Default value : '0'
Decorators :
@HostBinding('tabindex')
import {
  ChangeDetectionStrategy,
  Component,
  HostBinding,
  Input,
} from '@angular/core';
import { ICON_TYPE } from '@spartacus/storefront';
import { Configurator } from '../../core/model/configurator.model';

@Component({
  selector: 'cx-configurator-conflict-description',
  templateUrl: './configurator-conflict-description.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ConfiguratorConflictDescriptionComponent {
  @Input() currentGroup: Configurator.Group;

  groupType = Configurator.GroupType;
  iconTypes = ICON_TYPE;

  @HostBinding('tabindex') tabindex = '0';

  constructor() {}

  /**
   * Verifies whether the  conflict description should be displayed for the current group.
   *
   * @param {Configurator.Group} group - Current group
   * @return {boolean} - 'True' if the conflict description should be displayed, otherwise 'false'.
   */
  displayConflictDescription(group: Configurator.Group): boolean {
    return group.groupType === Configurator.GroupType.CONFLICT_GROUP;
  }
}
<ng-container *ngIf="displayConflictDescription(currentGroup)">
  <cx-icon [type]="iconTypes.WARNING"></cx-icon>
  {{ currentGroup.name }}
</ng-container>
Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""