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)"
|
2026-03-29 18:07:10 +03:30
|
|
|
(onInput)="onPriceInput($event)"
|
2026-03-14 16:26:22 +03:30
|
|
|
(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"
|
2026-04-06 18:33:17 +03:30
|
|
|
[classList]="
|
|
|
|
|
[
|
|
|
|
|
inputClass,
|
|
|
|
|
'w-full',
|
|
|
|
|
`${size === 'large' ? 'p-inputtext-lg' : size === 'small' ? 'p-inputtext-sm' : ''}`,
|
|
|
|
|
suffixTemp || preparedSuffix() ? 'hasSuffix' : '',
|
|
|
|
|
].join(' ')
|
2026-03-14 16:26:22 +03:30
|
|
|
"
|
|
|
|
|
[required]="isRequired"
|
|
|
|
|
[invalid]="control.invalid && (control.touched || control.dirty)"
|
|
|
|
|
(onBlur)="blur.emit()"
|
|
|
|
|
(input)="onInput($event)"
|
|
|
|
|
/>
|
|
|
|
|
}
|
2026-03-29 18:07:10 +03:30
|
|
|
@if (suffixTemp) {
|
|
|
|
|
<ng-container [ngTemplateOutlet]="suffixTemp" />
|
|
|
|
|
} @else if (preparedSuffix()) {
|
2026-03-14 16:26:22 +03:30
|
|
|
<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>
|