@pega/dx-component-builder-sdk
Version:
Utility for building custom UI components
40 lines (39 loc) • 1.45 kB
HTML
<div *ngIf="displayMode$; else noDisplayMode">
<component-mapper *ngIf="bVisible$ !== false" name="FieldValueList" [props]="{ label$, value$: formattedValue, displayMode$ }"></component-mapper>
</div>
<ng-template #noDisplayMode>
<div *ngIf="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
type="text"
matInput
currencyMask
[options]="{
prefix: currencySymbol,
suffix: suffix,
thousands: thousandSeparator,
decimal: decimalSeparator,
align: 'left',
nullable: true,
precision: decimalPrecision,
inputMode: inputMode
}"
[placeholder]="placeholder"
step="0.01"
[formControlName]="controlName$"
[required]="bRequired$"
[formControl]="fieldControl"
[attr.data-test-id]="testId"
(blur)="fieldOnBlur($event)"
[readonly]="bReadonly$"
/>
<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>