Skip to content

Commit e7359a3

Browse files
authored
Merge pull request #4246 from atmire/w2p-127705_cleanup-input-form-spacing_contribute-main
Reduce margins on input fields
2 parents 9a24fb2 + 46a8953 commit e7359a3

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,9 @@
4040
.col-form-label {
4141
padding-top: 0;
4242
padding-bottom: 0;
43-
margin-bottom: 0.5rem;
43+
margin-bottom: 0.25rem;
44+
}
45+
46+
label {
47+
margin-bottom: 0.25rem;
4448
}

src/app/shared/form/builder/ds-dynamic-form-ui/models/list/dynamic-list.component.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
[formGroupName]="model.id"
88
[ngClass]="model.layout.element?.control">
99
@for (columnItems of items; track columnItems) {
10-
<div class="col-sm ms-3">
10+
<div class="col-sm">
1111
@for (item of columnItems; track item) {
12-
<div class="custom-control custom-checkbox">
13-
<input type="checkbox" class="custom-control-input"
12+
<div class="form-check">
13+
<input type="checkbox" class="form-check-input"
1414
[attr.aria-labelledby]="'label_' + model.id"
1515
[attr.tabindex]="item.index"
1616
[checked]="item.value"
@@ -21,7 +21,7 @@
2121
(blur)="onBlur($event)"
2222
(change)="onChange($event)"
2323
(focus)="onFocus($event)"/>
24-
<label class="custom-control-label"
24+
<label class="form-check-label"
2525
[class.disabled]="model.disabled"
2626
[ngClass]="model.layout.element?.control"
2727
[for]="item.id">
@@ -43,18 +43,18 @@
4343
[ngClass]="model.layout.element?.control"
4444
(change)="onChange($event)">
4545
@for (columnItems of items; track columnItems) {
46-
<div class="col-sm ms-3">
46+
<div class="col-sm">
4747
@for (item of columnItems; track item) {
48-
<div class="custom-control custom-radio">
49-
<input type="radio" class="custom-control-input"
48+
<div class="form-check">
49+
<input type="radio" class="form-check-input"
5050
[checked]="item.value"
5151
[id]="item.id"
5252
[name]="model.id"
5353
[required]="model.required"
5454
[value]="item.index"
5555
(blur)="onBlur($event)"
5656
(focus)="onFocus($event)"/>
57-
<label class="custom-control-label"
57+
<label class="form-check-label"
5858
[class.disabled]="model.disabled"
5959
[ngClass]="model.layout.element?.control"
6060
[for]="item.id">

src/app/shared/form/builder/ds-dynamic-form-ui/models/list/dynamic-list.component.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ describe('DsDynamicListComponent test suite', () => {
179179
});
180180

181181
it('should set model value properly when a checkbox option is selected', () => {
182-
const de = listFixture.debugElement.queryAll(By.css('div.custom-checkbox'));
183-
const items = de[0].queryAll(By.css('input.custom-control-input'));
182+
const de = listFixture.debugElement.queryAll(By.css('div.form-check'));
183+
const items = de[0].queryAll(By.css('input.form-check-input'));
184184
const item = items[0];
185185
modelValue = [Object.assign(new VocabularyEntry(), { authority: 1, display: 'one', value: 1 })];
186186

@@ -229,8 +229,8 @@ describe('DsDynamicListComponent test suite', () => {
229229
});
230230

231231
it('should set model value properly when a checkbox option is deselected', () => {
232-
const de = listFixture.debugElement.queryAll(By.css('div.custom-checkbox'));
233-
const items = de[0].queryAll(By.css('input.custom-control-input'));
232+
const de = listFixture.debugElement.queryAll(By.css('div.form-check'));
233+
const items = de[0].queryAll(By.css('input.form-check-input'));
234234
const item = items[0];
235235
modelValue = [];
236236

@@ -267,8 +267,8 @@ describe('DsDynamicListComponent test suite', () => {
267267
});
268268

269269
it('should set model value when a radio option is selected', () => {
270-
const de = listFixture.debugElement.queryAll(By.css('div.custom-radio'));
271-
const items = de[0].queryAll(By.css('input.custom-control-input'));
270+
const de = listFixture.debugElement.queryAll(By.css('div.form-check'));
271+
const items = de[0].queryAll(By.css('input.form-check-input'));
272272
const item = items[0];
273273
modelValue = Object.assign(new VocabularyEntry(), { authority: 1, display: 'one', value: 1 });
274274

0 commit comments

Comments
 (0)