|
|
|
@ -6,17 +6,20 @@ import { NG_VALUE_ACCESSOR } from '@angular/forms'; |
|
|
|
selector: 'abp-form-input', |
|
|
|
template: ` |
|
|
|
<div class="mb-3"> |
|
|
|
<label class= *ngIf="label" [ngClass]="labelClass" [for]="inputId" > {{label | abpLocalization}} </label> |
|
|
|
<label class="*ngIf" ="label" [ngClass]="labelClass" [for]="inputId"> |
|
|
|
{{ label | abpLocalization }} |
|
|
|
</label> |
|
|
|
<input |
|
|
|
type="text" |
|
|
|
[id]="inputId" |
|
|
|
[placeholder]="inputPlaceholder" |
|
|
|
[id]="inputId" |
|
|
|
[placeholder]="inputPlaceholder" |
|
|
|
[readonly]="inputReadonly" |
|
|
|
[ngClass]="inputClass" |
|
|
|
[ngStyle]="inputStyle" |
|
|
|
(blur)="onBlur.next()" |
|
|
|
(focus)="onFocus.next()" |
|
|
|
[(ngModel)]="value"> |
|
|
|
[ngClass]="inputClass" |
|
|
|
[ngStyle]="inputStyle" |
|
|
|
(blur)="formBlur.next()" |
|
|
|
(focus)="formFocus.next()" |
|
|
|
[(ngModel)]="value" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
`,
|
|
|
|
providers: [ |
|
|
|
@ -25,22 +28,21 @@ import { NG_VALUE_ACCESSOR } from '@angular/forms'; |
|
|
|
useExisting: forwardRef(() => FormInputComponent), |
|
|
|
multi: true, |
|
|
|
}, |
|
|
|
] |
|
|
|
], |
|
|
|
}) |
|
|
|
export class FormInputComponent extends AbstractNgModelComponent { |
|
|
|
@Input() inputId!: string; |
|
|
|
@Input() inputReadonly: boolean = false; |
|
|
|
@Input() label: string = ''; |
|
|
|
@Input() inputReadonly = false; |
|
|
|
@Input() label = ''; |
|
|
|
@Input() labelClass = 'form-label'; |
|
|
|
@Input() inputPlaceholder: string = ''; |
|
|
|
@Input() inputType: string = 'text'; |
|
|
|
@Input() inputStyle: string = ''; |
|
|
|
@Input() inputClass: string = 'form-control'; |
|
|
|
@Output() onBlur = new EventEmitter<void>(); |
|
|
|
@Output() onFocus = new EventEmitter<void>(); |
|
|
|
@Input() inputPlaceholder = ''; |
|
|
|
@Input() inputType = 'text'; |
|
|
|
@Input() inputStyle = ''; |
|
|
|
@Input() inputClass = 'form-control'; |
|
|
|
@Output() formBlur = new EventEmitter<void>(); |
|
|
|
@Output() formFocus = new EventEmitter<void>(); |
|
|
|
|
|
|
|
constructor(injector: Injector) { |
|
|
|
super(injector); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|