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

43 lines
1.5 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" />
} @else if (type === "price") {
<p-inputgroup>
<p-inputnumber
[attr.id]="name"
[formControl]="control"
[attr.name]="name"
[attr.placeholder]="placeholder"
[attr.inputmode]="inputMode"
[attr.maxlength]="maxLength || null"
[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)"
(input)="onInput($event)"
/>
<p-inputgroup-addon>ریال</p-inputgroup-addon>
</p-inputgroup>
} @else {
<input
pInputText
[attr.id]="name"
[formControl]="control"
[attr.name]="name"
[attr.placeholder]="placeholder"
[attr.inputmode]="inputMode"
[attr.maxlength]="maxLength || 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)"
(input)="onInput($event)"
/>
}
@if (hint) {
<small [attr.id]="name + '-help'">{{ hint }}</small>
}
2025-12-04 21:07:18 +03:30
</uikit-field>