2025-12-09 20:17:00 +03:30
|
|
|
<uikit-field [label]="label" [name]="name" [control]="control" [showLabel]="!!label" [showErrors]="showErrors">
|
2025-12-04 23:34:00 +03:30
|
|
|
@if (type === "switch") {
|
|
|
|
|
<p-toggleSwitch [formControl]="control" />
|
2026-03-14 16:26:22 +03:30
|
|
|
} @else {
|
2025-12-27 20:35:02 +03:30
|
|
|
<p-inputgroup>
|
2026-03-14 16:26:22 +03:30
|
|
|
<!-- [minlength]="minlength || null" -->
|
|
|
|
|
@if (type === "price") {
|
|
|
|
|
<p-inputnumber
|
|
|
|
|
[attr.id]="name"
|
|
|
|
|
[formControl]="control"
|
|
|
|
|
[maxlength]="preparedMaxLength || null"
|
|
|
|
|
[attr.name]="name"
|
|
|
|
|
[attr.placeholder]="preparedPlaceholder"
|
|
|
|
|
[attr.type]="htmlType"
|
|
|
|
|
[attr.autocomplete]="autocomplete"
|
|
|
|
|
[class]="` w-full ${size === 'large' ? 'p-inputtext-lg' : size === 'small' ? 'p-inputtext-sm' : ''}`"
|
|
|
|
|
[required]="isRequired"
|
|
|
|
|
[invalid]="control.invalid && (control.touched || control.dirty)"
|
|
|
|
|
(onBlur)="blur.emit()"
|
|
|
|
|
/>
|
|
|
|
|
<!-- (input)="onInput($event)" -->
|
|
|
|
|
} @else {
|
|
|
|
|
<input
|
|
|
|
|
pInputText
|
|
|
|
|
[attr.id]="name"
|
|
|
|
|
[formControl]="control"
|
|
|
|
|
[attr.name]="name"
|
|
|
|
|
[attr.placeholder]="preparedPlaceholder"
|
|
|
|
|
[attr.inputmode]="inputMode"
|
|
|
|
|
[attr.maxlength]="preparedMaxLength || null"
|
|
|
|
|
[attr.type]="htmlType"
|
|
|
|
|
[attr.autocomplete]="autocomplete"
|
|
|
|
|
[class]="
|
|
|
|
|
`${inputClass} w-full ${size === 'large' ? 'p-inputtext-lg' : size === 'small' ? 'p-inputtext-sm' : ''}`
|
|
|
|
|
"
|
|
|
|
|
[required]="isRequired"
|
|
|
|
|
[invalid]="control.invalid && (control.touched || control.dirty)"
|
|
|
|
|
(onBlur)="blur.emit()"
|
|
|
|
|
(input)="onInput($event)"
|
|
|
|
|
/>
|
|
|
|
|
}
|
|
|
|
|
@if (preparedSuffix()) {
|
|
|
|
|
<p-inputgroup-addon>{{ preparedSuffix() }}</p-inputgroup-addon>
|
|
|
|
|
}
|
2025-12-27 20:35:02 +03:30
|
|
|
</p-inputgroup>
|
2025-12-04 23:34:00 +03:30
|
|
|
}
|
2025-12-27 20:35:02 +03:30
|
|
|
@if (hint) {
|
|
|
|
|
<small [attr.id]="name + '-help'">{{ hint }}</small>
|
|
|
|
|
}
|
2025-12-04 21:07:18 +03:30
|
|
|
</uikit-field>
|