15 |
15 |
@Component({
|
16 |
16 |
selector: '[dashboard-input]',
|
17 |
17 |
template: `
|
18 |
|
<div *ngIf="label && type != 'checkbox'"
|
19 |
|
class="uk-text-bold uk-form-label uk-margin-small-bottom">{{label + (required ? ' *' : '')}}</div>
|
|
18 |
<div *ngIf="label && type != 'checkbox'" class="uk-text-bold uk-form-label uk-margin-small-bottom">{{label + (required ? ' *' : '')}}</div>
|
20 |
19 |
<div *ngIf="hint" class="uk-margin-bottom uk-text-small uk-form-hint">{{hint}}</div>
|
21 |
20 |
<div class="uk-grid uk-flex uk-flex-middle" uk-grid>
|
22 |
21 |
<ng-content></ng-content>
|
23 |
|
<div [class.uk-hidden]="hideControl" class="uk-width-expand@m uk-position-relative" [class.uk-flex-first]="!extraLeft">
|
24 |
|
<ng-template [ngIf]="icon">
|
|
22 |
<div [class.uk-hidden]="hideControl" class="uk-width-expand@m uk-position-relative" [class.uk-flex-first]="!extraLeft">
|
|
23 |
<ng-template [ngIf]="icon && formControl.enabled">
|
25 |
24 |
<span class="uk-text-muted" [ngClass]="iconLeft?('left'):'right'">
|
26 |
25 |
<icon [name]="icon"></icon>
|
27 |
26 |
</span>
|
28 |
27 |
</ng-template>
|
|
28 |
<ng-template [ngIf]="formControl.disabled">
|
|
29 |
<span class="uk-text-muted left">
|
|
30 |
<icon [name]="'lock'"></icon>
|
|
31 |
</span>
|
|
32 |
</ng-template>
|
29 |
33 |
<ng-template [ngIf]="type === 'text'">
|
30 |
|
<input class="uk-input input-box uk-text-small" [placeholder]="placeholder" [formControl]="formControl"
|
|
34 |
<input class="uk-input input-box uk-text-small" [attr.uk-tooltip]="formControl.disabled?'title: This field is not editable; pos: bottom-left':''" [placeholder]="placeholder" [formControl]="formControl"
|
31 |
35 |
[class.uk-form-danger]="formControl.invalid && formControl.touched">
|
32 |
36 |
</ng-template>
|
33 |
37 |
<ng-template [ngIf]="type === 'textarea'">
|
34 |
|
<textarea class="uk-textarea input-box uk-text-small" [rows]="rows" [placeholder]="placeholder"
|
|
38 |
<textarea class="uk-textarea input-box uk-text-small" [attr.uk-tooltip]="formControl.disabled?'title: This field is not editable; pos: bottom-left':''" [rows]="rows" [placeholder]="placeholder"
|
35 |
39 |
[formControl]="formControl" [class.uk-form-danger]="formControl.invalid && formControl.touched">
|
36 |
40 |
</textarea>
|
37 |
41 |
</ng-template>
|
38 |
42 |
<ng-template [ngIf]="type === 'select'">
|
39 |
|
<div class="input-box clickable" [class.uk-form-danger]="formControl.invalid && formControl.touched" (click)="openSelect()">
|
|
43 |
<div class="input-box" [attr.uk-tooltip]="formControl.disabled?'title: This field is not editable; pos: bottom-left':''" [class.clickable]="formControl.enabled" [class.uk-form-danger]="formControl.invalid && formControl.touched" (click)="openSelect()">
|
40 |
44 |
<mat-form-field class="uk-width-1-1">
|
41 |
45 |
<mat-select #select *ngIf="type === 'select'" [required]="required" [value]="null"
|
42 |
46 |
(openedChange)="stopPropagation()" [formControl]="formControl" [disableOptionCentering]="true">
|
[Library | Trunk]: Add lock icon on disabled inputs