mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-1288] moved label inside field for easier styling (#8347)
This commit is contained in:
@@ -1,14 +1,10 @@
|
||||
<div [ngSwitch]="templateType">
|
||||
<div class="adf-property-label"
|
||||
[attr.data-automation-id]="'card-textitem-label-' + property.key"
|
||||
*ngIf="showProperty || isEditable">
|
||||
{{ property.label | translate }}
|
||||
</div>
|
||||
|
||||
<div *ngSwitchDefault>
|
||||
<mat-form-field class="adf-property-field adf-card-textitem-field"
|
||||
[ngClass]="{ 'adf-property-read-only': !isEditable,'adf-property-field-has-error': isEditable && hasErrors }"
|
||||
[ngClass]="{ 'adf-property-read-only': !isEditable,'adf-property-field-has-error mat-form-field-invalid': isEditable && hasErrors }"
|
||||
[floatLabel]="'never'">
|
||||
<ng-container *ngTemplateOutlet="label"></ng-container>
|
||||
<div class="adf-property-field-content">
|
||||
<input matInput
|
||||
*ngIf="!property.multiline"
|
||||
class="adf-property-value"
|
||||
@@ -31,7 +27,9 @@
|
||||
[placeholder]="property.default"
|
||||
[attr.aria-label]="property.label | translate"
|
||||
[formControl]="textInput"
|
||||
[attr.data-automation-id]="'card-textitem-value-' + property.key"></textarea>
|
||||
[attr.data-automation-id]="'card-textitem-value-' + property.key">
|
||||
</textarea>
|
||||
|
||||
<button mat-button
|
||||
matSuffix
|
||||
class="adf-property-clear-value"
|
||||
@@ -41,10 +39,15 @@
|
||||
(click)="clearValue()">
|
||||
<mat-icon>cancel</mat-icon>
|
||||
</button>
|
||||
<mat-icon matSuffix
|
||||
<div matSuffix *ngIf="isEditable" class="adf-textitem-edit-value">
|
||||
<mat-icon
|
||||
*ngIf="isEditable"
|
||||
mat-icon-button
|
||||
[attr.title]="'CORE.METADATA.ACTIONS.EDIT' | translate"
|
||||
class="adf-textitem-edit-icon">mode_edit</mat-icon>
|
||||
class="adf-textitem-edit-icon"
|
||||
>mode_edit</mat-icon>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</mat-form-field>
|
||||
</div>
|
||||
@@ -98,6 +101,7 @@
|
||||
fxLayoutAlign="space-between center">
|
||||
<mat-form-field class="adf-property-field adf-card-textitem-field"
|
||||
[floatLabel]="'never'">
|
||||
<ng-container *ngTemplateOutlet="label"></ng-container>
|
||||
<input matInput
|
||||
[type]=property.inputType
|
||||
class="adf-property-value"
|
||||
@@ -124,6 +128,18 @@
|
||||
</div>
|
||||
|
||||
<div *ngSwitchCase="'emptyTemplate'">
|
||||
<ng-container *ngTemplateOutlet="label"></ng-container>
|
||||
<span class="adf-textitem-default-value">{{ property.default | translate }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ng-template #label>
|
||||
<mat-label>
|
||||
<div class="adf-property-label"
|
||||
[attr.data-automation-id]="'card-textitem-label-' + property.key"
|
||||
*ngIf="showProperty || isEditable"
|
||||
>
|
||||
{{ property.label | translate }}
|
||||
</div>
|
||||
</mat-label>
|
||||
</ng-template>
|
||||
|
@@ -166,14 +166,33 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
&-property-field {
|
||||
.adf-property-clear-value,
|
||||
.adf-textitem-edit-value {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.adf-textitem-edit-value {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.adf-property-field-content {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
&-property-field.adf-card-textitem-field:hover {
|
||||
.adf-textitem-edit-value,
|
||||
.adf-textitem-edit-icon {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.adf-property-clear-value {
|
||||
color: var(--theme-foreground-text-color-025);
|
||||
display: inline;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.adf-property-clear-value:hover {
|
||||
|
Reference in New Issue
Block a user