-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(progress): implementa definições do AnimaliaDS
Implementa definições de estilo e acessibilidade definidos pelo AnimaliaDS Fixes DTHFUI-7808
- Loading branch information
1 parent
4607209
commit ad59a5e
Showing
14 changed files
with
180 additions
and
49 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
projects/ui/src/lib/components/po-progress/enums/po-progress-size.enum.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* @usedBy PoProgressComponent | ||
* | ||
* @description | ||
* | ||
* *Enum* `PoProgressSize` para o tamanho da altura da barra de progresso. | ||
*/ | ||
export enum PoProgressSize { | ||
medium = 'medium', | ||
|
||
large = 'large' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export * from './enums/po-progress-status.enum'; | ||
export * from './enums/po-progress-size.enum'; | ||
|
||
export * from './po-progress.component'; | ||
export * from './po-progress.module'; |
18 changes: 18 additions & 0 deletions
18
projects/ui/src/lib/components/po-progress/literals/po-progress.literals.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export const poProgressLiterals = { | ||
en: { | ||
cancel: 'Cancel', | ||
retry: 'Retry' | ||
}, | ||
es: { | ||
cancel: 'Cancelar', | ||
retry: 'Procesar de nuevo' | ||
}, | ||
pt: { | ||
cancel: 'Cancelar', | ||
retry: 'Tentar Novamente' | ||
}, | ||
ru: { | ||
cancel: 'Отмена', | ||
retry: 'Повторить попытку' | ||
} | ||
}; |
18 changes: 15 additions & 3 deletions
18
projects/ui/src/lib/components/po-progress/po-progress-bar/po-progress-bar.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,16 @@ | ||
<div [class.po-progress-bar-indeterminate]="indeterminate"> | ||
<div class="po-progress-bar-element po-progress-bar-primary" [style.transform]="'scaleX(' + valueScale + ')'"></div> | ||
<div class="po-progress-bar-element po-progress-bar-secondary"></div> | ||
<div | ||
*ngIf="!indeterminate" | ||
role="progressbar" | ||
[attr.aria-valuenow]="value" | ||
aria-valuemin="0" | ||
aria-valuemax="100" | ||
aria-live="polite" | ||
class="po-progress-bar-default" | ||
> | ||
<div class="po-progress-bar-element po-progress-bar-primary"></div> | ||
<div class="po-progress-bar-element po-progress-bar-secondary" [style.left]="'-' + (100 - value) + '%'"></div> | ||
</div> | ||
|
||
<div *ngIf="indeterminate" class="po-progress-bar-indeterminate-track"> | ||
<div class="po-progress-bar-indeterminate-track-bar"></div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 33 additions & 22 deletions
55
projects/ui/src/lib/components/po-progress/po-progress.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,41 @@ | ||
<div class="po-progress" [ngClass]="statusClass"> | ||
<label *ngIf="text" class="po-progress-description-mobile po-progress-description-text"> | ||
{{ text }} | ||
</label> | ||
|
||
<po-progress-bar class="po-progress-bar" [p-indeterminate]="indeterminate" [p-value]="value"> </po-progress-bar> | ||
|
||
<div *ngIf="text" class="po-progress-description"> | ||
<label class="po-progress-description-text"> | ||
{{ text }} | ||
</label> | ||
<po-label [p-label]="text"></po-label> | ||
</div> | ||
|
||
<div *ngIf="isAllowProgressInfo" class="po-progress-info"> | ||
<span *ngIf="infoIcon" class="po-progress-info-icon po-icon {{ infoIcon }}"></span> | ||
<span *ngIf="info" class="po-progress-info-text">{{ info }}</span> | ||
<po-progress-bar | ||
class="po-progress-bar po-progress-bar-{{ size }}" | ||
[p-indeterminate]="indeterminate" | ||
[p-value]="value" | ||
> | ||
</po-progress-bar> | ||
|
||
<button | ||
*ngIf="isAllowRetry" | ||
class="po-progress-info-icon-action po-icon po-icon-refresh po-clickable" | ||
(click)="emitRetry()" | ||
></button> | ||
<div class="po-progress-info"> | ||
<div class="po-progress-info-left"> | ||
<po-icon *ngIf="infoIcon" [p-icon]="infoIcon" [class.po-progress-info-icon-error]="status === 'error'"></po-icon> | ||
<po-icon *ngIf="isAllowInfoError" p-icon="po-icon-exclamation" class="po-progress-info-icon-error"></po-icon> | ||
<span *ngIf="info" class="po-progress-info-text" [class.po-progress-info-text-error]="status === 'error'">{{ | ||
info | ||
}}</span> | ||
</div> | ||
<div class="po-progress-info-right"> | ||
<span *ngIf="showPercentage && !indeterminate">{{ value }}%</span> | ||
<po-button | ||
*ngIf="isAllowRetry" | ||
p-icon="po-icon-refresh" | ||
(p-click)="emitRetry()" | ||
[p-aria-label]="literals.retry" | ||
p-kind="tertiary" | ||
></po-button> | ||
|
||
<button | ||
*ngIf="isAllowCancel" | ||
class="po-progress-info-icon-action po-icon po-icon-close po-clickable" | ||
(click)="emitCancellation()" | ||
></button> | ||
<po-button | ||
*ngIf="isAllowCancel" | ||
p-icon="po-icon-close" | ||
(p-click)="emitCancellation()" | ||
p-kind="secondary" | ||
[p-aria-label]="literals.cancel" | ||
[p-danger]="true" | ||
></po-button> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.