Skip to content

Commit 48440b7

Browse files
fix(fields): corrige autoheight e alinha ícones
Padroniza o alinhamento do po-helper quando não houver label associado; Move/aplica o helper para dentro do field-container-bottom em: Po-Checkbox-Group, Po-Radio-Group, Po-Rich-Text, Po-Textarea e Po-Upload para garantir espaçamento e alinhamento consistentes no formulário; Corrige autoHeight no componente Po-Multiselect; Fixes DTHFUI-12169
1 parent 9c9f254 commit 48440b7

36 files changed

+247
-331
lines changed

projects/ui/src/lib/components/po-field/po-checkbox-group/po-checkbox-group.component.html

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -36,29 +36,14 @@
3636
</ul>
3737
</div>
3838
</div>
39-
<div class="po-row po-footer-group">
40-
<po-field-container-bottom
41-
[p-additional-help-tooltip]="getAdditionalHelpTooltip()"
42-
[p-append-in-body]="appendBox"
43-
[p-help]="help"
44-
[p-disabled]="disabled"
45-
[p-error-limit]="errorLimit"
46-
[p-error-pattern]="getErrorPattern()"
47-
[p-hide-additional-help-by-label]="poHelper.hideAdditionalHelp"
48-
[p-show-additional-help]="displayAdditionalHelp"
49-
[p-show-additional-help-icon]="showAdditionalHelpIcon()"
50-
[p-size]="size"
51-
(p-additional-help)="emitAdditionalHelp()"
52-
></po-field-container-bottom>
53-
@if ((!label && poHelperComponent()) || (!label && poHelper.hideAdditionalHelp)) {
54-
<po-helper
55-
#helperEl
56-
[p-size]="size"
57-
[p-helper]="poHelper.helperSettings"
58-
[p-disabled]="disabled"
59-
[p-append-in-body]="appendBox"
60-
>
61-
</po-helper>
62-
}
63-
</div>
39+
<po-field-container-bottom
40+
[p-append-in-body]="appendBox"
41+
[p-help]="help"
42+
[p-disabled]="disabled"
43+
[p-error-limit]="errorLimit"
44+
[p-error-pattern]="getErrorPattern()"
45+
[p-size]="size"
46+
[p-helper]="!label ? poHelper.helperSettings : undefined"
47+
[p-show-helper]="!label ? displayAdditionalHelp : undefined"
48+
></po-field-container-bottom>
6449
</po-field-container>

projects/ui/src/lib/components/po-field/po-checkbox-group/po-checkbox-group.component.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,6 @@ export class PoCheckboxGroupComponent
199199
return this.displayAdditionalHelp;
200200
}
201201

202-
showAdditionalHelpIcon() {
203-
return !!this.additionalHelpTooltip || this.isAdditionalHelpEventTriggered();
204-
}
205-
206202
trackByFn(index) {
207203
return index;
208204
}

projects/ui/src/lib/components/po-field/po-checkbox/po-checkbox.component.spec.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -512,28 +512,6 @@ describe('PoCheckboxComponent:', () => {
512512
expect(component.showAdditionalHelp).not.toHaveBeenCalled();
513513
});
514514
});
515-
describe('showAdditionalHelpIcon:', () => {
516-
it('should return true when additionalHelpTooltip is truthy', () => {
517-
(component as any).additionalHelpTooltip = 'additionalHelpTooltip';
518-
spyOn(component as any, 'isAdditionalHelpEventTriggered').and.returnValue(false);
519-
520-
expect(component.showAdditionalHelpIcon()).toBeTrue();
521-
});
522-
523-
it('should return true when additionalHelpTooltip is falsy but event is triggered', () => {
524-
(component as any).additionalHelpTooltip = null;
525-
spyOn(component as any, 'isAdditionalHelpEventTriggered').and.returnValue(true);
526-
527-
expect(component.showAdditionalHelpIcon()).toBeTrue();
528-
});
529-
530-
it('should return false when additionalHelpTooltip is falsy and event not triggered', () => {
531-
(component as any).additionalHelpTooltip = null;
532-
spyOn(component as any, 'isAdditionalHelpEventTriggered').and.returnValue(false);
533-
534-
expect(component.showAdditionalHelpIcon()).toBeFalse();
535-
});
536-
});
537515
});
538516

539517
describe('Templates:', () => {

projects/ui/src/lib/components/po-field/po-checkbox/po-checkbox.component.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,6 @@ export class PoCheckboxComponent extends PoCheckboxBaseComponent implements Afte
203203
return this.displayAdditionalHelp;
204204
}
205205

206-
showAdditionalHelpIcon() {
207-
return !!this.additionalHelpTooltip || this.isAdditionalHelpEventTriggered();
208-
}
209-
210206
setHelper(label?: string, additionalHelpTooltip?: string) {
211207
return setHelperSettings(
212208
label,

projects/ui/src/lib/components/po-field/po-combo/po-combo.component.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,17 +118,12 @@
118118
}
119119

120120
<po-field-container-bottom
121-
[p-additional-help-tooltip]="getAdditionalHelpTooltip()"
122121
[p-append-in-body]="appendBox"
123122
[p-help]="help"
124123
[p-disabled]="disabled"
125124
[p-error-pattern]="getErrorPattern()"
126125
[p-error-limit]="errorLimit"
127-
[p-hide-additional-help-by-label]="poHelper.hideAdditionalHelp"
128-
[p-show-additional-help]="displayAdditionalHelp"
129-
[p-show-additional-help-icon]="showAdditionalHelpIcon()"
130126
[p-size]="size"
131-
(p-additional-help)="emitAdditionalHelp()"
132127
></po-field-container-bottom>
133128
</po-field-container>
134129

projects/ui/src/lib/components/po-field/po-combo/po-combo.component.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -668,10 +668,6 @@ export class PoComboComponent extends PoComboBaseComponent implements AfterViewI
668668
}
669669
}
670670

671-
showAdditionalHelpIcon() {
672-
return !!this.additionalHelpTooltip || this.isAdditionalHelpEventTriggered();
673-
}
674-
675671
showMoreInfiniteScroll(): void {
676672
if (this.defaultService.hasNext) {
677673
this.infiniteLoading = true;

projects/ui/src/lib/components/po-field/po-datepicker-range/po-datepicker-range.component.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,12 @@
9393

9494
@if (!readonly) {
9595
<po-field-container-bottom
96-
[p-additional-help-tooltip]="getAdditionalHelpTooltip()"
9796
[p-append-in-body]="appendBox"
9897
[p-help]="help"
9998
[p-disabled]="disabled"
10099
[p-error-pattern]="getErrorMessage"
101100
[p-error-limit]="errorLimit"
102-
[p-hide-additional-help-by-label]="poHelper.hideAdditionalHelp"
103-
[p-show-additional-help]="displayAdditionalHelp"
104-
[p-show-additional-help-icon]="showAdditionalHelpIcon()"
105101
[p-size]="size"
106-
(p-additional-help)="emitAdditionalHelp()"
107102
></po-field-container-bottom>
108103
}
109104
</po-field-container>

projects/ui/src/lib/components/po-field/po-datepicker-range/po-datepicker-range.component.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,6 @@ export class PoDatepickerRangeComponent
319319
this.isDateRangeInputFormatValid = true;
320320
}
321321

322-
showAdditionalHelpIcon() {
323-
return !!this.additionalHelpTooltip || this.isAdditionalHelpEventTriggered();
324-
}
325-
326322
/**
327323
* Método que exibe `p-helper` ou executa a ação definida em `p-helper{eventOnClick}` ou em `p-additionalHelp`.
328324
* Para isso, será necessário configurar uma tecla de atalho utilizando o evento `p-keydown`.

projects/ui/src/lib/components/po-field/po-datepicker/po-datepicker.component.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,12 @@
108108

109109
@if (!readonly) {
110110
<po-field-container-bottom
111-
[p-additional-help-tooltip]="getAdditionalHelpTooltip()"
112111
[p-append-in-body]="appendBox"
113112
[p-help]="help"
114113
[p-disabled]="disabled"
115114
[p-error-pattern]="getErrorPattern()"
116115
[p-error-limit]="errorLimit"
117-
[p-hide-additional-help-by-label]="poHelper.hideAdditionalHelp"
118-
[p-show-additional-help]="displayAdditionalHelp"
119-
[p-show-additional-help-icon]="showAdditionalHelpIcon()"
120116
[p-size]="size"
121-
(p-additional-help)="emitAdditionalHelp()"
122117
></po-field-container-bottom>
123118
}
124119
</po-field-container>

projects/ui/src/lib/components/po-field/po-datepicker/po-datepicker.component.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -495,10 +495,6 @@ export class PoDatepickerComponent extends PoDatepickerBaseComponent implements
495495
return element.classList.contains('po-datepicker-calendar-overlay');
496496
}
497497

498-
showAdditionalHelpIcon() {
499-
return !!this.additionalHelpTooltip || this.isAdditionalHelpEventTriggered();
500-
}
501-
502498
verifyErrorAsync(value) {
503499
if (this.errorPattern !== '' && this.errorAsync) {
504500
const errorAsync = this.errorAsync(value);

0 commit comments

Comments
 (0)