@italia/pagination 1.0.0-alpha.5

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.
@@ -0,0 +1,818 @@
1
+ import { B as BaseComponent, _ as __decorate, a as __metadata } from '../index-BWQUNXeM.js';
2
+ import { css, html } from 'lit';
3
+ import { when } from 'lit/directives/when.js';
4
+ import { queryAssignedElements, property, customElement } from 'lit/decorators.js';
5
+ import 'lit/directive.js';
6
+
7
+ var styles = css`/***************************** 1 ****************************************/
8
+ /***************************** 2 ****************************************/
9
+ /***************************** 1 ****************************************/
10
+ /***************************** 2 ****************************************/
11
+ /***************************** 1 ****************************************/
12
+ /***************************** 2 ****************************************/
13
+ /***************************** 3 ****************************************/
14
+ /***************************** 1 ****************************************/
15
+ /***************************** 2 ****************************************/
16
+ /***************************** 3 ****************************************/
17
+ /***************************** NEUTRAL 1 ****************************************/
18
+ /***************************** NEUTRAL 2 ****************************************/
19
+ /***************************** NEUTRAL 2 / 3 ****************************************/
20
+ *,
21
+ *::before,
22
+ *::after {
23
+ box-sizing: border-box;
24
+ }
25
+
26
+ @media (prefers-reduced-motion: no-preference) {
27
+ :root {
28
+ scroll-behavior: smooth;
29
+ }
30
+ }
31
+
32
+ body {
33
+ margin: 0;
34
+ -webkit-text-size-adjust: 100%;
35
+ -webkit-tap-highlight-color: hsla(0, 0%, 0%, 0);
36
+ }
37
+
38
+ hr {
39
+ margin: 1rem 0;
40
+ color: inherit;
41
+ border: 0;
42
+ border-top: 1px solid;
43
+ opacity: 0.25;
44
+ }
45
+
46
+ p {
47
+ margin-top: 0;
48
+ margin-bottom: var(--bsi-paragraph-spacing);
49
+ }
50
+
51
+ abbr[title] {
52
+ text-decoration: underline dotted;
53
+ cursor: help;
54
+ text-decoration-skip-ink: none;
55
+ }
56
+
57
+ address {
58
+ margin-bottom: var(--bsi-spacing-s);
59
+ font-style: normal;
60
+ line-height: inherit;
61
+ }
62
+
63
+ ol,
64
+ ul {
65
+ padding-left: var(--bsi-spacing-l);
66
+ }
67
+
68
+ ol,
69
+ ul,
70
+ dl {
71
+ margin-top: 0;
72
+ margin-bottom: var(--bsi-spacing-s);
73
+ }
74
+
75
+ ol ol,
76
+ ul ul,
77
+ ol ul,
78
+ ul ol {
79
+ margin-bottom: 0;
80
+ }
81
+
82
+ dt {
83
+ font-weight: var(--bsi-font-weight-strong);
84
+ }
85
+
86
+ dd {
87
+ margin-bottom: var(--bsi-spacing-xxs);
88
+ margin-left: 0;
89
+ }
90
+
91
+ blockquote {
92
+ margin: 0 0 var(--bsi-spacing-s);
93
+ }
94
+
95
+ sub,
96
+ sup {
97
+ position: relative;
98
+ font-size: var(--bsi-font-size-1);
99
+ line-height: 0;
100
+ vertical-align: baseline;
101
+ }
102
+
103
+ sub {
104
+ bottom: -0.25em;
105
+ }
106
+
107
+ sup {
108
+ top: -0.5em;
109
+ }
110
+
111
+ a {
112
+ color: var(--bsi-color-link);
113
+ text-decoration: underline;
114
+ text-decoration-skip-ink: auto;
115
+ text-underline-offset: 2px;
116
+ }
117
+ a:hover {
118
+ color: var(--bsi-color-link-hover);
119
+ }
120
+
121
+ pre,
122
+ code,
123
+ kbd,
124
+ samp {
125
+ font-size: 1em;
126
+ }
127
+
128
+ pre {
129
+ display: block;
130
+ margin-top: 0;
131
+ margin-bottom: var(--bsi-paragraph-spacing);
132
+ overflow: auto;
133
+ }
134
+ pre code {
135
+ word-break: normal;
136
+ }
137
+
138
+ a > code {
139
+ color: inherit;
140
+ }
141
+
142
+ figure {
143
+ margin: 0 0 1rem;
144
+ }
145
+
146
+ img,
147
+ svg {
148
+ vertical-align: middle;
149
+ }
150
+
151
+ table {
152
+ caption-side: bottom;
153
+ border-collapse: collapse;
154
+ }
155
+
156
+ caption {
157
+ padding-top: 0.5rem;
158
+ padding-bottom: 0.5rem;
159
+ color: hsl(210, 17%, 44%);
160
+ text-align: left;
161
+ }
162
+
163
+ th {
164
+ text-align: inherit;
165
+ text-align: -webkit-match-parent;
166
+ }
167
+
168
+ thead,
169
+ tbody,
170
+ tfoot,
171
+ tr,
172
+ td,
173
+ th {
174
+ border-color: inherit;
175
+ border-style: solid;
176
+ border-width: 0;
177
+ }
178
+
179
+ label {
180
+ display: inline-block;
181
+ }
182
+
183
+ button {
184
+ border-radius: 0;
185
+ }
186
+
187
+ button:focus:not(:focus-visible) {
188
+ outline: 0;
189
+ }
190
+
191
+ input,
192
+ button,
193
+ select,
194
+ optgroup,
195
+ textarea {
196
+ margin: 0;
197
+ font-family: inherit;
198
+ font-size: inherit;
199
+ line-height: inherit;
200
+ }
201
+
202
+ button,
203
+ select {
204
+ text-transform: none;
205
+ }
206
+
207
+ [role=button] {
208
+ cursor: pointer;
209
+ }
210
+
211
+ select {
212
+ word-wrap: normal;
213
+ }
214
+ select:disabled {
215
+ opacity: 1;
216
+ }
217
+
218
+ [list]:not([type=date]):not([type=datetime-local]):not([type=month]):not([type=week]):not([type=time])::-webkit-calendar-picker-indicator {
219
+ display: none !important;
220
+ }
221
+
222
+ button,
223
+ [type=button],
224
+ [type=reset],
225
+ [type=submit] {
226
+ -webkit-appearance: button;
227
+ }
228
+ button:not(:disabled),
229
+ [type=button]:not(:disabled),
230
+ [type=reset]:not(:disabled),
231
+ [type=submit]:not(:disabled) {
232
+ cursor: pointer;
233
+ }
234
+
235
+ ::-moz-focus-inner {
236
+ padding: 0;
237
+ border-style: none;
238
+ }
239
+
240
+ textarea {
241
+ resize: vertical;
242
+ }
243
+
244
+ fieldset {
245
+ min-width: 0;
246
+ padding: 0;
247
+ margin: 0;
248
+ border: 0;
249
+ }
250
+
251
+ ::-webkit-datetime-edit-fields-wrapper,
252
+ ::-webkit-datetime-edit-text,
253
+ ::-webkit-datetime-edit-minute,
254
+ ::-webkit-datetime-edit-hour-field,
255
+ ::-webkit-datetime-edit-day-field,
256
+ ::-webkit-datetime-edit-month-field,
257
+ ::-webkit-datetime-edit-year-field {
258
+ padding: 0;
259
+ }
260
+
261
+ ::-webkit-inner-spin-button {
262
+ height: auto;
263
+ }
264
+
265
+ [type=search] {
266
+ outline-offset: -2px;
267
+ -webkit-appearance: textfield;
268
+ }
269
+
270
+ /* rtl:raw:
271
+ [type="tel"],
272
+ [type="url"],
273
+ [type="email"],
274
+ [type="number"] {
275
+ direction: ltr;
276
+ }
277
+ */
278
+ ::-webkit-search-decoration {
279
+ -webkit-appearance: none;
280
+ }
281
+
282
+ ::-webkit-color-swatch-wrapper {
283
+ padding: 0;
284
+ }
285
+
286
+ ::file-selector-button {
287
+ font: inherit;
288
+ -webkit-appearance: button;
289
+ }
290
+
291
+ output {
292
+ display: inline-block;
293
+ }
294
+
295
+ iframe {
296
+ border: 0;
297
+ }
298
+
299
+ summary {
300
+ display: list-item;
301
+ cursor: pointer;
302
+ }
303
+
304
+ progress {
305
+ vertical-align: baseline;
306
+ }
307
+
308
+ [hidden] {
309
+ display: none !important;
310
+ }
311
+
312
+ .visually-hidden,
313
+ .visually-hidden-focusable:not(:focus):not(:focus-within) {
314
+ position: absolute !important;
315
+ width: 1px !important;
316
+ height: 1px !important;
317
+ padding: 0 !important;
318
+ margin: -1px !important;
319
+ overflow: hidden !important;
320
+ clip: rect(0, 0, 0, 0) !important;
321
+ white-space: nowrap !important;
322
+ border: 0 !important;
323
+ }
324
+
325
+ :host {
326
+ --bsi-pagination-padding-x: 0.75rem;
327
+ --bsi-pagination-padding-y: 0.375rem;
328
+ --bsi-pagination-font-size: 1rem;
329
+ --bsi-pagination-color: var(--bsi-color-link);
330
+ --bsi-pagination-bg: hsl(0, 0%, 100%);
331
+ --bsi-pagination-border-width: 0;
332
+ --bsi-pagination-border-color: hsl(0, 0%, 83%);
333
+ --bsi-pagination-border-radius: 4px;
334
+ --bsi-pagination-hover-color: var(--bsi-color-link-hover);
335
+ --bsi-pagination-hover-bg: hsl(0, 0%, 90%);
336
+ --bsi-pagination-hover-border-color: hsl(0, 0%, 83%);
337
+ --bsi-pagination-focus-color: var(--bsi-color-link-hover);
338
+ --bsi-pagination-focus-bg: hsl(0, 0%, 90%);
339
+ --bsi-pagination-focus-box-shadow: 0 0 0 0.25rem rgba(0, 102, 204, 0.25);
340
+ --bsi-pagination-active-color: hsl(0, 0%, 100%);
341
+ --bsi-pagination-active-bg: hsl(210, 100%, 40%);
342
+ --bsi-pagination-active-border-color: hsl(210, 100%, 40%);
343
+ --bsi-pagination-disabled-color: hsl(0, 0%, 32%);
344
+ --bsi-pagination-disabled-bg: hsl(0, 0%, 100%);
345
+ --bsi-pagination-disabled-border-color: hsl(0, 0%, 83%);
346
+ --bsi-pagination-padding-x: var(--bsi-spacing-s);
347
+ --bsi-pagination-padding-y: var(--bsi-spacing-xxs);
348
+ --bsi-pagination-link-color: var(--bsi-color-link);
349
+ --bsi-pagination-background: transparent;
350
+ --bsi-pagination-border-width: 2px;
351
+ --bsi-pagination-border-color: transparent;
352
+ --bsi-pagination-border-radius: 4px;
353
+ --bsi-pagination-item-size: 3rem;
354
+ --bsi-pagination-font-size: var(--bsi-label-font-size);
355
+ display: flex;
356
+ padding-left: 0;
357
+ list-style: none;
358
+ width: 100%;
359
+ }
360
+
361
+ :host a {
362
+ text-decoration: unset !important;
363
+ }
364
+
365
+ .pagination-wrapper {
366
+ display: flex;
367
+ flex-wrap: wrap;
368
+ align-items: center;
369
+ gap: 1rem;
370
+ margin-block: var(--bsi-spacing-xxs);
371
+ }
372
+
373
+ .pagination-wrapper.pagination-total {
374
+ display: flex;
375
+ flex-direction: column;
376
+ flex-wrap: wrap;
377
+ align-items: center;
378
+ justify-content: center;
379
+ }
380
+
381
+ .pagination {
382
+ display: flex;
383
+ align-items: center;
384
+ padding: 0;
385
+ margin: 0;
386
+ gap: 8px;
387
+ }
388
+
389
+ .pagination-wrapper.pagination-total .pagination {
390
+ margin-bottom: var(--bsi-spacing-xxs);
391
+ }
392
+
393
+ .pagination-next-wrapper,
394
+ .pagination-prev-wrapper {
395
+ display: flex;
396
+ align-items: center;
397
+ }
398
+
399
+ .page-item {
400
+ display: flex;
401
+ padding-left: 0;
402
+ list-style: none;
403
+ height: fit-content;
404
+ }
405
+ .page-item .page-link {
406
+ position: relative;
407
+ display: flex;
408
+ min-width: var(--bsi-pagination-item-size);
409
+ align-items: center;
410
+ justify-content: center;
411
+ padding: var(--bsi-pagination-padding-y) var(--bsi-pagination-padding-x);
412
+ border: var(--bsi-pagination-border-width) solid var(--bsi-pagination-border-color);
413
+ border-radius: var(--bsi-pagination-border-radius);
414
+ color: var(--bsi-pagination-link-color) !important;
415
+ font-weight: var(--bsi-font-weight-solid);
416
+ gap: 0.25rem;
417
+ font-size: var(--bsi-pagination-font-size, 1rem);
418
+ transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
419
+ }
420
+ @media (prefers-reduced-motion: reduce) {
421
+ .page-item .page-link {
422
+ transition: none;
423
+ }
424
+ }
425
+ .page-item a.page-link:hover {
426
+ --bsi-pagination-link-color: var(--bsi-color-link-hover);
427
+ text-decoration: underline !important;
428
+ }
429
+ .page-item a.page-link:focus-visible {
430
+ border-color: hsl(0, 0%, 0%) !important;
431
+ box-shadow: 0 0 0 2px var(--bsi-color-border-inverse), 0 0 0 5px var(--bsi-color-outline-focus) !important;
432
+ outline: 3px solid transparent !important;
433
+ outline-offset: 3px !important;
434
+ }
435
+ .page-item span.page-link {
436
+ pointer-events: none;
437
+ }
438
+
439
+ ::slotted([slot=page-changer]),
440
+ ::slotted([slot=jump-to-page]),
441
+ ::slotted([slot=total]) {
442
+ display: inline-flex;
443
+ align-items: center;
444
+ }
445
+
446
+ ::slotted([slot=total]) {
447
+ margin-bottom: var(--bsi-spacing-s) !important;
448
+ color: var(--bsi-color-text-secondary);
449
+ font-size: var(--bsi-label-font-size) !important;
450
+ font-weight: var(--bsi-font-weight-solid) !important;
451
+ text-align: center;
452
+ }
453
+
454
+ ::slotted([slot=prev]),
455
+ ::slotted([slot=next]) {
456
+ position: relative;
457
+ display: flex;
458
+ min-width: var(--bsi-pagination-item-size);
459
+ height: var(--bsi-pagination-item-size);
460
+ align-items: center;
461
+ justify-content: center;
462
+ padding: var(--bsi-pagination-padding-y) var(--bsi-pagination-padding-x);
463
+ border: var(--bsi-pagination-border-width) solid var(--bsi-pagination-border-color);
464
+ border-radius: var(--bsi-pagination-border-radius);
465
+ color: var(--bsi-pagination-link-color) !important;
466
+ font-weight: var(--bsi-font-weight-solid);
467
+ font-size: var(--bsi-pagination-font-size, 1rem);
468
+ }
469
+
470
+ :host([align=center]) {
471
+ justify-content: center;
472
+ margin: auto;
473
+ }
474
+
475
+ :host([align=end]) {
476
+ width: 100%;
477
+ justify-content: flex-end;
478
+ }
479
+
480
+ :where(:host([responsive])) .pagination-wrapper {
481
+ flex-direction: column;
482
+ align-items: stretch;
483
+ }
484
+ @media (min-width: 576px) {
485
+ :where(:host([responsive])) .pagination-wrapper {
486
+ flex-direction: row;
487
+ align-items: center;
488
+ }
489
+ }
490
+
491
+ :where(:host([responsive])) .pagination-wrapper .pagination {
492
+ width: 100%;
493
+ }
494
+ @media (min-width: 576px) {
495
+ :where(:host([responsive])) .pagination-wrapper .pagination {
496
+ width: auto;
497
+ justify-content: center;
498
+ }
499
+ }
500
+
501
+ .page-link[aria-current] {
502
+ --bsi-pagination-border-color: var(--bsi-color-border-primary-active);
503
+ --bsi-pagination-link-color: var(--bsi-color-link-active);
504
+ pointer-events: none;
505
+ }
506
+
507
+ .page-item.more {
508
+ display: none;
509
+ }
510
+ @media (min-width: 576px) {
511
+ .page-item.more {
512
+ display: flex;
513
+ }
514
+ }`;
515
+
516
+ /* eslint-disable lit-a11y/click-events-have-key-events */
517
+ let ItPagination = class ItPagination extends BaseComponent {
518
+ constructor() {
519
+ super(...arguments);
520
+ this.value = '1';
521
+ this.total = undefined;
522
+ this.align = 'center';
523
+ this.disableResponsive = false;
524
+ this.simpleMode = false;
525
+ this.visiblePages = 5;
526
+ this.itAriaLabel = '';
527
+ }
528
+ updated(changedProperties) {
529
+ super.updated?.(changedProperties);
530
+ if (changedProperties.has('value') ||
531
+ changedProperties.has('total') ||
532
+ changedProperties.has('simpleMode') ||
533
+ changedProperties.has('visiblePages')) {
534
+ this.updatePaginationItems();
535
+ this.updatePaginationItemsClasses();
536
+ this.updateNavigationButtons();
537
+ }
538
+ if (changedProperties.has('disableResponsive') && changedProperties.get('disableResponsive') !== undefined) {
539
+ this.updatePaginationItemsClasses();
540
+ }
541
+ }
542
+ emitPageChange(newPage) {
543
+ const currentPage = parseInt(this.value, 10);
544
+ const totalPages = this.total ? parseInt(this.total, 10) : this.paginationItems.length;
545
+ if (newPage < 1)
546
+ return;
547
+ if (totalPages > 0 && newPage > totalPages)
548
+ return;
549
+ if (newPage === currentPage)
550
+ return;
551
+ const event = new CustomEvent('it-pagination-change', {
552
+ detail: { page: newPage },
553
+ bubbles: true,
554
+ composed: true,
555
+ });
556
+ this.dispatchEvent(event);
557
+ this.value = newPage.toString();
558
+ }
559
+ handleItemClick(e) {
560
+ e.stopPropagation(); // Fermiamo l'evento interno, non serve che esca
561
+ const page = parseInt(e.detail.page, 10);
562
+ if (!Number.isNaN(page)) {
563
+ this.emitPageChange(page);
564
+ }
565
+ }
566
+ handlePrevClick(e) {
567
+ e.preventDefault();
568
+ const currentPage = parseInt(this.value, 10);
569
+ if (currentPage > 1) {
570
+ this.emitPageChange(currentPage - 1);
571
+ }
572
+ }
573
+ handleNextClick(e) {
574
+ e.preventDefault();
575
+ const currentPage = parseInt(this.value, 10);
576
+ const totalPages = this.total ? parseInt(this.total, 10) : this.paginationItems.length;
577
+ // Se non c'è 'total', assumiamo che ci siano altre pagine finché ci sono items
578
+ if (!totalPages || currentPage < totalPages) {
579
+ this.emitPageChange(currentPage + 1);
580
+ }
581
+ }
582
+ updatePaginationItemsClasses() {
583
+ if (this.paginationItems.length) {
584
+ const pages = this.calculatePages();
585
+ this.paginationItems.forEach((item) => {
586
+ const isCurrentPage = item.page === this.value;
587
+ const itemPageNum = parseInt(item.page, 10);
588
+ const isInVisiblePages = pages.includes(itemPageNum);
589
+ // Remove all classes first
590
+ item.classList.remove('d-none', 'd-sm-flex');
591
+ // In simple mode, hide all pagination items (we render current/total instead)
592
+ if (this.simpleMode) {
593
+ item.classList.add('d-none');
594
+ return;
595
+ }
596
+ // In more mode, hide items not in visible pages
597
+ if (!isInVisiblePages) {
598
+ item.classList.add('d-none');
599
+ return;
600
+ }
601
+ // Apply responsive hiding for non-current pages (when NOT disabled)
602
+ if (!this.disableResponsive && !isCurrentPage) {
603
+ item.classList.add('d-none', 'd-sm-flex');
604
+ }
605
+ });
606
+ }
607
+ }
608
+ updatePaginationItems() {
609
+ if (this.paginationItems.length) {
610
+ this.paginationItems.forEach((item) => {
611
+ const isCurrentPage = item.page === this.value;
612
+ // eslint-disable-next-line no-param-reassign
613
+ item.current = isCurrentPage;
614
+ });
615
+ }
616
+ }
617
+ updateNavigationButtons() {
618
+ const currentPage = parseInt(this.value, 10);
619
+ const totalPages = this.total ? parseInt(this.total, 10) : this.paginationItems.length;
620
+ // Update prev button visual state
621
+ if (this.prevElements.length) {
622
+ this.prevElements.forEach((el) => {
623
+ if (currentPage <= 1) {
624
+ el.setAttribute('aria-disabled', 'true');
625
+ el.classList.add('disabled');
626
+ // el.setAttribute('tabindex', '-1');
627
+ }
628
+ else {
629
+ el.removeAttribute('aria-disabled');
630
+ el.classList.remove('disabled');
631
+ }
632
+ el.classList.add('page-link');
633
+ });
634
+ }
635
+ // Update next button visual state
636
+ if (this.nextElements.length) {
637
+ this.nextElements.forEach((el) => {
638
+ if (totalPages && currentPage >= totalPages) {
639
+ el.setAttribute('aria-disabled', 'true');
640
+ el.classList.add('disabled');
641
+ }
642
+ else {
643
+ el.removeAttribute('aria-disabled');
644
+ el.classList.remove('disabled');
645
+ }
646
+ el.classList.add('page-link');
647
+ });
648
+ }
649
+ }
650
+ handleSlotChange() {
651
+ this.updatePaginationItems();
652
+ this.updatePaginationItemsClasses();
653
+ this.updateNavigationButtons();
654
+ }
655
+ handlePrevSlotChange() {
656
+ this.updateNavigationButtons();
657
+ }
658
+ handleNextSlotChange() {
659
+ this.updateNavigationButtons();
660
+ }
661
+ handleTotalSlotChange() {
662
+ // Update component and rerender when total slot changes
663
+ this.requestUpdate();
664
+ }
665
+ /**
666
+ * Calculate which pages to display based on simpleMode and visiblePages
667
+ * Returns an array of page numbers to show
668
+ */
669
+ calculatePages() {
670
+ const currentPage = parseInt(this.value, 10);
671
+ const totalPages = this.total ? parseInt(this.total, 10) : this.paginationItems.length;
672
+ if (this.simpleMode) {
673
+ return [currentPage];
674
+ }
675
+ if (totalPages <= this.visiblePages) {
676
+ // If total pages is less than visiblePages, show all
677
+ return Array.from({ length: totalPages }, (_, i) => i + 1);
678
+ }
679
+ // More mode: calculate which pages to show
680
+ const halfVisiblePages = Math.floor(this.visiblePages / 2);
681
+ let start = currentPage > halfVisiblePages ? currentPage - halfVisiblePages : 1;
682
+ // Calculate the length based on visible pages
683
+ const length = this.visiblePages;
684
+ // Adjust start if we're near the end
685
+ if (currentPage >= totalPages) {
686
+ start -= halfVisiblePages;
687
+ }
688
+ else if (currentPage >= totalPages - halfVisiblePages) {
689
+ start -= totalPages - (currentPage + 1);
690
+ }
691
+ // Make sure start is at least 1
692
+ if (start < 1) {
693
+ start = 1;
694
+ }
695
+ return Array.from({ length }, (_, i) => i + start).filter((page) => page <= totalPages);
696
+ }
697
+ render() {
698
+ const navClasses = this.composeClass('pagination-wrapper', this.totalElements.length > 0 && 'pagination-total');
699
+ const ulClasses = this.composeClass('pagination', this.disableResponsive && 'pagination-responsive');
700
+ const currentPage = parseInt(this.value, 10);
701
+ const totalPages = this.total ? parseInt(this.total, 10) : this.paginationItems.length;
702
+ const pages = this.calculatePages();
703
+ const showFirstPage = totalPages > this.visiblePages && pages[0] > 1;
704
+ const showFirstEllipsis = totalPages > this.visiblePages && pages[0] > 2;
705
+ const showLastPage = totalPages > this.visiblePages && pages[pages.length - 1] < totalPages;
706
+ const showLastEllipsis = totalPages > this.visiblePages && pages[pages.length - 1] < totalPages - 1;
707
+ return html `
708
+ <nav class="${navClasses}" aria-label="${this.itAriaLabel}">
709
+ <ul class="${ulClasses}" @it-item-click="${this.handleItemClick}" part="pagination-list">
710
+ <li class="pagination-prev-wrapper page-item" @click="${this.handlePrevClick}">
711
+ <slot name="prev" @slotchange="${this.handlePrevSlotChange}"></slot>
712
+ </li>
713
+
714
+ ${when(this.simpleMode, () => html `
715
+ <li class="page-item visually-hidden">
716
+ <a class="page-link" href="#" aria-current="page"> Pagina ${currentPage} di ${totalPages} </a>
717
+ </li>
718
+ <li class="page-item active" part="current-page-simple-mode">
719
+ <span class="page-link" aria-current="page">${currentPage}</span>
720
+ </li>
721
+ <li class="page-item" aria-hidden="true"><span class="page-link">/</span></li>
722
+ <li class="page-item" part="total-pages-simple-mode">
723
+ <span class="page-link">${totalPages}</span>
724
+ </li>
725
+ `, () => html `
726
+ ${when(showFirstPage, () => html `
727
+ <li class="page-item more">
728
+ <a class="page-link" href="#" @click="${(e) => this.handlePageClick(e, 1)}">1</a>
729
+ </li>
730
+ `)}
731
+ ${when(showFirstEllipsis, () => html `
732
+ <li class="page-item more">
733
+ <span class="page-link">...</span>
734
+ </li>
735
+ `)}
736
+ <slot @slotchange="${this.handleSlotChange}"></slot>
737
+ ${when(showLastEllipsis, () => html `
738
+ <li class="page-item more">
739
+ <span class="page-link">...</span>
740
+ </li>
741
+ `)}
742
+ ${when(showLastPage, () => html `
743
+ <li class="page-item more">
744
+ <a class="page-link" href="#" @click="${(e) => this.handlePageClick(e, totalPages)}">
745
+ ${totalPages}
746
+ </a>
747
+ </li>
748
+ `)}
749
+ `)}
750
+
751
+ <li class="pagination-next-wrapper page-item" @click="${this.handleNextClick}">
752
+ <slot name="next" @slotchange="${this.handleNextSlotChange}"></slot>
753
+ </li>
754
+ </ul>
755
+
756
+ <slot name="page-changer"></slot>
757
+ <slot name="jump-to-page"></slot>
758
+ <slot name="total" @slotchange="${this.handleTotalSlotChange}"></slot>
759
+ </nav>
760
+ `;
761
+ }
762
+ handlePageClick(e, page) {
763
+ e.preventDefault();
764
+ this.emitPageChange(page);
765
+ }
766
+ };
767
+ ItPagination.styles = styles;
768
+ ItPagination.shadowRootOptions = { ...BaseComponent.shadowRootOptions, delegatesFocus: true };
769
+ __decorate([
770
+ queryAssignedElements({ selector: 'it-pagination-item' }),
771
+ __metadata("design:type", Array)
772
+ ], ItPagination.prototype, "paginationItems", void 0);
773
+ __decorate([
774
+ queryAssignedElements({ slot: 'prev' }),
775
+ __metadata("design:type", Array)
776
+ ], ItPagination.prototype, "prevElements", void 0);
777
+ __decorate([
778
+ queryAssignedElements({ slot: 'next' }),
779
+ __metadata("design:type", Array)
780
+ ], ItPagination.prototype, "nextElements", void 0);
781
+ __decorate([
782
+ queryAssignedElements({ slot: 'total' }),
783
+ __metadata("design:type", Array)
784
+ ], ItPagination.prototype, "totalElements", void 0);
785
+ __decorate([
786
+ property({ type: String, reflect: true }),
787
+ __metadata("design:type", Object)
788
+ ], ItPagination.prototype, "value", void 0);
789
+ __decorate([
790
+ property({ type: String, reflect: true }),
791
+ __metadata("design:type", Object)
792
+ ], ItPagination.prototype, "total", void 0);
793
+ __decorate([
794
+ property({ type: String, reflect: true }),
795
+ __metadata("design:type", String)
796
+ ], ItPagination.prototype, "align", void 0);
797
+ __decorate([
798
+ property({ type: Boolean, reflect: true }),
799
+ __metadata("design:type", Object)
800
+ ], ItPagination.prototype, "disableResponsive", void 0);
801
+ __decorate([
802
+ property({ type: Boolean, reflect: true, attribute: 'simple-mode' }),
803
+ __metadata("design:type", Object)
804
+ ], ItPagination.prototype, "simpleMode", void 0);
805
+ __decorate([
806
+ property({ type: Number, reflect: true, attribute: 'visible-pages' }),
807
+ __metadata("design:type", Object)
808
+ ], ItPagination.prototype, "visiblePages", void 0);
809
+ __decorate([
810
+ property({ type: String, attribute: 'it-aria-label', reflect: true }),
811
+ __metadata("design:type", Object)
812
+ ], ItPagination.prototype, "itAriaLabel", void 0);
813
+ ItPagination = __decorate([
814
+ customElement('it-pagination')
815
+ ], ItPagination);
816
+
817
+ export { ItPagination };
818
+ //# sourceMappingURL=it-pagination.js.map