You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/uui-pagination/lib/uui-pagination.element.ts
+13-12Lines changed: 13 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -78,7 +78,7 @@ export class UUIPaginationElement extends LitElement {
78
78
}
79
79
}
80
80
81
-
updateLabel(){
81
+
protectedupdateLabel(){
82
82
// TODO: make translatable:
83
83
this.ariaLabel=`${this.label||'Pagination navigation'}. Current page: ${
84
84
this.current
@@ -152,14 +152,15 @@ export class UUIPaginationElement extends LitElement {
152
152
ariaLabel='';
153
153
154
154
/**
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.
156
156
* @type {number}
157
157
* @attr
158
+
* @default: 1
158
159
*/
159
160
@property({type: Number})
160
161
total=1;
161
162
162
-
protected_range=0;
163
+
private_range=0;
163
164
@state()
164
165
getrange(){
165
166
returnthis._range;
@@ -175,17 +176,17 @@ export class UUIPaginationElement extends LitElement {
175
176
@state()
176
177
privatevisiblePages: number[]=[];
177
178
178
-
protected_current=1;
179
+
private_current=1;
180
+
179
181
/**
180
-
* This property says which page is currently shown.
182
+
* Define the current active page.
181
183
* @type {number}
182
184
* @attr
183
185
*/
184
186
@property({type: Number})
185
187
getcurrent(){
186
188
returnthis._current;
187
189
}
188
-
189
190
setcurrent(newValue: number){
190
191
constoldValue=this._current;
191
192
this._current=limit(newValue,1,this.total);
@@ -240,7 +241,7 @@ export class UUIPaginationElement extends LitElement {
240
241
class="nav"
241
242
role="listitem"
242
243
aria-label="Go to first page"
243
-
?disabled=${this.current===1}
244
+
?disabled=${this._current===1}
244
245
@click=${()=>this.goToPage(1)}>
245
246
First
246
247
</uui-button>`;
@@ -253,7 +254,7 @@ export class UUIPaginationElement extends LitElement {
253
254
class="nav"
254
255
role="listitem"
255
256
aria-label="Go to previous page"
256
-
?disabled=${this.current===1}
257
+
?disabled=${this._current===1}
257
258
@click=${this.goToPreviousPage}>
258
259
Previous
259
260
</uui-button>`;
@@ -266,7 +267,7 @@ export class UUIPaginationElement extends LitElement {
266
267
role="listitem"
267
268
class="nav"
268
269
aria-label="Go to next page"
269
-
?disabled=${this.current===this.total}
270
+
?disabled=${this._current===this.total}
270
271
@click=${this.goToNextPage}>
271
272
Next
272
273
</uui-button>`;
@@ -305,9 +306,9 @@ export class UUIPaginationElement extends LitElement {
0 commit comments