AAE-35310 Displaying different text fields on an eform doesn't align vertically or horizontally (#10979)

* AAE-35310 fixing vertical or horizontal alignment issues

* AAE-35310 refactoring code and removed manual scss with flexboxes
This commit is contained in:
Soumyajit Chakraborty
2025-07-02 17:33:37 +05:30
committed by GitHub
parent 6dafcb4447
commit d776c7c77d
23 changed files with 78 additions and 20 deletions

View File

@@ -67,8 +67,6 @@
width: 100%; width: 100%;
flex-grow: 1; flex-grow: 1;
box-sizing: border-box; box-sizing: border-box;
padding-left: 1%;
padding-right: 1%;
} }
} }
@@ -76,6 +74,8 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
flex: 1 1 auto; flex: 1 1 auto;
padding-right: 1%;
padding-left: 1%;
} }
&-item { &-item {

View File

@@ -2,8 +2,9 @@
&-section { &-section {
&-single-column { &-single-column {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: inherit;
align-items: flex-start; align-items: baseline;
gap: 1%;
} }
&-column-view-item { &-column-view-item {
@@ -11,8 +12,6 @@
display: flex; display: flex;
flex-grow: 1; flex-grow: 1;
box-sizing: border-box; box-sizing: border-box;
padding-left: 1%;
padding-right: 1%;
} }
} }
} }

View File

@@ -9,7 +9,7 @@
>{{field.name | translate }}<span class="adf-asterisk" [style.visibility]="isRequired() ? 'visible' : 'hidden'">*</span></label >{{field.name | translate }}<span class="adf-asterisk" [style.visibility]="isRequired() ? 'visible' : 'hidden'">*</span></label
> >
</div> </div>
<div> <div class="adf-amount-widget-container">
<mat-form-field class="adf-amount-widget__input adf-form-field-input" [floatLabel]="placeholder ? 'always' : null"> <mat-form-field class="adf-amount-widget__input adf-form-field-input" [floatLabel]="placeholder ? 'always' : null">
@if ( (field.name || field?.required) && !field.leftLabels) { <mat-label class="adf-label" [attr.for]="field.id">{{field.name | translate }}</mat-label> } @if ( (field.name || field?.required) && !field.leftLabels) { <mat-label class="adf-label" [attr.for]="field.id">{{field.name | translate }}</mat-label> }
<span matTextPrefix class="adf-amount-widget__prefix-spacing">{{ currency }}&nbsp;</span> <span matTextPrefix class="adf-amount-widget__prefix-spacing">{{ currency }}&nbsp;</span>

View File

@@ -4,11 +4,16 @@
.adf { .adf {
&-amount-widget { &-amount-widget {
width: 100%; width: 100%;
margin-top: 15px;
.adf-left-label { .adf-left-label {
line-height: 36px; line-height: 36px;
} }
&-container {
display: flex;
align-items: flex-start;
flex-direction: column;
}
} }
&-amount-widget__input { &-amount-widget__input {

View File

@@ -1,5 +1,6 @@
<div [ngClass]="field.className" <div [ngClass]="field.className"
[class.adf-invalid]="!field.isValid && isTouched()"> [class.adf-invalid]="!field.isValid && isTouched()" class="adf-checkbox-widget-container"
>
<mat-checkbox [id]="field.id" <mat-checkbox [id]="field.id"
color="primary" color="primary"
class="adf-checkbox" class="adf-checkbox"
@@ -8,7 +9,8 @@
[(ngModel)]="field.value" [(ngModel)]="field.value"
(ngModelChange)="onFieldChanged(field)" (ngModelChange)="onFieldChanged(field)"
[title]="field.tooltip" [title]="field.tooltip"
(click)="markAsTouched()"> (click)="markAsTouched()"
>
{{ field.name | translate }} {{ field.name | translate }}
<span class="adf-asterisk" [style.visibility]="isRequired() ? 'visible' : 'hidden'">*</span> <span class="adf-asterisk" [style.visibility]="isRequired() ? 'visible' : 'hidden'">*</span>
</mat-checkbox> </mat-checkbox>

View File

@@ -0,0 +1,11 @@
.adf {
&-checkbox {
&-widget {
&-container {
display: flex;
align-items: flex-start;
flex-direction: column;
}
}
}
}

View File

@@ -30,6 +30,7 @@ import { WidgetComponent } from '../widget.component';
selector: 'checkbox-widget', selector: 'checkbox-widget',
standalone: true, standalone: true,
templateUrl: './checkbox.widget.html', templateUrl: './checkbox.widget.html',
styleUrl: './checkbox.widget.scss',
styles: [ styles: [
` `
.adf-checkbox { .adf-checkbox {

View File

@@ -7,7 +7,7 @@
{{ field.name | translate }} ({{ field.dateDisplayFormat }})<span class="adf-asterisk" [style.visibility]="isRequired() ? 'visible' : 'hidden'">*</span> {{ field.name | translate }} ({{ field.dateDisplayFormat }})<span class="adf-asterisk" [style.visibility]="isRequired() ? 'visible' : 'hidden'">*</span>
</label> </label>
</div> </div>
<div> <div class="adf-date-time-widget-container">
<mat-form-field class="adf-date-time-widget adf-form-field-input" <mat-form-field class="adf-date-time-widget adf-form-field-input"
[class.adf-left-label-input-datepicker]="field.leftLabels" [class.adf-left-label-input-datepicker]="field.leftLabels"
[floatLabel]="field.placeholder ? 'always' : null"> [floatLabel]="field.placeholder ? 'always' : null">

View File

@@ -3,6 +3,12 @@
.adf { .adf {
&-date-time-widget { &-date-time-widget {
&-container {
display: flex;
align-items: flex-start;
flex-direction: column;
}
#{ms.$mat-form-field-suffix} { #{ms.$mat-form-field-suffix} {
top: 26px; top: 26px;
} }

View File

@@ -1,4 +1,4 @@
<div class="{{ field.className }}" id="data-widget" [class.adf-invalid]="dateInputControl.invalid && dateInputControl.touched"> <div class="{{ field.className }} date-widget-container" id="data-widget" [class.adf-invalid]="dateInputControl.invalid && dateInputControl.touched">
<mat-form-field [floatLabel]="'always'" class="adf-date-widget adf-form-field-input" [floatLabel]="field.placeholder ? 'always' : null"> <mat-form-field [floatLabel]="'always'" class="adf-date-widget adf-form-field-input" [floatLabel]="field.placeholder ? 'always' : null">
<mat-label class="adf-label" <mat-label class="adf-label"
[id]="field.id + '-label'" [id]="field.id + '-label'"

View File

@@ -0,0 +1,9 @@
.adf {
&-widget {
&-container {
display: flex;
align-items: flex-start;
flex-direction: column;
}
}
}

View File

@@ -42,6 +42,7 @@ import { ReactiveFormWidget } from '../reactive-widget.interface';
{ provide: DateAdapter, useClass: AdfDateFnsAdapter } { provide: DateAdapter, useClass: AdfDateFnsAdapter }
], ],
templateUrl: './date.widget.html', templateUrl: './date.widget.html',
styleUrl: './date.widget.scss',
host: { host: {
'(click)': 'event($event)', '(click)': 'event($event)',
'(blur)': 'event($event)', '(blur)': 'event($event)',

View File

@@ -8,7 +8,7 @@
</label> </label>
</div> </div>
<div> <div class="adf-decimal-widget-container">
<mat-form-field class="adf-form-field-input" [floatLabel]="field.placeholder ? 'always' : null"> <mat-form-field class="adf-form-field-input" [floatLabel]="field.placeholder ? 'always' : null">
@if ( (field.name || field?.required) && !field.leftLabels) { <mat-label class="adf-label" [attr.for]="field.id">{{ field.name | translate }}</mat-label> } @if ( (field.name || field?.required) && !field.leftLabels) { <mat-label class="adf-label" [attr.for]="field.id">{{ field.name | translate }}</mat-label> }
<input matInput <input matInput

View File

@@ -2,6 +2,12 @@
&-decimal-widget { &-decimal-widget {
width: 100%; width: 100%;
&-container {
display: flex;
align-items: flex-start;
flex-direction: column;
}
.adf-label { .adf-label {
top: 20px; top: 20px;
} }

View File

@@ -1,6 +1,9 @@
.adf { .adf {
&-multiline-text-widget { &-multiline-text-widget {
width: 100%; width: 100%;
display: flex;
align-items: flex-start;
flex-direction: column;
.adf-label { .adf-label {
top: 20px; top: 20px;

View File

@@ -8,7 +8,7 @@
{{ field.name | translate }}<span class="adf-asterisk" [style.visibility]="isRequired() ? 'visible' : 'hidden'">*</span> {{ field.name | translate }}<span class="adf-asterisk" [style.visibility]="isRequired() ? 'visible' : 'hidden'">*</span>
</label> </label>
</div> </div>
<div> <div class="adf-number-widget-container">
<mat-form-field class="adf-form-field-input" [floatLabel]="field.placeholder ? 'always' : null"> <mat-form-field class="adf-form-field-input" [floatLabel]="field.placeholder ? 'always' : null">
@if( (field.name || this.field?.required) && !field.leftLabels) { @if( (field.name || this.field?.required) && !field.leftLabels) {
<mat-label class="adf-label" [attr.for]="field.id"> <mat-label class="adf-label" [attr.for]="field.id">

View File

@@ -2,6 +2,12 @@
&-number-widget { &-number-widget {
width: 100%; width: 100%;
&-container {
display: flex;
align-items: flex-start;
flex-direction: column;
}
.adf-label { .adf-label {
top: 20px; top: 20px;
} }

View File

@@ -7,7 +7,7 @@
{{ field.name | translate }}<span class="adf-asterisk" [style.visibility]="isRequired() ? 'visible' : 'hidden'">*</span> {{ field.name | translate }}<span class="adf-asterisk" [style.visibility]="isRequired() ? 'visible' : 'hidden'">*</span>
</label> </label>
</div> </div>
<div> <div class="adf-text-widget-container">
<mat-form-field class="adf-form-field-input" [floatLabel]="placeholder ? 'always' : null"> <mat-form-field class="adf-form-field-input" [floatLabel]="placeholder ? 'always' : null">
@if ( (field.name || this.field?.required) && !field.leftLabels) { <mat-label class="adf-label" [attr.for]="field.id"> @if ( (field.name || this.field?.required) && !field.leftLabels) { <mat-label class="adf-label" [attr.for]="field.id">
{{ field.name | translate }} {{ field.name | translate }}

View File

@@ -8,5 +8,11 @@
#{ms.$mat-form-field-label} { #{ms.$mat-form-field-label} {
top: 20px; top: 20px;
} }
&-container {
display: flex;
align-items: flex-start;
flex-direction: column;
}
} }
} }

View File

@@ -13,7 +13,7 @@
></label ></label
> >
</div> </div>
<div> <div class="adf-date-widget-container">
<mat-form-field class="adf-date-widget adf-form-field-input" [class.adf-left-label-input-datepicker]="field.leftLabels"> <mat-form-field class="adf-date-widget adf-form-field-input" [class.adf-left-label-input-datepicker]="field.leftLabels">
@if ( (field.name || field?.required) && !field.leftLabels) { @if ( (field.name || field?.required) && !field.leftLabels) {
<mat-label class="adf-label" [attr.for]="field.id"> <mat-label class="adf-label" [attr.for]="field.id">

View File

@@ -11,6 +11,12 @@
.adf-label { .adf-label {
top: 20px; top: 20px;
} }
&-container {
display: flex;
align-items: flex-start;
flex-direction: column;
}
} }
&-left-label-input-datepicker { &-left-label-input-datepicker {

View File

@@ -1,6 +1,4 @@
.adf-display-rich-text-widget { .adf-display-rich-text-widget {
padding: 10px;
pre { pre {
min-height: 100px; min-height: 100px;
font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;

View File

@@ -9,7 +9,6 @@
} }
&-radio-button-container { &-radio-button-container {
margin-bottom: 15px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -23,7 +22,7 @@
&-radio-button-container-horizontal { &-radio-button-container-horizontal {
margin-bottom: 15px; margin-bottom: 15px;
display: flex; display: flex;
flex-flow: row wrap; flex-flow: column wrap;
align-items: flex-start; align-items: flex-start;
justify-content: flex-start; justify-content: flex-start;