custom-field-control.component.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <vdr-form-field [label]="label" [for]="customField.name">
  2. <input
  3. *ngIf="isTextInput"
  4. type="text"
  5. [id]="customField.name"
  6. [pattern]="customField.pattern"
  7. [formControl]="formGroup.get(customField.name)"
  8. />
  9. <select *ngIf="isSelectInput" clrSelect [formControl]="formGroup.get(customField.name)">
  10. <option *ngFor="let option of stringOptions" [value]="option.value">
  11. {{ getLabel(option.value, option.label) }}
  12. </option>
  13. </select>
  14. <input
  15. *ngIf="customField.type === 'int' || customField.type === 'float'"
  16. type="number"
  17. [id]="customField.name"
  18. [min]="min"
  19. [max]="max"
  20. [step]="step"
  21. [formControl]="formGroup.get(customField.name)"
  22. />
  23. <clr-toggle-wrapper *ngIf="customField.type === 'boolean'">
  24. <input
  25. type="checkbox"
  26. clrToggle
  27. [id]="customField.name"
  28. [formControl]="formGroup.get(customField.name)"
  29. />
  30. </clr-toggle-wrapper>
  31. <input
  32. *ngIf="customField.type === 'datetime'"
  33. type="datetime-local"
  34. [min]="min"
  35. [max]="max"
  36. [step]="step"
  37. [id]="customField.name"
  38. [value]="formGroup.get(customField.name).value | date: 'yyyy-MM-ddTHH:mm:ss'"
  39. (change)="updateDateTime(formGroup.get(customField.name), $event)"
  40. />
  41. </vdr-form-field>