UNPKG

@pega/dx-component-builder-sdk

Version:

Utility for building custom UI components

32 lines (31 loc) 1.38 kB
<div *ngIf="displayMode$; else noDisplayMode"> <component-mapper *ngIf="bVisible$ !== false" name="FieldValueList" [props]="{ label$, value$, displayMode$, hideLabel }"></component-mapper> </div> <ng-template #noDisplayMode> <div *ngIf="!bReadonly$ && bHasForm$; else noEdit"> <div [formGroup]="formGroup$" *ngIf="bVisible$"> <mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText"> <mat-label>{{ label$ }}</mat-label> <input matInput [placeholder]="placeholder" [formControl]="fieldControl" [attr.data-test-id]="testId" [required]="bRequired$" [matAutocomplete]="auto" (input)="fieldOnChange($event)" (blur)="fieldOnBlur($event)" /> <mat-autocomplete #auto="matAutocomplete" autoActiveFirstOption (optionSelected)="optionChanged($event)"> <mat-option *ngFor="let opt of filteredOptions | async" [value]="opt.value"> <span>{{ opt.value }}</span> </mat-option> </mat-autocomplete> <mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error> </mat-form-field> </div> </div> </ng-template> <ng-template #noEdit> <component-mapper *ngIf="bVisible$ !== false" name="Text" [props]="{ pConn$, formatAs$: 'text' }"></component-mapper> </ng-template>