Files
psp_panel/src/app/shared/components/input/input.component.html
T

59 lines
2.1 KiB
HTML
Raw Normal View History

<uikit-field [label]="label" [name]="name" [control]="control" [showLabel]="!!label" [showErrors]="showErrors">
@if (type === "switch") {
<p-toggleSwitch [formControl]="control" />
2026-03-14 16:26:22 +03:30
} @else {
<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>
}
</p-inputgroup>
}
@if (hint) {
<small [attr.id]="name + '-help'">{{ hint }}</small>
}
2025-12-04 21:07:18 +03:30
</uikit-field>