@redvars/peacock 3.14.0 → 3.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,7 @@
1
- import { i, _ as __decorate, I as IndividualComponent, a as i$1, b } from './IndividualComponent-Bdwyrvd6.js';
1
+ import { i, _ as __decorate, I as IndividualComponent, a as i$1, b, A } from './IndividualComponent-Bdwyrvd6.js';
2
2
  import { n } from './property-B49QQ8pS.js';
3
+ import { e } from './class-map-DG7CA1et.js';
4
+ import './directive-ZPhl09Yt.js';
3
5
 
4
6
  var css_248z = i`* {
5
7
  box-sizing: border-box;
@@ -17,96 +19,251 @@ var css_248z = i`* {
17
19
  :host {
18
20
  display: block;
19
21
  container-type: inline-size;
22
+ --pagination-background: var(--color-surface, #fff);
23
+ --_pagination-target-size: 2.5rem;
20
24
  }
21
25
 
22
26
  .pagination {
23
27
  display: flex;
24
- align-items: center;
25
- justify-content: space-between;
26
28
  flex-wrap: wrap;
27
- gap: var(--spacing-200, 1rem);
28
- row-gap: var(--spacing-100, 0.5rem);
29
- background: var(--color-surface, #fff);
30
- padding: var(--spacing-150, 0.75rem) var(--spacing-200, 1rem);
29
+ align-items: center;
30
+ gap: var(--spacing-100, 0.5rem) var(--spacing-300, 1.5rem);
31
+ padding: var(--spacing-100, 0.5rem) var(--spacing-200, 1rem);
32
+ background: var(--pagination-background);
33
+ color: var(--color-on-surface-variant);
34
+ font-family: var(--typography-body-medium-font-family);
35
+ font-size: var(--typography-body-medium-font-size);
36
+ font-weight: var(--typography-body-medium-font-weight);
37
+ line-height: var(--typography-body-medium-line-height);
38
+ letter-spacing: var(--typography-body-medium-letter-spacing);
31
39
  }
32
- @container (min-width: 48rem) {
33
- .pagination {
34
- flex-wrap: nowrap;
35
- justify-content: flex-end;
36
- row-gap: 0;
37
- }
40
+
41
+ .range {
42
+ flex: 1 1 auto;
43
+ white-space: nowrap;
44
+ font-variant-numeric: tabular-nums;
38
45
  }
39
- .pagination .page-size {
46
+
47
+ .page-size {
40
48
  display: inline-flex;
41
49
  align-items: center;
42
50
  gap: var(--spacing-100, 0.5rem);
43
- min-inline-size: max-content;
44
51
  }
45
- .pagination .page-size-label {
46
- font-family: var(--typography-body-small-font-family);
47
- font-size: var(--typography-body-small-font-size);
48
- font-weight: var(--typography-body-small-font-weight);
49
- line-height: var(--typography-body-small-line-height);
50
- letter-spacing: var(--typography-body-small-letter-spacing);
51
- color: var(--color-on-surface-variant);
52
+
53
+ .page-size-label {
52
54
  white-space: nowrap;
53
55
  }
54
- .pagination .page-size-select {
56
+
57
+ .page-size-select {
55
58
  inline-size: 5.5rem;
56
- min-inline-size: 5.5rem;
57
- --field-container-height: 2.5rem;
59
+ --field-height: var(--_pagination-target-size);
60
+ --field-padding-block: 0;
58
61
  }
59
- .pagination .pagination-item-count {
60
- order: 3;
61
- margin-inline-start: 0;
62
- inline-size: 100%;
62
+
63
+ .controls {
64
+ display: inline-flex;
65
+ align-items: center;
66
+ gap: var(--spacing-050, 0.25rem);
67
+ }
68
+
69
+ .nav-button {
70
+ --button-container-shape: var(--shape-corner-full);
71
+ }
72
+
73
+ .page-list {
63
74
  display: flex;
64
75
  align-items: center;
76
+ gap: var(--spacing-025, 0.125rem);
77
+ margin: 0;
78
+ padding: 0;
79
+ list-style: none;
65
80
  }
66
- @container (min-width: 48rem) {
67
- .pagination .pagination-item-count {
68
- order: 0;
69
- margin-inline-start: auto;
70
- inline-size: auto;
71
- }
81
+
82
+ .page-button {
83
+ background: transparent;
84
+ border: none;
85
+ appearance: none;
86
+ margin: 0;
87
+ outline: none;
88
+ padding: 0;
89
+ font-family: var(--typography-label-large-font-family);
90
+ font-size: var(--typography-label-large-font-size);
91
+ font-weight: var(--typography-label-large-font-weight);
92
+ line-height: var(--typography-label-large-line-height);
93
+ letter-spacing: var(--typography-label-large-letter-spacing);
94
+ display: inline-flex;
95
+ align-items: center;
96
+ justify-content: center;
97
+ min-inline-size: var(--_pagination-target-size);
98
+ block-size: var(--_pagination-target-size);
99
+ padding: 0 var(--spacing-100, 0.5rem);
100
+ border-radius: var(--shape-corner-full);
101
+ color: var(--color-on-surface-variant);
102
+ font-variant-numeric: tabular-nums;
103
+ cursor: pointer;
104
+ transition: background-color var(--duration-short2, 100ms) ease;
72
105
  }
73
- .pagination .pagination-text {
106
+ .page-button:hover {
107
+ background: color-mix(in srgb, var(--color-on-surface) 8%, transparent);
108
+ }
109
+ .page-button:active {
110
+ background: color-mix(in srgb, var(--color-on-surface) 12%, transparent);
111
+ }
112
+ .page-button:focus-visible {
113
+ outline: 2px solid var(--color-primary);
114
+ outline-offset: 2px;
115
+ }
116
+ .page-button.current {
117
+ background: var(--color-secondary-container);
118
+ color: var(--color-on-secondary-container);
119
+ cursor: default;
120
+ }
121
+
122
+ .page-ellipsis {
123
+ display: inline-flex;
124
+ align-items: center;
125
+ justify-content: center;
126
+ min-inline-size: var(--_pagination-target-size);
127
+ block-size: var(--_pagination-target-size);
128
+ user-select: none;
129
+ }
130
+
131
+ .page-jump {
132
+ display: inline-flex;
133
+ align-items: center;
134
+ gap: var(--spacing-100, 0.5rem);
135
+ padding-inline: var(--spacing-050, 0.25rem);
136
+ white-space: nowrap;
137
+ font-variant-numeric: tabular-nums;
138
+ }
139
+
140
+ .page-input {
74
141
  font-family: var(--typography-body-medium-font-family);
75
142
  font-size: var(--typography-body-medium-font-size);
76
143
  font-weight: var(--typography-body-medium-font-weight);
77
144
  line-height: var(--typography-body-medium-line-height);
78
145
  letter-spacing: var(--typography-body-medium-letter-spacing);
79
- color: var(--color-on-surface-variant);
146
+ inline-size: 3.5rem;
147
+ block-size: 2rem;
148
+ padding: 0 var(--spacing-100, 0.5rem);
149
+ border: 1px solid var(--color-outline-variant);
150
+ border-radius: var(--shape-corner-small);
151
+ background: var(--color-surface);
152
+ color: var(--color-on-surface);
153
+ text-align: center;
154
+ font-variant-numeric: tabular-nums;
155
+ appearance: textfield;
80
156
  }
81
- .pagination .pagination-actions {
82
- display: inline-flex;
83
- align-items: center;
84
- gap: var(--spacing-025, 0.125rem);
157
+ .page-input::-webkit-inner-spin-button, .page-input::-webkit-outer-spin-button {
158
+ appearance: none;
159
+ margin: 0;
85
160
  }
86
- .pagination .nav-button {
87
- --button-container-shape: var(--shape-corner-full);
161
+ .page-input:hover {
162
+ border-color: var(--color-outline);
163
+ }
164
+ .page-input:focus-visible {
165
+ outline: 2px solid var(--color-primary);
166
+ outline-offset: -1px;
167
+ border-color: transparent;
168
+ }
169
+
170
+ .variant-full .page-jump {
171
+ display: none;
172
+ }
173
+
174
+ @container (max-width: 40rem) {
175
+ .variant-full .page-list {
176
+ display: none;
177
+ }
178
+ .variant-full .page-jump {
179
+ display: inline-flex;
180
+ }
181
+ .page-size-label {
182
+ display: none;
183
+ }
184
+ }
185
+ @container (max-width: 26rem) {
186
+ .controls {
187
+ flex-basis: 100%;
188
+ justify-content: space-between;
189
+ }
190
+ }
191
+ .visually-hidden {
192
+ position: absolute;
193
+ inline-size: 1px;
194
+ block-size: 1px;
195
+ margin: -1px;
196
+ padding: 0;
197
+ overflow: hidden;
198
+ clip-path: inset(50%);
199
+ white-space: nowrap;
200
+ border: 0;
88
201
  }`;
89
202
 
203
+ function range(from, to) {
204
+ return Array.from({ length: to - from + 1 }, (_, index) => from + index);
205
+ }
206
+ /**
207
+ * Builds the page list shown by the `full` pagination variant.
208
+ *
209
+ * The list always keeps the first and last page, the current page and `siblings` pages on each
210
+ * side of it, and fills the rest with an ellipsis. It never holds more than
211
+ * `2 * siblings + 5` slots, so the control keeps its width while the user moves through pages.
212
+ *
213
+ * @example
214
+ * getPageItems(5, 24); // [1, 'ellipsis', 4, 5, 6, 'ellipsis', 24]
215
+ * getPageItems(2, 24); // [1, 2, 3, 4, 5, 'ellipsis', 24]
216
+ */
217
+ function getPageItems(current, total, siblings = 1) {
218
+ const totalPages = Math.max(1, Math.trunc(total));
219
+ const page = Math.min(Math.max(1, Math.trunc(current)), totalPages);
220
+ const maxSlots = 2 * siblings + 5;
221
+ if (totalPages <= maxSlots) {
222
+ return range(1, totalPages);
223
+ }
224
+ const start = Math.max(page - siblings, 1);
225
+ const end = Math.min(page + siblings, totalPages);
226
+ // A gap of one page is shown as that page; only a gap of two or more becomes an ellipsis.
227
+ const showStartGap = start > 3;
228
+ const showEndGap = end < totalPages - 2;
229
+ // Pages shown on the side without a gap: the window, the edge page and the slot the
230
+ // ellipsis would have taken.
231
+ const edgeCount = 2 * siblings + 3;
232
+ if (!showStartGap && showEndGap) {
233
+ return [...range(1, edgeCount), 'ellipsis', totalPages];
234
+ }
235
+ if (showStartGap && !showEndGap) {
236
+ return [1, 'ellipsis', ...range(totalPages - edgeCount + 1, totalPages)];
237
+ }
238
+ return [1, 'ellipsis', ...range(start, end), 'ellipsis', totalPages];
239
+ }
240
+
90
241
  const DEFAULT_PAGE_SIZES = [10, 25, 50, 100];
91
242
  /**
92
243
  * @label Pagination
93
244
  * @tag wc-pagination
94
245
  * @rawTag pagination
95
- * @summary A pagination control with page size selector, item count display, and previous/next navigation.
246
+ * @summary A pagination control with page numbers, a rows-per-page selector and the current item range.
96
247
  * @overview
97
- * <p>The pagination component provides controls for navigating through paged data sets.</p>
248
+ * <p>The pagination component moves through paged data. It shows the current item range, the pages and a rows-per-page selector.</p>
249
+ * <p>Three variants cover different data sets: <code>full</code> lists page numbers with ellipses, <code>compact</code> shows "Page [n] of N" with a field to jump to a page, and <code>simple</code> shows previous and next only. When <code>total-items</code> is not set, the total is unknown (cursor-based APIs): the control shows previous and next, and <code>has-next</code> says whether another page exists.</p>
250
+ * <p>On a narrow container the <code>full</code> variant collapses to <code>compact</code>.</p>
98
251
  *
99
252
  * @fires {CustomEvent} page - Dispatched when the page or page size changes. Detail: `{ page, pageSize }`.
100
253
  *
254
+ * @cssprop --pagination-background - Background of the control. Defaults to the surface color.
255
+ *
101
256
  * @example
102
257
  * ```html
103
- * <wc-pagination style="width: 100%;" page="1" page-size="10" total-items="100"></wc-pagination>
258
+ * <wc-pagination style="width: 100%;" page="1" page-size="10" total-items="240"></wc-pagination>
104
259
  * ```
105
260
  * @tags navigation, data
106
261
  */
107
262
  let Pagination = class Pagination extends i$1 {
108
263
  constructor() {
264
+ // ── Static ───────────────────────────────────────────────────────────────
109
265
  super(...arguments);
266
+ // ── Properties ───────────────────────────────────────────────────────────
110
267
  /**
111
268
  * The current page number (1-based). Defaults to `1`.
112
269
  */
@@ -115,27 +272,55 @@ let Pagination = class Pagination extends i$1 {
115
272
  * The number of rows per page. Defaults to `10`.
116
273
  */
117
274
  this.pageSize = 10;
118
- /**
119
- * Total number of items.
120
- */
121
- this.totalItems = 0;
122
275
  /**
123
276
  * Supported page size options.
124
277
  */
125
278
  this.pageSizes = DEFAULT_PAGE_SIZES;
126
- this.handlePreviousPage = () => {
127
- this.setPage(this.page - 1);
279
+ /**
280
+ * How the pages are shown: `full` (page numbers), `compact` ("Page [n] of N") or `simple`
281
+ * (previous and next only). Defaults to `full`.
282
+ */
283
+ this.variant = 'full';
284
+ /**
285
+ * Whether another page exists after this one. Used only when `total-items` is unset.
286
+ */
287
+ this.hasNext = false;
288
+ /**
289
+ * Shows buttons that jump to the first and the last page.
290
+ */
291
+ this.showFirstLast = false;
292
+ /**
293
+ * Hides the rows-per-page selector.
294
+ */
295
+ this.hidePageSize = false;
296
+ /**
297
+ * Accessible name of the navigation landmark. Defaults to `"Pagination"`.
298
+ */
299
+ this.label = 'Pagination';
300
+ this.handlePageInput = (event) => {
301
+ const input = event.target;
302
+ const value = Number.parseInt(input.value, 10);
303
+ if (Number.isFinite(value)) {
304
+ this.setPage(value);
305
+ }
306
+ // Show the page actually used, for example after clamping 99 to the last page.
307
+ input.value = String(this.page);
128
308
  };
129
- this.handleNextPage = () => {
130
- this.setPage(this.page + 1);
309
+ this.handlePageInputKeydown = (event) => {
310
+ if (event.key === 'Enter') {
311
+ this.handlePageInput(event);
312
+ }
131
313
  };
132
314
  }
315
+ // ── Lifecycle ────────────────────────────────────────────────────────────
133
316
  willUpdate(changedProperties) {
134
317
  // Normalize page-size options so the select always has valid numeric values.
135
- const normalizedPageSizes = [...new Set(this.pageSizes
318
+ const normalizedPageSizes = [
319
+ ...new Set(this.pageSizes
136
320
  .map(size => Number(size))
137
321
  .filter(size => Number.isFinite(size) && size > 0)
138
- .map(size => Math.trunc(size)))];
322
+ .map(size => Math.trunc(size))),
323
+ ];
139
324
  if (!normalizedPageSizes.length) {
140
325
  normalizedPageSizes.push(...DEFAULT_PAGE_SIZES);
141
326
  }
@@ -147,25 +332,59 @@ let Pagination = class Pagination extends i$1 {
147
332
  if (!this.pageSizes.includes(this.pageSize)) {
148
333
  this.pageSize = this.pageSizes[0] ?? DEFAULT_PAGE_SIZES[0];
149
334
  }
150
- if (!Number.isFinite(this.totalItems) || this.totalItems < 0) {
335
+ if (this.totalItems !== undefined &&
336
+ this.totalItems !== null &&
337
+ (!Number.isFinite(this.totalItems) || this.totalItems < 0)) {
151
338
  this.totalItems = 0;
152
339
  }
153
340
  if (!Number.isFinite(this.page) || this.page < 1) {
154
341
  this.page = 1;
155
342
  }
156
- const maxPage = this.getTotalPages();
157
- if (this.page > maxPage) {
158
- this.page = maxPage;
343
+ const totalPages = this.getTotalPages();
344
+ if (totalPages !== undefined && this.page > totalPages) {
345
+ this.page = totalPages;
159
346
  }
160
347
  }
348
+ // ── Private methods ──────────────────────────────────────────────────────
349
+ /** True when the total is known. */
350
+ get hasTotal() {
351
+ return this.totalItems !== undefined && this.totalItems !== null;
352
+ }
353
+ /** The number of pages, or `undefined` when the total is unknown. */
161
354
  getTotalPages() {
162
- if (this.totalItems <= 0)
355
+ if (!this.hasTotal)
356
+ return undefined;
357
+ const total = this.totalItems ?? 0;
358
+ if (total <= 0)
163
359
  return 1;
164
- return Math.max(1, Math.ceil(this.totalItems / this.pageSize));
360
+ return Math.max(1, Math.ceil(total / this.pageSize));
361
+ }
362
+ get isFirstPage() {
363
+ return this.page <= 1;
364
+ }
365
+ get isLastPage() {
366
+ const totalPages = this.getTotalPages();
367
+ return totalPages === undefined ? !this.hasNext : this.page >= totalPages;
368
+ }
369
+ /** The variant actually rendered: an unknown total can only go previous and next. */
370
+ get effectiveVariant() {
371
+ return this.hasTotal ? this.variant : 'simple';
372
+ }
373
+ getRangeText() {
374
+ const total = this.totalItems ?? 0;
375
+ if (this.hasTotal && total === 0)
376
+ return '0 of 0';
377
+ const start = this.pageSize * (this.page - 1) + 1;
378
+ if (!this.hasTotal)
379
+ return `${start}–${this.pageSize * this.page}`;
380
+ const end = Math.min(this.pageSize * this.page, total);
381
+ return `${start}–${end} of ${total}`;
165
382
  }
166
383
  setPage(nextPage) {
167
- const clampedPage = Math.min(Math.max(1, nextPage), this.getTotalPages());
168
- if (clampedPage === this.page)
384
+ const totalPages = this.getTotalPages() ?? Number.MAX_SAFE_INTEGER;
385
+ const lastAllowed = this.hasTotal || this.hasNext ? totalPages : Math.max(1, this.page);
386
+ const clampedPage = Math.min(Math.max(1, Math.trunc(nextPage)), lastAllowed);
387
+ if (!Number.isFinite(clampedPage) || clampedPage === this.page)
169
388
  return;
170
389
  this.page = clampedPage;
171
390
  this.dispatchPageEvent();
@@ -176,8 +395,12 @@ let Pagination = class Pagination extends i$1 {
176
395
  if (!Number.isFinite(parsedPageSize) || parsedPageSize <= 0) {
177
396
  return;
178
397
  }
398
+ if (parsedPageSize === this.pageSize)
399
+ return;
400
+ // Keep the first visible item on screen instead of jumping back to page 1.
401
+ const firstItemIndex = this.pageSize * (this.page - 1);
179
402
  this.pageSize = parsedPageSize;
180
- this.page = 1;
403
+ this.page = Math.floor(firstItemIndex / parsedPageSize) + 1;
181
404
  this.dispatchPageEvent();
182
405
  }
183
406
  dispatchPageEvent() {
@@ -187,56 +410,116 @@ let Pagination = class Pagination extends i$1 {
187
410
  composed: true,
188
411
  }));
189
412
  }
413
+ // ── Render helpers ───────────────────────────────────────────────────────
414
+ renderNavButton(icon, label, disabled, target, className) {
415
+ return b `
416
+ <wc-icon-button
417
+ class="nav-button ${className}"
418
+ color="secondary"
419
+ variant="text"
420
+ size="sm"
421
+ aria-label=${label}
422
+ title=${label}
423
+ ?disabled=${disabled}
424
+ @click=${() => this.setPage(target())}
425
+ >
426
+ <wc-icon name=${icon}></wc-icon>
427
+ </wc-icon-button>
428
+ `;
429
+ }
430
+ renderPageList(totalPages) {
431
+ return b `
432
+ <ol class="page-list">
433
+ ${getPageItems(this.page, totalPages).map(item => item === 'ellipsis'
434
+ ? b `<li class="page-ellipsis" aria-hidden="true">…</li>`
435
+ : b `
436
+ <li>
437
+ <button
438
+ type="button"
439
+ class=${e({
440
+ 'page-button': true,
441
+ current: item === this.page,
442
+ })}
443
+ aria-label="Page ${item}"
444
+ aria-current=${item === this.page ? 'page' : A}
445
+ @click=${() => this.setPage(item)}
446
+ >
447
+ ${item}
448
+ </button>
449
+ </li>
450
+ `)}
451
+ </ol>
452
+ `;
453
+ }
454
+ renderPageJump(totalPages) {
455
+ return b `
456
+ <div class="page-jump">
457
+ <span>Page</span>
458
+ <input
459
+ class="page-input"
460
+ type="number"
461
+ inputmode="numeric"
462
+ min="1"
463
+ max=${totalPages}
464
+ .value=${String(this.page)}
465
+ aria-label="Page number, ${totalPages} pages"
466
+ @change=${this.handlePageInput}
467
+ @keydown=${this.handlePageInputKeydown}
468
+ />
469
+ <span>of ${totalPages}</span>
470
+ </div>
471
+ `;
472
+ }
473
+ renderPageSize() {
474
+ if (this.hidePageSize)
475
+ return A;
476
+ return b `
477
+ <div class="page-size">
478
+ <span class="page-size-label" aria-hidden="true">Rows per page</span>
479
+ <wc-select
480
+ class="page-size-select"
481
+ .value=${String(this.pageSize)}
482
+ aria-label="Rows per page"
483
+ @change=${this.handlePageSizeChange}
484
+ >
485
+ ${this.pageSizes.map(size => b `<wc-option value=${String(size)}>${size}</wc-option>`)}
486
+ </wc-select>
487
+ </div>
488
+ `;
489
+ }
490
+ // ── Render ───────────────────────────────────────────────────────────────
190
491
  render() {
191
- const startItem = this.totalItems === 0 ? 0 : this.pageSize * (this.page - 1) + 1;
192
- const endItem = Math.min(this.pageSize * this.page, this.totalItems);
193
- const isFirstPage = this.page === 1;
194
- const isLastPage = this.pageSize * this.page >= this.totalItems;
492
+ const variant = this.effectiveVariant;
493
+ const totalPages = this.getTotalPages() ?? 1;
494
+ const rangeText = this.getRangeText();
495
+ const showFirstLast = this.showFirstLast && this.hasTotal;
195
496
  return b `
196
- <div class="pagination">
197
- <div class="page-size">
198
- <span class="page-size-label">Items per page:</span>
199
- <wc-select
200
- class="page-size-select"
201
- .value=${String(this.pageSize)}
202
- aria-label="Items per page"
203
- @change=${this.handlePageSizeChange}
204
- >
205
- ${this.pageSizes.map(size => b `<wc-option value=${String(size)}>${size}</wc-option>`)}
206
- </wc-select>
207
- </div>
497
+ <nav
498
+ class=${e({ pagination: true, [`variant-${variant}`]: true })}
499
+ aria-label=${this.label}
500
+ >
501
+ <div class="range" aria-hidden="true">${rangeText}</div>
502
+ <span class="visually-hidden" aria-live="polite">
503
+ Showing ${rangeText}
504
+ </span>
208
505
 
209
- <div class="pagination-item-count">
210
- <span class="pagination-text">
211
- ${startItem} - ${endItem} of ${this.totalItems}
212
- </span>
213
- </div>
506
+ ${this.renderPageSize()}
214
507
 
215
- <div class="pagination-actions">
216
- <wc-icon-button
217
- class="nav-button"
218
- color="secondary"
219
- variant="text"
220
- size="sm"
221
- title="Previous page"
222
- ?disabled=${isFirstPage}
223
- @click=${this.handlePreviousPage}
224
- >
225
- <wc-icon name="keyboard_arrow_left"></wc-icon>
226
- </wc-icon-button>
227
- <wc-icon-button
228
- class="nav-button"
229
- color="secondary"
230
- variant="text"
231
- size="sm"
232
- title="Next page"
233
- ?disabled=${isLastPage}
234
- @click=${this.handleNextPage}
235
- >
236
- <wc-icon name="keyboard_arrow_right"></wc-icon>
237
- </wc-icon-button>
508
+ <div class="controls">
509
+ ${showFirstLast
510
+ ? this.renderNavButton('first_page', 'First page', this.isFirstPage, () => 1, 'first')
511
+ : A}
512
+ ${this.renderNavButton('chevron_left', 'Previous page', this.isFirstPage, () => this.page - 1, 'previous')}
513
+ ${variant === 'full' ? this.renderPageList(totalPages) : A}
514
+ ${variant === 'full' || variant === 'compact'
515
+ ? this.renderPageJump(totalPages)
516
+ : A}
517
+ ${this.renderNavButton('chevron_right', 'Next page', this.isLastPage, () => this.page + 1, 'next')}
518
+ ${showFirstLast
519
+ ? this.renderNavButton('last_page', 'Last page', this.isLastPage, () => totalPages, 'last')
520
+ : A}
238
521
  </div>
239
- </div>
522
+ </nav>
240
523
  `;
241
524
  }
242
525
  };
@@ -253,6 +536,21 @@ __decorate([
253
536
  __decorate([
254
537
  n({ type: Array, attribute: 'page-sizes' })
255
538
  ], Pagination.prototype, "pageSizes", void 0);
539
+ __decorate([
540
+ n({ type: String, reflect: true })
541
+ ], Pagination.prototype, "variant", void 0);
542
+ __decorate([
543
+ n({ type: Boolean, attribute: 'has-next' })
544
+ ], Pagination.prototype, "hasNext", void 0);
545
+ __decorate([
546
+ n({ type: Boolean, attribute: 'show-first-last' })
547
+ ], Pagination.prototype, "showFirstLast", void 0);
548
+ __decorate([
549
+ n({ type: Boolean, attribute: 'hide-page-size' })
550
+ ], Pagination.prototype, "hidePageSize", void 0);
551
+ __decorate([
552
+ n({ type: String })
553
+ ], Pagination.prototype, "label", void 0);
256
554
  Pagination = __decorate([
257
555
  IndividualComponent
258
556
  ], Pagination);