Skip to content

Commit 9e95189

Browse files
ViktorSlavovrkaraivanov
authored andcommitted
refactor(circular-bar): use *ngIf instead of ngClass in progress bar template - 9.0.x (#6099)
* refactor(linear-bar): use *ngIf instead of ngClass in progress bar template * chore(linear-bar): fix failing tests
1 parent fc163aa commit 9e95189

File tree

4 files changed

+5
-13
lines changed

4 files changed

+5
-13
lines changed

projects/igniteui-angular/src/lib/core/styles/components/progress/_progress-component.scss

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@
115115

116116
@include e(text, $m: hidden) {
117117
@extend %circular-text !optional;
118-
@extend %circular-text--hidden !optional;
119118
}
120119

121120
@include m(indeterminate) {
@@ -124,9 +123,5 @@
124123
@include e(outer) {
125124
@extend %circular-outer--indeterminate !optional;
126125
}
127-
128-
@include e(text) {
129-
@extend %circular-text--hidden !optional;
130-
}
131126
}
132127
}

projects/igniteui-angular/src/lib/core/styles/components/progress/_progress-theme.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,6 @@
311311
fill: --var($theme, 'text-color');
312312
}
313313

314-
%circular-text--hidden {
315-
visibility: hidden;
316-
}
317-
318314
@include keyframes('indeterminate-accordion') {
319315
from {
320316
stroke-dashoffset: 578;

projects/igniteui-angular/src/lib/progressbar/circularbar.component.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,8 @@ describe('IgCircularBar', () => {
322322

323323
componentInstance.progressbar.textVisibility = false;
324324
fixture.detectChanges();
325-
expect(progressBarElem.children[2].classList.value).toMatch(CIRCULAR_HIDDEN_TEXT_CLASS);
325+
// Text is not rendered
326+
expect(progressBarElem.children[2]).toBeFalsy();
326327
});
327328

328329
it('When indeterminate mode is on value should not be updated', () => {
@@ -375,8 +376,8 @@ describe('IgCircularBar', () => {
375376

376377
componentInstance.progressbar.textVisibility = false;
377378
fixture.detectChanges();
378-
379-
expect(progressBarElem.children[2].classList.value).toMatch(CIRCULAR_HIDDEN_TEXT_CLASS);
379+
// Text is not rendered
380+
expect(progressBarElem.children[2]).toBeFalsy();
380381
}));
381382

382383
it('The max representation should respond correctly to passed maximum value', fakeAsync(() => {

projects/igniteui-angular/src/lib/progressbar/templates/circular-bar.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[attr.aria-valuenow]="value">
88
<circle class="igx-circular-bar__inner" cx="50" cy="50" r="46" />
99
<circle #circle class="igx-circular-bar__outer" cx="50" cy="50" r="46" />
10-
<text [class.igx-circular-bar__text--hidden]="!textVisibility" text-anchor="middle" x="50" y="60">
10+
<text *ngIf="textVisibility" text-anchor="middle" x="50" y="60">
1111
<ng-container *ngTemplateOutlet="textTemplate ? textTemplate.template : defaultTextTemplate; context: context">
1212
</ng-container>
1313
</text>

0 commit comments

Comments
 (0)