mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
[AAE-6807] Simulate real form
This commit is contained in:
@@ -97,13 +97,25 @@
|
||||
&-compact-field {
|
||||
font-size: 12px;
|
||||
.mat-form-field-wrapper {
|
||||
padding-bottom: 0;
|
||||
padding-bottom: 6px;
|
||||
}
|
||||
&.mat-form-field-invalid {
|
||||
.mat-form-field-wrapper {
|
||||
padding-bottom: 18px;
|
||||
}
|
||||
}
|
||||
.mat-form-field-label {
|
||||
top: 0;
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&-compact-dropdown {
|
||||
font-size: 12px;
|
||||
|
||||
.mat-form-field-wrapper > div {
|
||||
background-color: var(--theme-card-bg-color);
|
||||
}
|
||||
}
|
||||
|
||||
&-form-mat-card-actions {
|
||||
|
@@ -4,9 +4,7 @@
|
||||
<mat-label *ngIf="field.compactFields" [attr.for]="field.id">{{field.name | translate }}
|
||||
<span class="adf-asterisk" *ngIf="isRequired()">*</span>
|
||||
</mat-label>
|
||||
<label *ngIf="!field.compactFields" class="adf-label" [attr.for]="field.id">{{field.name | translate }}
|
||||
<span class="adf-asterisk" *ngIf="isRequired()">*</span>
|
||||
</label>
|
||||
<label class="adf-label" *ngIf="!field.compactFields" [attr.for]="field.id">{{field.name | translate }}<span class="adf-asterisk" *ngIf="isRequired()">*</span></label>
|
||||
<input matInput
|
||||
class="adf-input"
|
||||
type="text"
|
||||
@@ -23,6 +21,6 @@
|
||||
matTooltipPosition="above"
|
||||
matTooltipShowDelay="1000">
|
||||
</mat-form-field>
|
||||
<error-widget [error]="field.validationSummary"></error-widget>
|
||||
<error-widget *ngIf="isInvalidFieldRequired() && isTouched()" required="{{ 'FORM.FIELD.REQUIRED' | translate }}"></error-widget>
|
||||
<error-widget *ngIf="isTouched() && !this.field.isValid" [error]="field.validationSummary" class="a"></error-widget>
|
||||
<error-widget *ngIf="isInvalidFieldRequired() && isTouched()" required="{{ 'FORM.FIELD.REQUIRED' | translate }}" class="b"></error-widget>
|
||||
</div>
|
@@ -1,15 +1,10 @@
|
||||
.adf {
|
||||
// &-number-widget {
|
||||
&-number-widget {
|
||||
|
||||
// display: flex;
|
||||
width: 100%;
|
||||
|
||||
// div {
|
||||
// width: 100%;
|
||||
// padding-right: 1%;
|
||||
// }
|
||||
|
||||
// .mat-form-field-label-wrapper {
|
||||
// top: 20px;
|
||||
// }
|
||||
// }
|
||||
.mat-form-field-label-wrapper label {
|
||||
top: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,26 +1,26 @@
|
||||
<div class="adf-textfield adf-text-widget {{field.className}}"
|
||||
[class.adf-invalid]="!field.isValid && isTouched()" [class.adf-readonly]="field.readOnly">
|
||||
<label class="adf-left-label" *ngIf="field.compactFields" [attr.for]="field.id">{{field.name | translate }}<span class="adf-asterisk" *ngIf="isRequired()">*</span></label>
|
||||
<div>
|
||||
<mat-form-field [hideRequiredMarker]="true">
|
||||
<label class="adf-label" *ngIf="!field.compactFields" [attr.for]="field.id">{{field.name | translate }}<span class="adf-asterisk" *ngIf="isRequired()">*</span></label>
|
||||
<input matInput
|
||||
class="adf-input"
|
||||
type="text"
|
||||
[id]="field.id"
|
||||
[required]="isRequired()"
|
||||
[value]="field.value"
|
||||
[(ngModel)]="field.value"
|
||||
(ngModelChange)="onFieldChanged(field)"
|
||||
[disabled]="field.readOnly || readOnly"
|
||||
[textMask]="{mask: mask, isReversed: isMaskReversed}"
|
||||
[placeholder]="placeholder"
|
||||
[matTooltip]="field.tooltip"
|
||||
(blur)="markAsTouched()"
|
||||
matTooltipPosition="above"
|
||||
matTooltipShowDelay="1000">
|
||||
</mat-form-field>
|
||||
<error-widget [error]="field.validationSummary"></error-widget>
|
||||
<error-widget *ngIf="isInvalidFieldRequired() && isTouched()" required="{{ 'FORM.FIELD.REQUIRED' | translate }}"></error-widget>
|
||||
</div>
|
||||
<mat-form-field [hideRequiredMarker]="true" [appearance]="field.compactFields ? 'outline' : 'legacy'" [class.adf-compact-field]="field.compactFields">
|
||||
<mat-label *ngIf="field.compactFields" [attr.for]="field.id">{{field.name | translate }}
|
||||
<span class="adf-asterisk" *ngIf="isRequired()">*</span>
|
||||
</mat-label>
|
||||
<label class="adf-label" *ngIf="!field.compactFields" [attr.for]="field.id">{{field.name | translate }}<span class="adf-asterisk" *ngIf="isRequired()">*</span></label>
|
||||
<input matInput
|
||||
class="adf-input"
|
||||
type="text"
|
||||
[id]="field.id"
|
||||
[required]="isRequired()"
|
||||
[value]="field.value"
|
||||
[(ngModel)]="field.value"
|
||||
(ngModelChange)="onFieldChanged(field)"
|
||||
[disabled]="field.readOnly || readOnly"
|
||||
[textMask]="{mask: mask, isReversed: isMaskReversed}"
|
||||
[placeholder]="placeholder"
|
||||
[matTooltip]="field.tooltip"
|
||||
(blur)="markAsTouched()"
|
||||
matTooltipPosition="above"
|
||||
matTooltipShowDelay="1000">
|
||||
</mat-form-field>
|
||||
<error-widget *ngIf="isTouched() && !this.field.isValid" [error]="field.validationSummary" class="a"></error-widget>
|
||||
<error-widget *ngIf="isInvalidFieldRequired() && isTouched()" required="{{ 'FORM.FIELD.REQUIRED' | translate }}" class="b"></error-widget>
|
||||
</div>
|
||||
|
@@ -1,14 +1,9 @@
|
||||
.adf {
|
||||
&-text-widget {
|
||||
|
||||
display: flex;
|
||||
width: 100%;
|
||||
|
||||
div {
|
||||
width: 100%;
|
||||
padding-right: 1%;
|
||||
}
|
||||
|
||||
.mat-form-field-label-wrapper {
|
||||
.mat-form-field-label-wrapper label {
|
||||
top: 20px;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user