@italia/pagination 1.0.0-beta.1 → 1.0.0-beta.3
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.
- package/custom-elements.json +234 -216
- package/dist/src/index.js +1 -1
- package/dist/src/it-pagination-item.d.ts +1 -0
- package/dist/src/it-pagination-item.d.ts.map +1 -1
- package/dist/src/it-pagination-item.js +7 -2
- package/dist/src/it-pagination-item.js.map +1 -1
- package/dist/src/it-pagination.js +1 -1
- package/package.json +24 -24
package/custom-elements.json
CHANGED
|
@@ -2,222 +2,6 @@
|
|
|
2
2
|
"schemaVersion": "1.0.0",
|
|
3
3
|
"readme": "",
|
|
4
4
|
"modules": [
|
|
5
|
-
{
|
|
6
|
-
"kind": "javascript-module",
|
|
7
|
-
"path": "stories/it-pagination.stories.ts",
|
|
8
|
-
"declarations": [
|
|
9
|
-
{
|
|
10
|
-
"kind": "variable",
|
|
11
|
-
"name": "meta",
|
|
12
|
-
"type": {
|
|
13
|
-
"text": "Meta<PaginationProps>"
|
|
14
|
-
},
|
|
15
|
-
"default": "{ title: 'Componenti/Pagination', tags: ['a11y-ok', 'web-component'], decorators: [ (story, context) => { if (context.parameters.overrideMetaWrapper) return story(); return html` <div style=\"padding-block: 2rem;margin:auto;display:flex;\"> <!-- START COMPONENT --> ${story()} <!-- END COMPONENT --> </div> `; }, ], parameters: { layout: 'fullscreen', docs: { source: { excludeDecorators: true }, }, a11y: { config: { rules: [ { id: 'list', enabled: false, }, { id: 'listitem', enabled: false, }, ], }, }, }, args: { value: '1', total: '5', align: 'center', disableResponsive: false, simpleMode: false, visiblePages: 5, itAriaLabel: 'Paginazione', }, argTypes: { value: { control: 'text', description: 'Pagina corrente selezionata', table: { defaultValue: { summary: '1' } }, }, total: { control: false, description: 'Numero totale di pagine, se non specificato viene calcolato in base agli elementi `it-pagination-item` presenti. Utile per indicare un numero di pagine diverso rispetto agli elementi effettivamente presenti (es. con caricamento dinamico) e in modalità simple-mode', table: { defaultValue: { summary: undefined } }, }, align: { control: 'select', description: 'Allineamento della paginazione', options: PAGINATION_ALIGNMENTS, table: { defaultValue: { summary: 'start' } }, }, disableResponsive: { name: 'disable-responsive', control: 'boolean', description: 'Disabilita responsive mode (nasconde pagine non correnti su mobile)', table: { defaultValue: { summary: 'false' } }, }, simpleMode: { name: 'simple-mode', control: false, description: \"Abilita simple mode (mostra solo pagina corrente / totale, ottimizzato per mobile). Vai alla storia dedicata per l'esempio.\", table: { defaultValue: { summary: 'false' } }, }, visiblePages: { name: 'visible-pages', control: 'number', description: \"Numero di pagine visibili quando il totale (total) supera questo valore. Verranno mostrati i puntini '...' per indicare la presenza di ulteriori pagine.\", table: { defaultValue: { summary: '5' } }, }, itAriaLabel: { name: 'it-aria-label', control: 'text', description: \"Imposta l'attributo `aria-label` per il componente, utile per migliorare l'accessibilità.\", table: { defaultValue: { summary: 'Paginazione' } }, }, }, }"
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"kind": "variable",
|
|
19
|
-
"name": "EsempioInterattivo",
|
|
20
|
-
"type": {
|
|
21
|
-
"text": "Story"
|
|
22
|
-
},
|
|
23
|
-
"default": "{ tags: ['!dev'], render: (args) => renderComponent(args, defaultItems), }"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"kind": "variable",
|
|
27
|
-
"name": "ConNavigazione",
|
|
28
|
-
"type": {
|
|
29
|
-
"text": "Story"
|
|
30
|
-
},
|
|
31
|
-
"default": "{ name: 'Con pulsanti avanti e indietro', render: () => html` <it-pagination value=\"3\"> <a href=\"#\" slot=\"prev\"> <it-icon name=\"it-chevron-left\"></it-icon> <span class=\"visually-hidden\">Pagina precedente</span> </a> <it-pagination-item page=\"1\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>1</a> </it-pagination-item> <it-pagination-item page=\"2\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>2</a> </it-pagination-item> <it-pagination-item page=\"3\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>3</a> </it-pagination-item> <it-pagination-item page=\"4\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>4</a> </it-pagination-item> <it-pagination-item page=\"5\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>5</a> </it-pagination-item> <a href=\"#\" slot=\"next\"> <it-icon name=\"it-chevron-right\"></it-icon> <span class=\"visually-hidden\">Pagina successiva</span> </a> </it-pagination> `, }"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"kind": "variable",
|
|
35
|
-
"name": "ConNavigazioneTestuale",
|
|
36
|
-
"type": {
|
|
37
|
-
"text": "Story"
|
|
38
|
-
},
|
|
39
|
-
"default": "{ name: 'Con link testuali', render: () => html` <it-pagination value=\"3\"> <a href=\"#\" slot=\"prev\">Precedente</a> <it-pagination-item page=\"1\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>1</a> </it-pagination-item> <it-pagination-item page=\"2\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>2</a> </it-pagination-item> <it-pagination-item page=\"3\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>3</a> </it-pagination-item> <it-pagination-item page=\"4\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>4</a> </it-pagination-item> <it-pagination-item page=\"5\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>5</a> </it-pagination-item> <a href=\"#\" slot=\"next\">Successiva</a> </it-pagination> `, }"
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"kind": "variable",
|
|
43
|
-
"name": "AllineamentoStart",
|
|
44
|
-
"type": {
|
|
45
|
-
"text": "Story"
|
|
46
|
-
},
|
|
47
|
-
"default": "{ name: 'Allineamento a sinistra', render: () => html` <it-pagination value=\"2\" align=\"start\"> <a href=\"#\" slot=\"prev\"> <it-icon name=\"it-chevron-left\"></it-icon> <span class=\"visually-hidden\">Pagina precedente</span> </a> <it-pagination-item page=\"1\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>1</a> </it-pagination-item> <it-pagination-item page=\"2\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>2</a> </it-pagination-item> <it-pagination-item page=\"3\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>3</a> </it-pagination-item> <a href=\"#\" slot=\"next\"> <it-icon name=\"it-chevron-right\"></it-icon> <span class=\"visually-hidden\">Pagina successiva</span> </a> <p slot=\"total\">Totale 300 elementi</p> </it-pagination> `, }"
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"kind": "variable",
|
|
51
|
-
"name": "AllineamentoCenter",
|
|
52
|
-
"type": {
|
|
53
|
-
"text": "Story"
|
|
54
|
-
},
|
|
55
|
-
"default": "{ name: 'Allineamento centrato', render: () => html` <it-pagination value=\"2\" align=\"center\"> <a href=\"#\" slot=\"prev\"> <it-icon name=\"it-chevron-left\"></it-icon> <span class=\"visually-hidden\">Pagina precedente</span> </a> <it-pagination-item page=\"1\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>1</a> </it-pagination-item> <it-pagination-item page=\"2\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>2</a> </it-pagination-item> <it-pagination-item page=\"3\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>3</a> </it-pagination-item> <a href=\"#\" slot=\"next\"> <it-icon name=\"it-chevron-right\"></it-icon> <span class=\"visually-hidden\">Pagina successiva</span> </a> <p slot=\"total\">Totale 300 elementi</p> </it-pagination> `, }"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"kind": "variable",
|
|
59
|
-
"name": "AllineamentoEnd",
|
|
60
|
-
"type": {
|
|
61
|
-
"text": "Story"
|
|
62
|
-
},
|
|
63
|
-
"default": "{ name: 'Allineamento a destra', decorators: [(story) => html` <div style=\"width:100%\">${story()}</div> `], render: () => html` <it-pagination value=\"2\" align=\"end\"> <a href=\"#\" slot=\"prev\"> <it-icon name=\"it-chevron-left\"></it-icon> <span class=\"visually-hidden\">Pagina precedente</span> </a> <it-pagination-item page=\"1\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>1</a> </it-pagination-item> <it-pagination-item page=\"2\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>2</a> </it-pagination-item> <it-pagination-item page=\"3\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>3</a> </it-pagination-item> <a href=\"#\" slot=\"next\"> <it-icon name=\"it-chevron-right\"></it-icon> <span class=\"visually-hidden\">Pagina successiva</span> </a> <p slot=\"total\">Totale 300 elementi</p> </it-pagination> `, }"
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"kind": "variable",
|
|
67
|
-
"name": "Responsive",
|
|
68
|
-
"type": {
|
|
69
|
-
"text": "Story"
|
|
70
|
-
},
|
|
71
|
-
"default": "{ name: 'Paginazione responsive', render: () => html` <it-pagination value=\"1\"> <a href=\"#\" slot=\"prev\"> <it-icon name=\"it-chevron-left\"></it-icon> <span class=\"visually-hidden\">Pagina precedente</span> </a> <it-pagination-item page=\"1\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>1</a> </it-pagination-item> <it-pagination-item page=\"2\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>2</a> </it-pagination-item> <it-pagination-item page=\"3\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>3</a> </it-pagination-item> <it-pagination-item page=\"4\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>4</a> </it-pagination-item> <it-pagination-item page=\"5\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina</span>5</a> </it-pagination-item> <a href=\"#\" slot=\"next\"> <it-icon name=\"it-chevron-right\"></it-icon> <span class=\"visually-hidden\">Pagina successiva</span> </a> <p slot=\"total\">Totale 300 elementi</p> </it-pagination> `, }"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"kind": "variable",
|
|
75
|
-
"name": "ConTotale",
|
|
76
|
-
"type": {
|
|
77
|
-
"text": "Story"
|
|
78
|
-
},
|
|
79
|
-
"default": "{ name: 'Con numero totale di pagine', render: () => html` <it-pagination value=\"3\"> <a href=\"#\" slot=\"prev\"> <it-icon name=\"it-chevron-left\"></it-icon> <span class=\"visually-hidden\">Pagina precedente</span> </a> <it-pagination-item page=\"1\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>1</a> </it-pagination-item> <it-pagination-item page=\"2\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>2</a> </it-pagination-item> <it-pagination-item page=\"3\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>3</a> </it-pagination-item> <it-pagination-item page=\"4\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>4</a> </it-pagination-item> <it-pagination-item page=\"5\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>5</a> </it-pagination-item> <a href=\"#\" slot=\"next\"> <it-icon name=\"it-chevron-right\"></it-icon> <span class=\"visually-hidden\">Pagina successiva</span> </a> <p slot=\"total\">Totale 300 elementi</p> </it-pagination> `, }"
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"kind": "variable",
|
|
83
|
-
"name": "ConPageChanger",
|
|
84
|
-
"type": {
|
|
85
|
-
"text": "Story"
|
|
86
|
-
},
|
|
87
|
-
"default": "{ name: 'Con selettore pagine', render: () => html` <it-pagination value=\"3\"> <a href=\"#\" slot=\"prev\"> <it-icon name=\"it-chevron-left\"></it-icon> <span class=\"visually-hidden\">Pagina precedente</span> </a> <it-pagination-item page=\"1\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>1</a> </it-pagination-item> <it-pagination-item page=\"2\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>2</a> </it-pagination-item> <it-pagination-item page=\"3\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>3</a> </it-pagination-item> <it-pagination-item page=\"4\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>4</a> </it-pagination-item> <it-pagination-item page=\"5\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>5</a> </it-pagination-item> <a href=\"#\" slot=\"next\"> <it-icon name=\"it-chevron-right\"></it-icon> <span class=\"visually-hidden\">Pagina successiva</span> </a> <div slot=\"page-changer\"> <label for=\"page-size\" class=\"visually-hidden\">Elementi per pagina:</label> <select id=\"page-size\" class=\"form-select\" style=\"padding-right: 1.5rem;\"> <option value=\"10\">10/pagina</option> <option value=\"20\" selected>20/pagina</option> <option value=\"50\">50/pagina</option> <option value=\"100\">100/pagina</option> </select> </div> </it-pagination> <script> const pageSizeSelect = document.getElementById('page-size'); pageSizeSelect.addEventListener('change', (event) => { const selectedValue = event.target.value; console.log('PageChanger: Elementi per pagina selezionati:', selectedValue); }); </script> `, }"
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
"kind": "variable",
|
|
91
|
-
"name": "ConJumpToPage",
|
|
92
|
-
"type": {
|
|
93
|
-
"text": "Story"
|
|
94
|
-
},
|
|
95
|
-
"default": "{ name: 'Con salto a pagina specifica', render: () => html` <it-pagination id=\"jump\" value=\"5\" total=\"10\"> <a href=\"#\" slot=\"prev\"> <it-icon name=\"it-chevron-left\"></it-icon> <span class=\"visually-hidden\">Pagina precedente</span> </a> <it-pagination-item page=\"1\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>1</a> </it-pagination-item> <it-pagination-item page=\"2\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>2</a> </it-pagination-item> <it-pagination-item page=\"3\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>3</a> </it-pagination-item> <it-pagination-item page=\"4\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>4</a> </it-pagination-item> <it-pagination-item page=\"5\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>5</a> </it-pagination-item> <it-pagination-item page=\"6\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>6</a> </it-pagination-item> <it-pagination-item page=\"7\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>7</a> </it-pagination-item> <it-pagination-item page=\"8\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>8</a> </it-pagination-item> <it-pagination-item page=\"9\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>9</a> </it-pagination-item> <it-pagination-item page=\"10\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>10</a> </it-pagination-item> <a href=\"#\" slot=\"next\"> <it-icon name=\"it-chevron-right\"></it-icon> <span class=\"visually-hidden\">Pagina successiva</span> </a> <div slot=\"jump-to-page\" style=\"display: flex; align-items: center; gap: 0.5rem;\"> <it-input id=\"jumper-example\" type=\"number\" name=\"jumper-example\" placeholder=\"Vai a ...\" label-hidden style=\"width: 80px;\" > <span slot=\"label\">Vai a ...</span> </it-input> </div> </it-pagination> <script> const jumperInput = document.getElementById('jumper-example'); const pagination = document.getElementById('jump'); const pTot = parseInt(pagination.getAttribute('total')); jumperInput.addEventListener('it-change', () => { const pageNumber = jumperInput.value; if (pageNumber < 1 || pageNumber > pTot) { console.log('JumpToPage: Numero di pagina non valido', pageNumber); return; } console.log('JumpToPage: Vai a pagina', pageNumber); pagination.value = pageNumber.toString(); }); </script> `, }"
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
"kind": "variable",
|
|
99
|
-
"name": "SimpleMode",
|
|
100
|
-
"type": {
|
|
101
|
-
"text": "Story"
|
|
102
|
-
},
|
|
103
|
-
"default": "{ args: { value: '3', total: '10', }, render: () => html` <it-pagination simple-mode value=\"1\" total=\"5\"> <a href=\"#\" slot=\"prev\"> <it-icon name=\"it-chevron-left\"></it-icon> <span class=\"visually-hidden\">Pagina precedente</span> </a> <a href=\"#\" slot=\"next\"> <it-icon name=\"it-chevron-right\"></it-icon> <span class=\"visually-hidden\">Pagina successiva</span> </a> </it-pagination> `, }"
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
"kind": "variable",
|
|
107
|
-
"name": "MoreMode",
|
|
108
|
-
"type": {
|
|
109
|
-
"text": "Story"
|
|
110
|
-
},
|
|
111
|
-
"default": "{ args: { value: '25', total: '50', visiblePages: 5, }, render: () => html` <it-pagination value=\"25\" total=\"50\" visible-pages=\"5\" disable-responsive> <a href=\"#\" slot=\"prev\"> <it-icon name=\"it-chevron-left\"></it-icon> <span class=\"visually-hidden\">Pagina precedente</span> </a> ${Array.from({ length: 50 }, (_, i) => i + 1).map( (page) => html` <it-pagination-item page=\"${page}\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>${page}</a> </it-pagination-item> `, )} <a href=\"#\" slot=\"next\"> <it-icon name=\"it-chevron-right\"></it-icon> <span class=\"visually-hidden\">Pagina successiva</span> </a> </it-pagination> `, }"
|
|
112
|
-
}
|
|
113
|
-
],
|
|
114
|
-
"exports": [
|
|
115
|
-
{
|
|
116
|
-
"kind": "js",
|
|
117
|
-
"name": "default",
|
|
118
|
-
"declaration": {
|
|
119
|
-
"name": "meta",
|
|
120
|
-
"module": "stories/it-pagination.stories.ts"
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
"kind": "js",
|
|
125
|
-
"name": "EsempioInterattivo",
|
|
126
|
-
"declaration": {
|
|
127
|
-
"name": "EsempioInterattivo",
|
|
128
|
-
"module": "stories/it-pagination.stories.ts"
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
"kind": "js",
|
|
133
|
-
"name": "ConNavigazione",
|
|
134
|
-
"declaration": {
|
|
135
|
-
"name": "ConNavigazione",
|
|
136
|
-
"module": "stories/it-pagination.stories.ts"
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
"kind": "js",
|
|
141
|
-
"name": "ConNavigazioneTestuale",
|
|
142
|
-
"declaration": {
|
|
143
|
-
"name": "ConNavigazioneTestuale",
|
|
144
|
-
"module": "stories/it-pagination.stories.ts"
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
"kind": "js",
|
|
149
|
-
"name": "AllineamentoStart",
|
|
150
|
-
"declaration": {
|
|
151
|
-
"name": "AllineamentoStart",
|
|
152
|
-
"module": "stories/it-pagination.stories.ts"
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
"kind": "js",
|
|
157
|
-
"name": "AllineamentoCenter",
|
|
158
|
-
"declaration": {
|
|
159
|
-
"name": "AllineamentoCenter",
|
|
160
|
-
"module": "stories/it-pagination.stories.ts"
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
"kind": "js",
|
|
165
|
-
"name": "AllineamentoEnd",
|
|
166
|
-
"declaration": {
|
|
167
|
-
"name": "AllineamentoEnd",
|
|
168
|
-
"module": "stories/it-pagination.stories.ts"
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
"kind": "js",
|
|
173
|
-
"name": "Responsive",
|
|
174
|
-
"declaration": {
|
|
175
|
-
"name": "Responsive",
|
|
176
|
-
"module": "stories/it-pagination.stories.ts"
|
|
177
|
-
}
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
"kind": "js",
|
|
181
|
-
"name": "ConTotale",
|
|
182
|
-
"declaration": {
|
|
183
|
-
"name": "ConTotale",
|
|
184
|
-
"module": "stories/it-pagination.stories.ts"
|
|
185
|
-
}
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
"kind": "js",
|
|
189
|
-
"name": "ConPageChanger",
|
|
190
|
-
"declaration": {
|
|
191
|
-
"name": "ConPageChanger",
|
|
192
|
-
"module": "stories/it-pagination.stories.ts"
|
|
193
|
-
}
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
"kind": "js",
|
|
197
|
-
"name": "ConJumpToPage",
|
|
198
|
-
"declaration": {
|
|
199
|
-
"name": "ConJumpToPage",
|
|
200
|
-
"module": "stories/it-pagination.stories.ts"
|
|
201
|
-
}
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
"kind": "js",
|
|
205
|
-
"name": "SimpleMode",
|
|
206
|
-
"declaration": {
|
|
207
|
-
"name": "SimpleMode",
|
|
208
|
-
"module": "stories/it-pagination.stories.ts"
|
|
209
|
-
}
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
"kind": "js",
|
|
213
|
-
"name": "MoreMode",
|
|
214
|
-
"declaration": {
|
|
215
|
-
"name": "MoreMode",
|
|
216
|
-
"module": "stories/it-pagination.stories.ts"
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
]
|
|
220
|
-
},
|
|
221
5
|
{
|
|
222
6
|
"kind": "javascript-module",
|
|
223
7
|
"path": "src/index.ts",
|
|
@@ -259,6 +43,16 @@
|
|
|
259
43
|
"static": true,
|
|
260
44
|
"default": "{ ...BaseComponent.shadowRootOptions, delegatesFocus: true }"
|
|
261
45
|
},
|
|
46
|
+
{
|
|
47
|
+
"kind": "field",
|
|
48
|
+
"name": "elRole",
|
|
49
|
+
"type": {
|
|
50
|
+
"text": "string"
|
|
51
|
+
},
|
|
52
|
+
"default": "'listitem'",
|
|
53
|
+
"attribute": "role",
|
|
54
|
+
"reflects": true
|
|
55
|
+
},
|
|
262
56
|
{
|
|
263
57
|
"kind": "field",
|
|
264
58
|
"name": "page",
|
|
@@ -322,6 +116,14 @@
|
|
|
322
116
|
}
|
|
323
117
|
],
|
|
324
118
|
"attributes": [
|
|
119
|
+
{
|
|
120
|
+
"name": "role",
|
|
121
|
+
"type": {
|
|
122
|
+
"text": "string"
|
|
123
|
+
},
|
|
124
|
+
"default": "'listitem'",
|
|
125
|
+
"fieldName": "elRole"
|
|
126
|
+
},
|
|
325
127
|
{
|
|
326
128
|
"name": "page",
|
|
327
129
|
"type": {
|
|
@@ -730,6 +532,222 @@
|
|
|
730
532
|
}
|
|
731
533
|
}
|
|
732
534
|
]
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
"kind": "javascript-module",
|
|
538
|
+
"path": "stories/it-pagination.stories.ts",
|
|
539
|
+
"declarations": [
|
|
540
|
+
{
|
|
541
|
+
"kind": "variable",
|
|
542
|
+
"name": "meta",
|
|
543
|
+
"type": {
|
|
544
|
+
"text": "Meta<PaginationProps>"
|
|
545
|
+
},
|
|
546
|
+
"default": "{ title: 'Componenti/Pagination', tags: ['a11y-ok', 'web-component'], decorators: [ (story, context) => { if (context.parameters.overrideMetaWrapper) return story(); return html` <div style=\"padding-block: 2rem;margin:auto;display:flex;\"> <!-- START COMPONENT --> ${story()} <!-- END COMPONENT --> </div> `; }, ], parameters: { layout: 'fullscreen', docs: { source: { excludeDecorators: true }, }, a11y: { config: { rules: [ { id: 'list', enabled: false, }, { id: 'listitem', enabled: false, }, ], }, }, }, args: { value: '1', total: '5', align: 'center', disableResponsive: false, simpleMode: false, visiblePages: 5, itAriaLabel: 'Paginazione', }, argTypes: { value: { control: 'text', description: 'Pagina corrente selezionata', table: { defaultValue: { summary: '1' } }, }, total: { control: false, description: 'Numero totale di pagine, se non specificato viene calcolato in base agli elementi `it-pagination-item` presenti. Utile per indicare un numero di pagine diverso rispetto agli elementi effettivamente presenti (es. con caricamento dinamico) e in modalità simple-mode', table: { defaultValue: { summary: undefined } }, }, align: { control: 'select', description: 'Allineamento della paginazione', options: PAGINATION_ALIGNMENTS, table: { defaultValue: { summary: 'start' } }, }, disableResponsive: { name: 'disable-responsive', control: 'boolean', description: 'Disabilita responsive mode (nasconde pagine non correnti su mobile)', table: { defaultValue: { summary: 'false' } }, }, simpleMode: { name: 'simple-mode', control: false, description: \"Abilita simple mode (mostra solo pagina corrente / totale, ottimizzato per mobile). Vai alla storia dedicata per l'esempio.\", table: { defaultValue: { summary: 'false' } }, }, visiblePages: { name: 'visible-pages', control: 'number', description: \"Numero di pagine visibili quando il totale (total) supera questo valore. Verranno mostrati i puntini '...' per indicare la presenza di ulteriori pagine.\", table: { defaultValue: { summary: '5' } }, }, itAriaLabel: { name: 'it-aria-label', control: 'text', description: \"Imposta l'attributo `aria-label` per il componente, utile per migliorare l'accessibilità.\", table: { defaultValue: { summary: 'Paginazione' } }, }, }, }"
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
"kind": "variable",
|
|
550
|
+
"name": "EsempioInterattivo",
|
|
551
|
+
"type": {
|
|
552
|
+
"text": "Story"
|
|
553
|
+
},
|
|
554
|
+
"default": "{ tags: ['!dev'], render: (args) => renderComponent(args, defaultItems), }"
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
"kind": "variable",
|
|
558
|
+
"name": "ConNavigazione",
|
|
559
|
+
"type": {
|
|
560
|
+
"text": "Story"
|
|
561
|
+
},
|
|
562
|
+
"default": "{ name: 'Con pulsanti avanti e indietro', render: () => html` <it-pagination value=\"3\"> <a href=\"#\" slot=\"prev\"> <it-icon name=\"it-chevron-left\"></it-icon> <span class=\"visually-hidden\">Pagina precedente</span> </a> <it-pagination-item page=\"1\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>1</a> </it-pagination-item> <it-pagination-item page=\"2\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>2</a> </it-pagination-item> <it-pagination-item page=\"3\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>3</a> </it-pagination-item> <it-pagination-item page=\"4\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>4</a> </it-pagination-item> <it-pagination-item page=\"5\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>5</a> </it-pagination-item> <a href=\"#\" slot=\"next\"> <it-icon name=\"it-chevron-right\"></it-icon> <span class=\"visually-hidden\">Pagina successiva</span> </a> </it-pagination> `, }"
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
"kind": "variable",
|
|
566
|
+
"name": "ConNavigazioneTestuale",
|
|
567
|
+
"type": {
|
|
568
|
+
"text": "Story"
|
|
569
|
+
},
|
|
570
|
+
"default": "{ name: 'Con link testuali', render: () => html` <it-pagination value=\"3\"> <a href=\"#\" slot=\"prev\">Precedente</a> <it-pagination-item page=\"1\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>1</a> </it-pagination-item> <it-pagination-item page=\"2\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>2</a> </it-pagination-item> <it-pagination-item page=\"3\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>3</a> </it-pagination-item> <it-pagination-item page=\"4\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>4</a> </it-pagination-item> <it-pagination-item page=\"5\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>5</a> </it-pagination-item> <a href=\"#\" slot=\"next\">Successiva</a> </it-pagination> `, }"
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
"kind": "variable",
|
|
574
|
+
"name": "AllineamentoStart",
|
|
575
|
+
"type": {
|
|
576
|
+
"text": "Story"
|
|
577
|
+
},
|
|
578
|
+
"default": "{ name: 'Allineamento a sinistra', render: () => html` <it-pagination value=\"2\" align=\"start\"> <a href=\"#\" slot=\"prev\"> <it-icon name=\"it-chevron-left\"></it-icon> <span class=\"visually-hidden\">Pagina precedente</span> </a> <it-pagination-item page=\"1\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>1</a> </it-pagination-item> <it-pagination-item page=\"2\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>2</a> </it-pagination-item> <it-pagination-item page=\"3\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>3</a> </it-pagination-item> <a href=\"#\" slot=\"next\"> <it-icon name=\"it-chevron-right\"></it-icon> <span class=\"visually-hidden\">Pagina successiva</span> </a> <p slot=\"total\">Totale 300 elementi</p> </it-pagination> `, }"
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
"kind": "variable",
|
|
582
|
+
"name": "AllineamentoCenter",
|
|
583
|
+
"type": {
|
|
584
|
+
"text": "Story"
|
|
585
|
+
},
|
|
586
|
+
"default": "{ name: 'Allineamento centrato', render: () => html` <it-pagination value=\"2\" align=\"center\"> <a href=\"#\" slot=\"prev\"> <it-icon name=\"it-chevron-left\"></it-icon> <span class=\"visually-hidden\">Pagina precedente</span> </a> <it-pagination-item page=\"1\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>1</a> </it-pagination-item> <it-pagination-item page=\"2\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>2</a> </it-pagination-item> <it-pagination-item page=\"3\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>3</a> </it-pagination-item> <a href=\"#\" slot=\"next\"> <it-icon name=\"it-chevron-right\"></it-icon> <span class=\"visually-hidden\">Pagina successiva</span> </a> <p slot=\"total\">Totale 300 elementi</p> </it-pagination> `, }"
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
"kind": "variable",
|
|
590
|
+
"name": "AllineamentoEnd",
|
|
591
|
+
"type": {
|
|
592
|
+
"text": "Story"
|
|
593
|
+
},
|
|
594
|
+
"default": "{ name: 'Allineamento a destra', decorators: [(story) => html` <div style=\"width:100%\">${story()}</div> `], render: () => html` <it-pagination value=\"2\" align=\"end\"> <a href=\"#\" slot=\"prev\"> <it-icon name=\"it-chevron-left\"></it-icon> <span class=\"visually-hidden\">Pagina precedente</span> </a> <it-pagination-item page=\"1\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>1</a> </it-pagination-item> <it-pagination-item page=\"2\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>2</a> </it-pagination-item> <it-pagination-item page=\"3\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>3</a> </it-pagination-item> <a href=\"#\" slot=\"next\"> <it-icon name=\"it-chevron-right\"></it-icon> <span class=\"visually-hidden\">Pagina successiva</span> </a> <p slot=\"total\">Totale 300 elementi</p> </it-pagination> `, }"
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
"kind": "variable",
|
|
598
|
+
"name": "Responsive",
|
|
599
|
+
"type": {
|
|
600
|
+
"text": "Story"
|
|
601
|
+
},
|
|
602
|
+
"default": "{ name: 'Paginazione responsive', render: () => html` <it-pagination value=\"1\"> <a href=\"#\" slot=\"prev\"> <it-icon name=\"it-chevron-left\"></it-icon> <span class=\"visually-hidden\">Pagina precedente</span> </a> <it-pagination-item page=\"1\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>1</a> </it-pagination-item> <it-pagination-item page=\"2\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>2</a> </it-pagination-item> <it-pagination-item page=\"3\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>3</a> </it-pagination-item> <it-pagination-item page=\"4\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>4</a> </it-pagination-item> <it-pagination-item page=\"5\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina</span>5</a> </it-pagination-item> <a href=\"#\" slot=\"next\"> <it-icon name=\"it-chevron-right\"></it-icon> <span class=\"visually-hidden\">Pagina successiva</span> </a> <p slot=\"total\">Totale 300 elementi</p> </it-pagination> `, }"
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
"kind": "variable",
|
|
606
|
+
"name": "ConTotale",
|
|
607
|
+
"type": {
|
|
608
|
+
"text": "Story"
|
|
609
|
+
},
|
|
610
|
+
"default": "{ name: 'Con numero totale di pagine', render: () => html` <it-pagination value=\"3\"> <a href=\"#\" slot=\"prev\"> <it-icon name=\"it-chevron-left\"></it-icon> <span class=\"visually-hidden\">Pagina precedente</span> </a> <it-pagination-item page=\"1\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>1</a> </it-pagination-item> <it-pagination-item page=\"2\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>2</a> </it-pagination-item> <it-pagination-item page=\"3\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>3</a> </it-pagination-item> <it-pagination-item page=\"4\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>4</a> </it-pagination-item> <it-pagination-item page=\"5\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>5</a> </it-pagination-item> <a href=\"#\" slot=\"next\"> <it-icon name=\"it-chevron-right\"></it-icon> <span class=\"visually-hidden\">Pagina successiva</span> </a> <p slot=\"total\">Totale 300 elementi</p> </it-pagination> `, }"
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
"kind": "variable",
|
|
614
|
+
"name": "ConPageChanger",
|
|
615
|
+
"type": {
|
|
616
|
+
"text": "Story"
|
|
617
|
+
},
|
|
618
|
+
"default": "{ name: 'Con selettore pagine', render: () => html` <it-pagination value=\"3\"> <a href=\"#\" slot=\"prev\"> <it-icon name=\"it-chevron-left\"></it-icon> <span class=\"visually-hidden\">Pagina precedente</span> </a> <it-pagination-item page=\"1\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>1</a> </it-pagination-item> <it-pagination-item page=\"2\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>2</a> </it-pagination-item> <it-pagination-item page=\"3\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>3</a> </it-pagination-item> <it-pagination-item page=\"4\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>4</a> </it-pagination-item> <it-pagination-item page=\"5\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>5</a> </it-pagination-item> <a href=\"#\" slot=\"next\"> <it-icon name=\"it-chevron-right\"></it-icon> <span class=\"visually-hidden\">Pagina successiva</span> </a> <div slot=\"page-changer\"> <label for=\"page-size\" class=\"visually-hidden\">Elementi per pagina:</label> <select id=\"page-size\" class=\"form-select\" style=\"padding-right: 1.5rem;\"> <option value=\"10\">10/pagina</option> <option value=\"20\" selected>20/pagina</option> <option value=\"50\">50/pagina</option> <option value=\"100\">100/pagina</option> </select> </div> </it-pagination> <script> const pageSizeSelect = document.getElementById('page-size'); pageSizeSelect.addEventListener('change', (event) => { const selectedValue = event.target.value; console.log('PageChanger: Elementi per pagina selezionati:', selectedValue); }); </script> `, }"
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
"kind": "variable",
|
|
622
|
+
"name": "ConJumpToPage",
|
|
623
|
+
"type": {
|
|
624
|
+
"text": "Story"
|
|
625
|
+
},
|
|
626
|
+
"default": "{ name: 'Con salto a pagina specifica', render: () => html` <it-pagination id=\"jump\" value=\"5\" total=\"10\"> <a href=\"#\" slot=\"prev\"> <it-icon name=\"it-chevron-left\"></it-icon> <span class=\"visually-hidden\">Pagina precedente</span> </a> <it-pagination-item page=\"1\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>1</a> </it-pagination-item> <it-pagination-item page=\"2\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>2</a> </it-pagination-item> <it-pagination-item page=\"3\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>3</a> </it-pagination-item> <it-pagination-item page=\"4\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>4</a> </it-pagination-item> <it-pagination-item page=\"5\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>5</a> </it-pagination-item> <it-pagination-item page=\"6\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>6</a> </it-pagination-item> <it-pagination-item page=\"7\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>7</a> </it-pagination-item> <it-pagination-item page=\"8\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>8</a> </it-pagination-item> <it-pagination-item page=\"9\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>9</a> </it-pagination-item> <it-pagination-item page=\"10\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>10</a> </it-pagination-item> <a href=\"#\" slot=\"next\"> <it-icon name=\"it-chevron-right\"></it-icon> <span class=\"visually-hidden\">Pagina successiva</span> </a> <div slot=\"jump-to-page\" style=\"display: flex; align-items: center; gap: 0.5rem;\"> <it-input id=\"jumper-example\" type=\"number\" name=\"jumper-example\" placeholder=\"Vai a ...\" label-hidden style=\"width: 80px;\" > <span slot=\"label\">Vai a ...</span> </it-input> </div> </it-pagination> <script> const jumperInput = document.getElementById('jumper-example'); const pagination = document.getElementById('jump'); const pTot = parseInt(pagination.getAttribute('total')); jumperInput.addEventListener('it-change', () => { const pageNumber = jumperInput.value; if (pageNumber < 1 || pageNumber > pTot) { console.log('JumpToPage: Numero di pagina non valido', pageNumber); return; } console.log('JumpToPage: Vai a pagina', pageNumber); pagination.value = pageNumber.toString(); }); </script> `, }"
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
"kind": "variable",
|
|
630
|
+
"name": "SimpleMode",
|
|
631
|
+
"type": {
|
|
632
|
+
"text": "Story"
|
|
633
|
+
},
|
|
634
|
+
"default": "{ args: { value: '3', total: '10', }, render: () => html` <it-pagination simple-mode value=\"1\" total=\"5\"> <a href=\"#\" slot=\"prev\"> <it-icon name=\"it-chevron-left\"></it-icon> <span class=\"visually-hidden\">Pagina precedente</span> </a> <a href=\"#\" slot=\"next\"> <it-icon name=\"it-chevron-right\"></it-icon> <span class=\"visually-hidden\">Pagina successiva</span> </a> </it-pagination> `, }"
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
"kind": "variable",
|
|
638
|
+
"name": "MoreMode",
|
|
639
|
+
"type": {
|
|
640
|
+
"text": "Story"
|
|
641
|
+
},
|
|
642
|
+
"default": "{ args: { value: '25', total: '50', visiblePages: 5, }, render: () => html` <it-pagination value=\"25\" total=\"50\" visible-pages=\"5\" disable-responsive> <a href=\"#\" slot=\"prev\"> <it-icon name=\"it-chevron-left\"></it-icon> <span class=\"visually-hidden\">Pagina precedente</span> </a> ${Array.from({ length: 50 }, (_, i) => i + 1).map( (page) => html` <it-pagination-item page=\"${page}\"> <a href=\"#\"><span class=\"d-inline-block d-sm-none\">Pagina </span>${page}</a> </it-pagination-item> `, )} <a href=\"#\" slot=\"next\"> <it-icon name=\"it-chevron-right\"></it-icon> <span class=\"visually-hidden\">Pagina successiva</span> </a> </it-pagination> `, }"
|
|
643
|
+
}
|
|
644
|
+
],
|
|
645
|
+
"exports": [
|
|
646
|
+
{
|
|
647
|
+
"kind": "js",
|
|
648
|
+
"name": "default",
|
|
649
|
+
"declaration": {
|
|
650
|
+
"name": "meta",
|
|
651
|
+
"module": "stories/it-pagination.stories.ts"
|
|
652
|
+
}
|
|
653
|
+
},
|
|
654
|
+
{
|
|
655
|
+
"kind": "js",
|
|
656
|
+
"name": "EsempioInterattivo",
|
|
657
|
+
"declaration": {
|
|
658
|
+
"name": "EsempioInterattivo",
|
|
659
|
+
"module": "stories/it-pagination.stories.ts"
|
|
660
|
+
}
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
"kind": "js",
|
|
664
|
+
"name": "ConNavigazione",
|
|
665
|
+
"declaration": {
|
|
666
|
+
"name": "ConNavigazione",
|
|
667
|
+
"module": "stories/it-pagination.stories.ts"
|
|
668
|
+
}
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
"kind": "js",
|
|
672
|
+
"name": "ConNavigazioneTestuale",
|
|
673
|
+
"declaration": {
|
|
674
|
+
"name": "ConNavigazioneTestuale",
|
|
675
|
+
"module": "stories/it-pagination.stories.ts"
|
|
676
|
+
}
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
"kind": "js",
|
|
680
|
+
"name": "AllineamentoStart",
|
|
681
|
+
"declaration": {
|
|
682
|
+
"name": "AllineamentoStart",
|
|
683
|
+
"module": "stories/it-pagination.stories.ts"
|
|
684
|
+
}
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
"kind": "js",
|
|
688
|
+
"name": "AllineamentoCenter",
|
|
689
|
+
"declaration": {
|
|
690
|
+
"name": "AllineamentoCenter",
|
|
691
|
+
"module": "stories/it-pagination.stories.ts"
|
|
692
|
+
}
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
"kind": "js",
|
|
696
|
+
"name": "AllineamentoEnd",
|
|
697
|
+
"declaration": {
|
|
698
|
+
"name": "AllineamentoEnd",
|
|
699
|
+
"module": "stories/it-pagination.stories.ts"
|
|
700
|
+
}
|
|
701
|
+
},
|
|
702
|
+
{
|
|
703
|
+
"kind": "js",
|
|
704
|
+
"name": "Responsive",
|
|
705
|
+
"declaration": {
|
|
706
|
+
"name": "Responsive",
|
|
707
|
+
"module": "stories/it-pagination.stories.ts"
|
|
708
|
+
}
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
"kind": "js",
|
|
712
|
+
"name": "ConTotale",
|
|
713
|
+
"declaration": {
|
|
714
|
+
"name": "ConTotale",
|
|
715
|
+
"module": "stories/it-pagination.stories.ts"
|
|
716
|
+
}
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
"kind": "js",
|
|
720
|
+
"name": "ConPageChanger",
|
|
721
|
+
"declaration": {
|
|
722
|
+
"name": "ConPageChanger",
|
|
723
|
+
"module": "stories/it-pagination.stories.ts"
|
|
724
|
+
}
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
"kind": "js",
|
|
728
|
+
"name": "ConJumpToPage",
|
|
729
|
+
"declaration": {
|
|
730
|
+
"name": "ConJumpToPage",
|
|
731
|
+
"module": "stories/it-pagination.stories.ts"
|
|
732
|
+
}
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
"kind": "js",
|
|
736
|
+
"name": "SimpleMode",
|
|
737
|
+
"declaration": {
|
|
738
|
+
"name": "SimpleMode",
|
|
739
|
+
"module": "stories/it-pagination.stories.ts"
|
|
740
|
+
}
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
"kind": "js",
|
|
744
|
+
"name": "MoreMode",
|
|
745
|
+
"declaration": {
|
|
746
|
+
"name": "MoreMode",
|
|
747
|
+
"module": "stories/it-pagination.stories.ts"
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
]
|
|
733
751
|
}
|
|
734
752
|
]
|
|
735
753
|
}
|
package/dist/src/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"it-pagination-item.d.ts","sourceRoot":"","sources":["../../src/it-pagination-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAKhD,qBACa,gBAAiB,SAAQ,aAAa;IACjD,MAAM,CAAC,MAAM,0BAAU;IAEvB,MAAM,CAAC,iBAAiB;;;;;;;MAAgE;
|
|
1
|
+
{"version":3,"file":"it-pagination-item.d.ts","sourceRoot":"","sources":["../../src/it-pagination-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAKhD,qBACa,gBAAiB,SAAQ,aAAa;IACjD,MAAM,CAAC,MAAM,0BAAU;IAEvB,MAAM,CAAC,iBAAiB;;;;;;;MAAgE;IAE1B,MAAM,SAAc;IAGlF,IAAI,SAAM;IAGV,OAAO,UAAS;IAGhB,QAAQ,UAAS;IAER,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC;IAS1E,OAAO,CAAC,qBAAqB;IA0B7B,OAAO,CAAC,gBAAgB;IAKxB,OAAO,CAAC,WAAW;IAmBV,MAAM;CAUhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,oBAAoB,EAAE,gBAAgB,CAAC;KACxC;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseComponent, _ as __decorate, a as __metadata } from '../index-
|
|
1
|
+
import { B as BaseComponent, _ as __decorate, a as __metadata } from '../index-B6UWwXKd.js';
|
|
2
2
|
import { css, html } from 'lit';
|
|
3
3
|
import { property, customElement } from 'lit/decorators.js';
|
|
4
4
|
import 'lit/directive.js';
|
|
@@ -390,6 +390,7 @@ progress {
|
|
|
390
390
|
let ItPaginationItem = class ItPaginationItem extends BaseComponent {
|
|
391
391
|
constructor() {
|
|
392
392
|
super(...arguments);
|
|
393
|
+
this.elRole = 'listitem';
|
|
393
394
|
this.page = '';
|
|
394
395
|
this.current = false;
|
|
395
396
|
this.disabled = false;
|
|
@@ -450,7 +451,7 @@ let ItPaginationItem = class ItPaginationItem extends BaseComponent {
|
|
|
450
451
|
// La classe 'page-item' va sul contenitore LI per Bootstrap
|
|
451
452
|
const liClasses = this.composeClass('page-item', this.current && 'active', this.disabled && 'disabled');
|
|
452
453
|
return html `
|
|
453
|
-
<li class="${liClasses}">
|
|
454
|
+
<li class="${liClasses}" role="presentation">
|
|
454
455
|
<slot @slotchange="${this.handleSlotChange}"></slot>
|
|
455
456
|
</li>
|
|
456
457
|
`;
|
|
@@ -458,6 +459,10 @@ let ItPaginationItem = class ItPaginationItem extends BaseComponent {
|
|
|
458
459
|
};
|
|
459
460
|
ItPaginationItem.styles = styles;
|
|
460
461
|
ItPaginationItem.shadowRootOptions = { ...BaseComponent.shadowRootOptions, delegatesFocus: true };
|
|
462
|
+
__decorate([
|
|
463
|
+
property({ type: String, reflect: true, attribute: 'role' }),
|
|
464
|
+
__metadata("design:type", Object)
|
|
465
|
+
], ItPaginationItem.prototype, "elRole", void 0);
|
|
461
466
|
__decorate([
|
|
462
467
|
property({ type: String, reflect: true }),
|
|
463
468
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"it-pagination-item.js","sources":["../../../src/it-pagination-item.ts"],"sourcesContent":["import { BaseComponent } from '@italia/globals';\nimport { html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport styles from './pagination-item.scss';\n\n@customElement('it-pagination-item')\nexport class ItPaginationItem extends BaseComponent {\n static styles = styles;\n\n static shadowRootOptions = { ...BaseComponent.shadowRootOptions, delegatesFocus: true };\n\n @property({ type: String, reflect: true })\n page = '';\n\n @property({ type: Boolean, reflect: true })\n current = false;\n\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n override updated(changedProperties: Map<string | number | symbol, unknown>) {\n super.updated?.(changedProperties);\n\n // When current or disabled state changes, update the slotted elements\n if (changedProperties.has('current') || changedProperties.has('disabled')) {\n this.updateSlottedElements();\n }\n }\n\n private updateSlottedElements() {\n const slot = this.shadowRoot?.querySelector('slot') as HTMLSlotElement;\n if (!slot) return;\n\n const assignedElements = slot.assignedElements();\n assignedElements.forEach((element) => {\n // Gestione accessibilità per l'elemento interno (es. <a> o <button>)\n if (this.current) {\n element.setAttribute('aria-current', 'page');\n } else {\n element.removeAttribute('aria-current');\n }\n\n if (this.disabled) {\n element.setAttribute('aria-disabled', 'true');\n element.setAttribute('tabindex', '-1');\n } else {\n element.removeAttribute('aria-disabled');\n element.removeAttribute('tabindex');\n }\n element.classList.add('page-link');\n element.removeEventListener('click', this.handleClick);\n element.addEventListener('click', this.handleClick.bind(this));\n });\n }\n\n private handleSlotChange() {\n // Initial setup when slot content changes\n this.updateSlottedElements();\n }\n\n private handleClick(e: any) {\n // Se disabilitato o già attivo, ignoriamo il click\n if (this.disabled || this.current) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n\n // Emettiamo un evento \"interno\" che il padre (ItPagination) ascolterà.\n // Usiamo bubbles: true per risalire il DOM fino al padre.\n this.dispatchEvent(\n new CustomEvent('it-item-click', {\n detail: { page: this.page },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n override render() {\n // La classe 'page-item' va sul contenitore LI per Bootstrap\n const liClasses = this.composeClass('page-item', this.current && 'active', this.disabled && 'disabled');\n\n return html`\n <li class=\"${liClasses}\">\n <slot @slotchange=\"${this.handleSlotChange}\"></slot>\n </li>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'it-pagination-item': ItPaginationItem;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMO,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,aAAa,CAAA;AAA5C,IAAA,WAAA,GAAA;;
|
|
1
|
+
{"version":3,"file":"it-pagination-item.js","sources":["../../../src/it-pagination-item.ts"],"sourcesContent":["import { BaseComponent } from '@italia/globals';\nimport { html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport styles from './pagination-item.scss';\n\n@customElement('it-pagination-item')\nexport class ItPaginationItem extends BaseComponent {\n static styles = styles;\n\n static shadowRootOptions = { ...BaseComponent.shadowRootOptions, delegatesFocus: true };\n\n @property({ type: String, reflect: true, attribute: 'role' }) elRole = 'listitem';\n\n @property({ type: String, reflect: true })\n page = '';\n\n @property({ type: Boolean, reflect: true })\n current = false;\n\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n override updated(changedProperties: Map<string | number | symbol, unknown>) {\n super.updated?.(changedProperties);\n\n // When current or disabled state changes, update the slotted elements\n if (changedProperties.has('current') || changedProperties.has('disabled')) {\n this.updateSlottedElements();\n }\n }\n\n private updateSlottedElements() {\n const slot = this.shadowRoot?.querySelector('slot') as HTMLSlotElement;\n if (!slot) return;\n\n const assignedElements = slot.assignedElements();\n assignedElements.forEach((element) => {\n // Gestione accessibilità per l'elemento interno (es. <a> o <button>)\n if (this.current) {\n element.setAttribute('aria-current', 'page');\n } else {\n element.removeAttribute('aria-current');\n }\n\n if (this.disabled) {\n element.setAttribute('aria-disabled', 'true');\n element.setAttribute('tabindex', '-1');\n } else {\n element.removeAttribute('aria-disabled');\n element.removeAttribute('tabindex');\n }\n element.classList.add('page-link');\n element.removeEventListener('click', this.handleClick);\n element.addEventListener('click', this.handleClick.bind(this));\n });\n }\n\n private handleSlotChange() {\n // Initial setup when slot content changes\n this.updateSlottedElements();\n }\n\n private handleClick(e: any) {\n // Se disabilitato o già attivo, ignoriamo il click\n if (this.disabled || this.current) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n\n // Emettiamo un evento \"interno\" che il padre (ItPagination) ascolterà.\n // Usiamo bubbles: true per risalire il DOM fino al padre.\n this.dispatchEvent(\n new CustomEvent('it-item-click', {\n detail: { page: this.page },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n override render() {\n // La classe 'page-item' va sul contenitore LI per Bootstrap\n const liClasses = this.composeClass('page-item', this.current && 'active', this.disabled && 'disabled');\n\n return html`\n <li class=\"${liClasses}\" role=\"presentation\">\n <slot @slotchange=\"${this.handleSlotChange}\"></slot>\n </li>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'it-pagination-item': ItPaginationItem;\n }\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseComponent, _ as __decorate, a as __metadata } from '../index-
|
|
1
|
+
import { B as BaseComponent, _ as __decorate, a as __metadata } from '../index-B6UWwXKd.js';
|
|
2
2
|
import { css, html } from 'lit';
|
|
3
3
|
import { when } from 'lit/directives/when.js';
|
|
4
4
|
import { queryAssignedElements, property, customElement } from 'lit/decorators.js';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@italia/pagination",
|
|
3
3
|
"description": "Web component it-pagination del Design system .italia",
|
|
4
|
-
"version": "1.0.0-beta.
|
|
4
|
+
"version": "1.0.0-beta.3",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -34,37 +34,37 @@
|
|
|
34
34
|
"LICENSE",
|
|
35
35
|
"custom-elements.json"
|
|
36
36
|
],
|
|
37
|
-
"scripts": {
|
|
38
|
-
"analyze": "cem analyze --litelement --exclude dist",
|
|
39
|
-
"build": "rollup --config rollup.config.js",
|
|
40
|
-
"clean": "rimraf node_modules .turbo .rollup.cache dist coverage",
|
|
41
|
-
"prepublish": "pnpm build",
|
|
42
|
-
"lint": "eslint --ext .ts \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\" && stylelint \"styles/**/*.scss\" \"src/**/*.scss\" && prettier \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\" --check",
|
|
43
|
-
"format": "eslint --fix --ext .ts \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\" && stylelint --fix \"styles/**/*.scss\" \"src/**/*.scss\" && prettier --write \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\"",
|
|
44
|
-
"test": "wtr --coverage --node-resolve --config web-test-runner.config.js",
|
|
45
|
-
"test:watch": "wtr --coverage --node-resolve --config web-test-runner.config.js --watch"
|
|
46
|
-
},
|
|
47
37
|
"dependencies": {
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
38
|
+
"bootstrap-italia": "3.0.0-beta.5",
|
|
39
|
+
"lit": "^3.2.1",
|
|
40
|
+
"@italia/globals": "^1.0.0-beta.3"
|
|
51
41
|
},
|
|
52
42
|
"devDependencies": {
|
|
53
43
|
"@custom-elements-manifest/analyzer": "^0.10.3",
|
|
54
|
-
"@
|
|
55
|
-
"@italia/test-config": "workspace:^",
|
|
56
|
-
"@italia/typescript-config": "workspace:^",
|
|
57
|
-
"@open-wc/testing": "catalog:",
|
|
44
|
+
"@open-wc/testing": "^4.0.0",
|
|
58
45
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
59
46
|
"@rollup/plugin-typescript": "^12.1.2",
|
|
60
|
-
"@types/mocha": "
|
|
61
|
-
"@web/test-runner": "
|
|
47
|
+
"@types/mocha": "^10.0.10",
|
|
48
|
+
"@web/test-runner": "^0.18.2",
|
|
62
49
|
"rimraf": "^6.0.1",
|
|
63
50
|
"rollup": "^4.42.0",
|
|
64
51
|
"rollup-plugin-scss-lit": "^2.1.0",
|
|
65
|
-
"sass": "
|
|
52
|
+
"sass": "^1.89.0",
|
|
66
53
|
"tslib": "^2.6.3",
|
|
67
|
-
"typescript": "
|
|
54
|
+
"typescript": "^5.5.3",
|
|
55
|
+
"@italia/icon": "^1.0.0-beta.3",
|
|
56
|
+
"@italia/test-config": "^1.0.0-beta.2",
|
|
57
|
+
"@italia/typescript-config": "^1.0.0-beta.1"
|
|
68
58
|
},
|
|
69
|
-
"customElements": "custom-elements.json"
|
|
70
|
-
|
|
59
|
+
"customElements": "custom-elements.json",
|
|
60
|
+
"scripts": {
|
|
61
|
+
"analyze": "cem analyze --litelement --exclude dist",
|
|
62
|
+
"build": "rollup --config rollup.config.js",
|
|
63
|
+
"clean": "rimraf node_modules .turbo .rollup.cache dist coverage",
|
|
64
|
+
"prepublish": "pnpm build",
|
|
65
|
+
"lint": "eslint --ext .ts \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\" && stylelint \"styles/**/*.scss\" \"src/**/*.scss\" && prettier \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\" --check",
|
|
66
|
+
"format": "eslint --fix --ext .ts \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\" && stylelint --fix \"styles/**/*.scss\" \"src/**/*.scss\" && prettier --write \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\"",
|
|
67
|
+
"test": "wtr --coverage --node-resolve --config web-test-runner.config.js",
|
|
68
|
+
"test:watch": "wtr --coverage --node-resolve --config web-test-runner.config.js --watch"
|
|
69
|
+
}
|
|
70
|
+
}
|