Skip to content

Commit e46af23

Browse files
committed
ensure private methods start _
1 parent 6fe73f2 commit e46af23

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

packages/uui-pagination/lib/uui-pagination.element.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class UUIPaginationElement extends LitElement {
7878
}
7979
}
8080

81-
updateLabel() {
81+
protected updateLabel() {
8282
// TODO: make translatable:
8383
this.ariaLabel = `${this.label || 'Pagination navigation'}. Current page: ${
8484
this.current
@@ -152,14 +152,15 @@ export class UUIPaginationElement extends LitElement {
152152
ariaLabel = '';
153153

154154
/**
155-
* With this property You can set how many buttons the pagination should have. Mind that the number of visible buttons will change with the width of the container.
155+
* Set the amount of pages to navigate.
156156
* @type {number}
157157
* @attr
158+
* @default: 1
158159
*/
159160
@property({ type: Number })
160161
total = 1;
161162

162-
protected _range = 0;
163+
private _range = 0;
163164
@state()
164165
get range() {
165166
return this._range;
@@ -175,17 +176,17 @@ export class UUIPaginationElement extends LitElement {
175176
@state()
176177
private visiblePages: number[] = [];
177178

178-
protected _current = 1;
179+
private _current = 1;
180+
179181
/**
180-
* This property says which page is currently shown.
182+
* Define the current active page.
181183
* @type {number}
182184
* @attr
183185
*/
184186
@property({ type: Number })
185187
get current() {
186188
return this._current;
187189
}
188-
189190
set current(newValue: number) {
190191
const oldValue = this._current;
191192
this._current = limit(newValue, 1, this.total);
@@ -240,7 +241,7 @@ export class UUIPaginationElement extends LitElement {
240241
class="nav"
241242
role="listitem"
242243
aria-label="Go to first page"
243-
?disabled=${this.current === 1}
244+
?disabled=${this._current === 1}
244245
@click=${() => this.goToPage(1)}>
245246
First
246247
</uui-button>`;
@@ -253,7 +254,7 @@ export class UUIPaginationElement extends LitElement {
253254
class="nav"
254255
role="listitem"
255256
aria-label="Go to previous page"
256-
?disabled=${this.current === 1}
257+
?disabled=${this._current === 1}
257258
@click=${this.goToPreviousPage}>
258259
Previous
259260
</uui-button>`;
@@ -266,7 +267,7 @@ export class UUIPaginationElement extends LitElement {
266267
role="listitem"
267268
class="nav"
268269
aria-label="Go to next page"
269-
?disabled=${this.current === this.total}
270+
?disabled=${this._current === this.total}
270271
@click=${this.goToNextPage}>
271272
Next
272273
</uui-button>`;
@@ -305,9 +306,9 @@ export class UUIPaginationElement extends LitElement {
305306
if (page === this._current) return;
306307
this.goToPage(page);
307308
this.focusActivePage();
308-
}}
309-
>${page}</uui-button
310-
>`;
309+
}}>
310+
${page}
311+
</uui-button>`;
311312
}
312313

313314
protected renderNavigationLeft() {

0 commit comments

Comments
 (0)