Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
attr.aria-labelledby="{{ariaLabelledBy}}"
attr.aria-describedby="{{ariaDescribedBy}}"
>
<img
<img aria-hidden="true"
src="{{ iconSrc }}"
*ngIf="iconSrc"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { AbstractControlDirective, AbstractControl } from '@angular/forms';
selector: 'dxc-show-errors',
template: `
<ul *ngIf="shouldShowErrors()" class="position-absolute">
<li style="color: red" *ngFor="let error of listOfErrors()">{{error}}</li>
<li style="color: red" *ngFor="let error of listOfErrors()">
<div role="alert" tabindex="0">{{error}}</div></li>
</ul>
`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
[iconSrc]="firstImgSrc"
[disabled]="currentPageInternal === 1"
[tabIndexValue]="tabIndexValue"
ariaLabel="{{globalResource.tltfirstPage?.description}}"
></dxc-button>
<dxc-button
*ngIf="showPrev"
Expand All @@ -40,6 +41,8 @@
[iconSrc]="prevImgSrc"
[disabled]="currentPageInternal === 1"
[tabIndexValue]="tabIndexValue"
ariaLabel="{{globalResource.tltPreviousPage?.description}}"

></dxc-button>
<span class="text-nowrap" *ngIf="!showGoToPage"> Page: {{ currentPageInternal }} of {{ totalPages }} </span>
<span *ngIf="showGoToPage" class="go-to-page">
Expand Down Expand Up @@ -67,6 +70,7 @@
[iconSrc]="nextImgSrc"
[disabled]="currentPageInternal === totalPages"
[tabIndexValue]="tabIndexValue"
ariaLabel="{{globalResource.tltnextPage?.description}}"
>
</dxc-button>
<dxc-button
Expand All @@ -78,6 +82,7 @@
[iconSrc]="lastImgSrc"
[disabled]="currentPageInternal === totalPages"
[tabIndexValue]="tabIndexValue"
ariaLabel="{{globalResource.tltLastPage?.description}}"
>
</dxc-button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ import {
import { BehaviorSubject } from "rxjs";
import { coerceNumberProperty, coerceArray } from "@angular/cdk/coercion";
import { css } from "emotion";
import { ConfigurationsetupService } from './../services/startup/configurationsetup.service';

@Component({
selector: "dxc-paginator",
templateUrl: "./dxc-paginator.component.html",
styleUrls: ["./dxc-paginator.component.scss"],
})
export class DxcPaginatorComponent implements OnInit {
globalResource: { [key: string]: { description: string, type: string } };
@Input()
get currentPage(): number {
return this._currentPage;
Expand Down Expand Up @@ -100,13 +102,16 @@ export class DxcPaginatorComponent implements OnInit {
tabIndexValue: 0
});

constructor() {
constructor(
public config: ConfigurationsetupService,
) {
this.currentPage = 1;
this.itemsPerPage = 5;
this.totalItems = 1;
}

ngOnInit() {
this.globalResource = this.config.configservice.Resources;
this.calculateInternalValues(this.defaultInputs.getValue());
this.setButtonVisibility(this.paginationActions);
this.className = `${this.getDynamicStyle()}`;
Expand Down