Skip to content

Commit 27dd6e1

Browse files
anabyeanderson-gregorio-totvs
authored andcommitted
fix(stepper): corrige status disabled do stepper
O componente po-stepper não estava obedecendo o status `disabled`. Corrigido o comportamento do po-stepper para desabilitar quando status for `disabled`. fixes DTHFUI-8956
1 parent 8c3aa86 commit 27dd6e1

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

projects/ui/src/lib/components/po-stepper/po-stepper-base.component.spec.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@ describe('PoStepperBaseComponent:', () => {
5454
expect(component.step).toBe(1);
5555
});
5656

57+
it('p-steps: should respect status disabled', () => {
58+
component.steps = [
59+
{ label: 'Step 1', status: PoStepperStatus.Active },
60+
{ label: 'Step 2', status: PoStepperStatus.Disabled },
61+
{ label: 'Step 3', status: PoStepperStatus.Disabled }
62+
];
63+
64+
expect(component.steps[0].status).toBe(PoStepperStatus.Active);
65+
expect(component.steps[1].status).toBe(PoStepperStatus.Disabled);
66+
expect(component.steps[2].status).toBe(PoStepperStatus.Disabled);
67+
});
68+
5769
it('p-orientation: should update property with `horizontal` when invalid values', () => {
5870
const invalidValues = [undefined, null, '', true, false, 0, 1, 'string', [], {}];
5971

projects/ui/src/lib/components/po-stepper/po-stepper-base.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export class PoStepperBaseComponent {
145145
*/
146146
@Input('p-steps') set steps(steps: Array<PoStepperItem>) {
147147
this._steps = Array.isArray(steps) ? steps : [];
148-
this._steps.forEach(step => (step.status = PoStepperStatus.Default));
148+
this._steps.forEach(step => (step.status = step.status ?? PoStepperStatus.Default));
149149
this.step = 1;
150150
}
151151

0 commit comments

Comments
 (0)