@massimo-cassandro/minimo 1.42.1 → 1.42.2

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.
Files changed (25) hide show
  1. package/package.json +1 -1
  2. package/src/web-components/json-table/json-table-component.js +2 -2
  3. package/src/web-components/json-table/json-table-component.module.css +0 -117
  4. package/src/web-components/json-table/jt-docs/parametri.md +51 -45
  5. package/src/web-components/json-table/src/cell-content.js +0 -2
  6. package/src/web-components/json-table/src/content-utils.js +0 -1
  7. package/src/web-components/json-table/src/data-types.js +0 -1
  8. package/src/web-components/json-table/src/defaults.js +0 -1
  9. package/src/web-components/json-table/src/get-data.js +0 -1
  10. package/src/web-components/json-table/src/icons.js +0 -1
  11. package/src/web-components/json-table/src/info-section.js +0 -1
  12. package/src/web-components/json-table/src/main-builder.js +0 -1
  13. package/src/web-components/json-table/src/pagination.js +2 -2
  14. package/src/web-components/json-table/src/pagination.module.css +77 -0
  15. package/src/web-components/json-table/src/parse-cols.js +0 -1
  16. package/src/web-components/json-table/src/parse-rows.js +0 -1
  17. package/src/web-components/json-table/src/resolve-params.js +0 -1
  18. package/src/web-components/json-table/src/search.js +0 -1
  19. package/src/web-components/json-table/src/sorting.js +0 -1
  20. package/src/web-components/json-table/src/table-body.js +0 -1
  21. package/src/web-components/json-table/src/table-builder.js +1 -2
  22. package/src/web-components/json-table/src/{table-tfoot.js → tfoot.js} +0 -1
  23. package/src/web-components/json-table/src/{table-thead.js → thead.js} +2 -3
  24. package/src/web-components/json-table/src/thead.module.css +47 -0
  25. package/src/web-components/json-table/src/update-info.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@massimo-cassandro/minimo",
3
- "version": "1.42.1",
3
+ "version": "1.42.2",
4
4
  "description": "Light css framework & utilities",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -8,9 +8,9 @@ import { parseCols } from './src/parse-cols.js';
8
8
  import { parseRows } from './src/parse-rows.js';
9
9
  import { mainBuilder } from './src/main-builder.js';
10
10
  import { renderTbody } from './src/table-body.js';
11
- import { renderTfoot } from './src/table-tfoot.js';
11
+ import { renderTfoot } from './src/tfoot.js';
12
12
  import { updateInfo } from './src/update-info.js';
13
- import { applySortState, setSortListener } from './src/table-thead.js';
13
+ import { applySortState, setSortListener } from './src/thead.js';
14
14
  import { setSearchListener, filterRows } from './src/search.js';
15
15
  import { sortRows } from './src/sorting.js';
16
16
  import { calcTotPages, renderPagination } from './src/pagination.js';
@@ -124,124 +124,7 @@ json-table {
124
124
  color: var(--jt-caption-color);
125
125
  }
126
126
 
127
- .pagination {
128
- margin-inline-start: auto;
129
- }
130
-
131
- .paginationList {
132
- display: flex;
133
- flex-flow: row wrap;
134
- padding: 0;
135
- margin: 0;
136
- list-style: none;
137
- }
138
-
139
- .paginationItem {
140
- border: var(--jt-pagination-border-width) solid var(--jt-pagination-border-color);
141
- border-inline-start-width: 0;
142
-
143
- &:first-child {
144
- border-inline-start-width: var(--jt-pagination-border-width);
145
- border-start-start-radius: var(--jt-pagination-radius);
146
- border-end-start-radius: var(--jt-pagination-radius);
147
- }
148
-
149
- &:last-child {
150
- border-start-end-radius: var(--jt-pagination-radius);
151
- border-end-end-radius: var(--jt-pagination-radius);
152
- }
153
- }
154
127
 
155
- .paginationBtn,
156
- .paginationEllipsis {
157
- display: flex;
158
- align-items: center;
159
- justify-content: center;
160
- min-width: var(--jt-pagination-btn-min-width);
161
- height: 100%;
162
- padding: var(--jt-pagination-btn-padding-block) var(--jt-pagination-btn-padding-inline);
163
- font: inherit;
164
- font-size: var(--jt-pagination-font-size);
165
- line-height: var(--jt-pagination-line-height);
166
- color: inherit;
167
- }
168
-
169
- .paginationBtn {
170
- cursor: pointer;
171
-
172
- &[disabled] {
173
- cursor: default;
174
- opacity: var(--jt-pagination-disabled-opacity);
175
- }
176
-
177
- &[aria-current='page'] {
178
- font-weight: var(--jt-pagination-current-font-weight);
179
- cursor: default;
180
- background-color: var(--jt-pagination-current-background-color);
181
- }
182
-
183
- @media (hover: hover) {
184
- &:hover:not([disabled], [aria-current='page']) {
185
- background-color: var(--jt-pagination-hover-background-color);
186
- }
187
- }
188
128
 
189
- svg {
190
- width: var(--jt-pagination-icon-size);
191
- aspect-ratio: 1;
192
- fill: currentColor;
193
- }
194
- }
195
-
196
- .paginationArrow {
197
- padding-inline: calc(var(--jt-pagination-btn-padding-inline) / 2);
198
- }
199
-
200
- /* =>> sorting (thead) */
201
-
202
- .sortable {
203
- @media (hover: hover) {
204
- &:hover {
205
- background-color: var(--jt-thead-hover-background-color);
206
- }
207
- }
208
- }
209
-
210
- .sortBtn {
211
- display: flex;
212
- gap: var(--jt-sort-icon-gap);
213
- align-items: center;
214
- width: 100%;
215
- height: 100%;
216
- padding: var(--jt-sort-btn-padding-block) var(--jt-sort-btn-padding-inline);
217
- font: inherit;
218
- line-height: var(--jt-sort-btn-line-height);
219
- color: inherit;
220
- text-align: inherit;
221
- cursor: pointer;
222
- }
223
-
224
- .sortTitle {
225
- flex: 1 1 auto;
226
- }
227
-
228
- .sortIcon {
229
- display: inline-flex;
230
- flex: none;
231
- width: var(--jt-sort-icon-size);
232
- aspect-ratio: 1;
233
- opacity: var(--jt-sort-icon-none-opacity);
234
-
235
- svg {
236
- width: 100%;
237
- height: 100%;
238
- fill: currentColor;
239
- }
240
-
241
- /* un ordinamento attivo (aria-sort sul th) mostra l'icona a piena opacità */
242
- [aria-sort] & {
243
- opacity: 1;
244
- }
245
- }
246
129
 
247
130
  /* purgecss end ignore */
@@ -52,65 +52,71 @@ Tutti i parametri sono impostabili sia da attributo HTML che come oggetto in `in
52
52
 
53
53
  ## `classes`
54
54
 
55
- Nomi delle classi assegnate agli elementi generati. Le classi interne di layout (CSS module)
56
- vengono **sempre** applicate in aggiunta a queste; ogni valore sostituisce interamente il
57
- default della stessa chiave.
55
+ Nomi delle classi assegnate agli elementi generati. Le classi interne di layout (CSS module) vengono **sempre** applicate in aggiunta a queste; gli eventuali valori inseriti sostituiscono quelli di default.
58
56
 
59
57
  ```javascript
60
- classes: {
61
- wrapper: null, // contenitore principale (<section>: info + tabella)
62
- infoOuter: null, // contenitore esterno della sezione info
63
- info: null, // sezione info (testo + ricerca)
64
- resultInfo: null, // contenitore del testo info
65
- search: null, // wrapper dell'input di ricerca
66
- searchInput: 'form-control form-control-sm', // input di ricerca
67
- tableWrapper: 'table-responsive', // div che racchiude la tabella
68
- table: 'table table-bordered', // tag <table>
69
- tableFooter: null, // barra sotto la tabella (caption + paginazione)
70
- caption: null, // contenitore della caption
71
- pagination: null, // <nav> della paginazione
72
- paginationBtn: 'btn-reset', // pulsanti della paginazione
73
- sortBtn: 'btn-reset', // pulsanti di ordinamento nei <th>
74
- empty: null, // cella unica mostrata in assenza di righe
75
- textStart: null, // allineamento inline-start (le celle minimo lo sono già)
76
- textCenter: 'text-center', // allineamento al centro
77
- textEnd: 'text-end', // allineamento inline-end
78
- nowrap: 'text-nowrap', // no-wrap
79
- numeric: 'text-numeric', // cifre tabulari (tipi numerici)
80
- boolCell: null, // classe aggiuntiva per tutte le celle di tipo bool
81
- boolTrue: null, // classe aggiuntiva per le celle bool con valore true
82
- boolFalse: null // classe aggiuntiva per le celle bool con valore false
58
+ {
59
+ classes: {...}
83
60
  }
84
61
  ```
85
62
 
63
+ | Parametro | Default | Descrizione |
64
+ |---|---|---|
65
+ | `wrapper` | `null` | contenitore principale (`<section>`: info + tabella) |
66
+ | `infoOuter` | `null` | contenitore esterno della sezione info |
67
+ | `info` | `null` | sezione info (testo + ricerca) |
68
+ | `resultInfo` | `null` | contenitore del testo info |
69
+ | `search` | `null` | wrapper dell'input di ricerca |
70
+ | `searchInput` | `'form-control form-control-sm'` | input di ricerca |
71
+ | `tableWrapper` | `'table-responsive'` | div che racchiude la tabella |
72
+ | `table` | `'table table-bordered'` | tag `<table>` |
73
+ | `tableFooter` | `null` | barra sotto la tabella (caption + paginazione) |
74
+ | `caption` | `null` | contenitore della caption |
75
+ | `pagination` | `null` | `<nav>` della paginazione |
76
+ | `paginationBtn` | `'btn-reset'` | pulsanti della paginazione |
77
+ | `sortBtn` | `'btn-reset'` | pulsanti di ordinamento nei `<th>` |
78
+ | `empty` | `null` | cella unica mostrata in assenza di righe |
79
+ | `textStart` | `null` | allineamento inline-start (con css `table` di *minimo* il default è `start`) |
80
+ | `textCenter` | `'text-center'` | allineamento al centro |
81
+ | `textEnd` | `'text-end'` | allineamento inline-end |
82
+ | `nowrap` | `'text-nowrap'` | no-wrap |
83
+ | `numeric` | `'text-numeric'` | cifre tabulari (tipi numerici) |
84
+ | `boolCell` | `null` | classe aggiuntiva per tutte le celle di tipo bool |
85
+ | `boolTrue` | `null` | classe aggiuntiva per le celle bool con valore true |
86
+ | `boolFalse` | `null` | classe aggiuntiva per le celle bool con valore false |
87
+
88
+
86
89
  Le classi di allineamento (`textEnd`, `textCenter`, `nowrap`, `numeric`) sono quelle usate dai
87
90
  tipi di dato predefiniti: modificandole si cambiano le classi di tutte le colonne di quel tipo.
88
91
 
89
92
  ## `labels`
90
93
 
91
94
  ```javascript
92
- labels: {
93
- loading: 'Caricamento dati…', // segnaposto di caricamento (visually hidden)
94
- searchPlaceholder: 'Cerca...', // placeholder dell'input di ricerca
95
- searchTitle: 'Cerca nella tabella', // attributo title dell'input
96
- searchAriaLabel: 'Filtra risultati', // aria-label dell'input
97
- info: 'Stai visualizzando le righe da {start} a {end}, su un totale di {filteredRec} record trovati',
98
- // template del testo info (vedi `infoText`)
99
- noRows: 'Nessun record trovato', // testo info e cella unica con set di dati vuoto
100
- noResults: 'Nessun risultato per la ricerca', // idem, con ricerca senza risultati
101
- sortAsc: 'Ordina questa colonna in senso ascendente (A → Z)', // title/aria-label del
102
- sortDesc: 'Ordina questa colonna in senso discendente (Z → A)', // pulsante di ordinamento:
103
- sortNone: 'Rimuovi l’ordinamento a questa colonna', // descrivono l'azione del
104
- // prossimo click
105
- paginationAriaLabel: 'Navigazione pagine', // aria-label del <nav>
106
- prevPage: 'Pagina precedente', // title/aria-label del pulsante precedente
107
- nextPage: 'Pagina successiva', // idem, successivo
108
- pageTitle: 'Vai a pagina {page}', // idem, pulsanti pagina
109
- currentPage: 'Pagina {page}, corrente' // idem, pagina corrente
95
+ {
96
+ labels: {...}
110
97
  }
111
98
  ```
112
99
 
113
- I segnaposto di `labels.info` / `infoText`:
100
+ | Parametro | Default | Descrizione |
101
+ |---|---|---|
102
+ | `loading` | `'Caricamento dati…'` | segnaposto di caricamento (visually hidden) |
103
+ | `searchPlaceholder` | `'Cerca...'` | placeholder dell'input di ricerca |
104
+ | `searchTitle` | `'Cerca nella tabella'` | attributo `title` dell'input di ricerca |
105
+ | `searchAriaLabel` | `'Filtra risultati'` | `aria-label` dell'input di ricerca |
106
+ | `info` | `'Stai visualizzando le righe da {start} a {end}, su un totale di {filteredRec} record trovati'` | template del testo info (vedi `infoText`) |
107
+ | `noRows` | `'Nessun record trovato'` | testo info e cella unica con set di dati vuoto |
108
+ | `noResults` | `'Nessun risultato per la ricerca'` | testo info e cella unica con ricerca senza risultati |
109
+ | `sortAsc` | `'Ordina questa colonna in senso ascendente (A → Z)'` | `title`/`aria-label` del pulsante di ordinamento: descrive l'azione del prossimo click |
110
+ | `sortDesc` | `'Ordina questa colonna in senso discendente (Z → A)'` | `title`/`aria-label` del pulsante di ordinamento: descrive l'azione del prossimo click |
111
+ | `sortNone` | `'Rimuovi l’ordinamento a questa colonna'` | `title`/`aria-label` del pulsante di ordinamento: descrive l'azione del prossimo click |
112
+ | `paginationAriaLabel` | `'Navigazione pagine'` | `aria-label` del `<nav>` |
113
+ | `prevPage` | `'Pagina precedente'` | `title`/`aria-label` del pulsante precedente |
114
+ | `nextPage` | `'Pagina successiva'` | `title`/`aria-label` del pulsante successivo |
115
+ | `pageTitle` | `'Vai a pagina {page}'` | `title`/`aria-label` dei pulsanti pagina |
116
+ | `currentPage` | `'Pagina {page}, corrente'` | `title`/`aria-label` del pulsante della pagina corrente |
117
+
118
+
119
+ ### Segnaposto di `labels.info` / `infoText`:
114
120
 
115
121
  | Segnaposto | Valore |
116
122
  |---|---|
@@ -1,5 +1,3 @@
1
- /*! minimo - json-table: cell & footer content */
2
-
3
1
  import { getNestedValue, resolveMustache } from './content-utils.js';
4
2
  import { toNumber } from './data-types.js';
5
3
 
@@ -1,4 +1,3 @@
1
- /*! minimo - json-table: content utilities */
2
1
 
3
2
  import { domBuilder } from '../../../utilities/dom-builder/dom-builder.js';
4
3
 
@@ -1,4 +1,3 @@
1
- /*! minimo - json-table: data types */
2
1
 
3
2
  import * as styles from '../json-table-component.module.css';
4
3
  import { classnames } from '../../../utilities/classnames.js';
@@ -1,4 +1,3 @@
1
- /*! minimo - json-table: defaults */
2
1
 
3
2
  import {
4
3
  boolTrueIcon, boolFalseIcon, sortAscArrowIcon, sortDescArrowIcon, sortNoneArrowIcon,
@@ -1,4 +1,3 @@
1
- /*! minimo - json-table: data acquisition */
2
1
 
3
2
  /** @typedef {import('./defaults.js').JsonTableParams} JsonTableParams */
4
3
  /** @typedef {import('./defaults.js').SortDef} SortDef */
@@ -1,4 +1,3 @@
1
- /*! minimo - json-table: icons */
2
1
 
3
2
  import checkBold from '../../../icons/check-bold.svg?inline';
4
3
  import xBold from '../../../icons/x-bold.svg?inline';
@@ -1,4 +1,3 @@
1
- /*! minimo - json-table: info section parts */
2
1
 
3
2
  import * as styles from '../json-table-component.module.css';
4
3
  import { classnames } from '../../../utilities/classnames.js';
@@ -1,4 +1,3 @@
1
- /*! minimo - json-table: main structure builder */
2
1
 
3
2
  import * as styles from '../json-table-component.module.css';
4
3
  import { domBuilder } from '../../../utilities/dom-builder/dom-builder.js';
@@ -1,6 +1,6 @@
1
- /*! minimo - json-table: pagination */
2
1
 
3
- import * as styles from '../json-table-component.module.css';
2
+ import * as styles from './pagination.module.css';
3
+
4
4
  import { domBuilder } from '../../../utilities/dom-builder/dom-builder.js';
5
5
  import { classnames } from '../../../utilities/classnames.js';
6
6
  import { iconContent } from './icons.js';
@@ -0,0 +1,77 @@
1
+ /* purgecss start ignore */
2
+
3
+ .pagination {
4
+ margin-inline-start: auto;
5
+ }
6
+
7
+ .paginationList {
8
+ display: flex;
9
+ flex-flow: row wrap;
10
+ padding: 0;
11
+ margin: 0;
12
+ list-style: none;
13
+ }
14
+
15
+ .paginationItem {
16
+ margin: 0;
17
+ border: var(--jt-pagination-border-width) solid var(--jt-pagination-border-color);
18
+ border-inline-start-width: 0;
19
+
20
+ &:first-child {
21
+ border-inline-start-width: var(--jt-pagination-border-width);
22
+ border-start-start-radius: var(--jt-pagination-radius);
23
+ border-end-start-radius: var(--jt-pagination-radius);
24
+ }
25
+
26
+ &:last-child {
27
+ border-start-end-radius: var(--jt-pagination-radius);
28
+ border-end-end-radius: var(--jt-pagination-radius);
29
+ }
30
+ }
31
+
32
+ .paginationBtn,
33
+ .paginationEllipsis {
34
+ display: flex;
35
+ align-items: center;
36
+ justify-content: center;
37
+ min-width: var(--jt-pagination-btn-min-width);
38
+ height: 100%;
39
+ padding: var(--jt-pagination-btn-padding-block) var(--jt-pagination-btn-padding-inline);
40
+ font: inherit;
41
+ font-size: var(--jt-pagination-font-size);
42
+ line-height: var(--jt-pagination-line-height);
43
+ color: inherit;
44
+ }
45
+
46
+ .paginationBtn {
47
+ cursor: pointer;
48
+
49
+ &[disabled] {
50
+ cursor: default;
51
+ opacity: var(--jt-pagination-disabled-opacity);
52
+ }
53
+
54
+ &[aria-current='page'] {
55
+ font-weight: var(--jt-pagination-current-font-weight);
56
+ cursor: default;
57
+ background-color: var(--jt-pagination-current-background-color);
58
+ }
59
+
60
+ @media (hover: hover) {
61
+ &:hover:not([disabled], [aria-current='page']) {
62
+ background-color: var(--jt-pagination-hover-background-color);
63
+ }
64
+ }
65
+
66
+ svg {
67
+ width: var(--jt-pagination-icon-size);
68
+ aspect-ratio: 1;
69
+ fill: currentColor;
70
+ }
71
+ }
72
+
73
+ .paginationArrow {
74
+ padding-inline: calc(var(--jt-pagination-btn-padding-inline) / 2);
75
+ }
76
+
77
+ /* purgecss end ignore */
@@ -1,4 +1,3 @@
1
- /*! minimo - json-table: columns parsing */
2
1
 
3
2
  /** @typedef {import('./defaults.js').JsonTableParams} JsonTableParams */
4
3
  /** @typedef {import('./defaults.js').ColDefinition} ColDefinition */
@@ -1,4 +1,3 @@
1
- /*! minimo - json-table: rows parsing (sort & search values) */
2
1
 
3
2
  import { getNestedValue } from './content-utils.js';
4
3
 
@@ -1,4 +1,3 @@
1
- /*! minimo - json-table: params resolution */
2
1
 
3
2
  import { defaults, mergedParams, jqDatatableModeDefaults } from './defaults.js';
4
3
 
@@ -1,4 +1,3 @@
1
- /*! minimo - json-table: client-side search */
2
1
 
3
2
  /** @typedef {import('../json-table-component.js').JsonTable} JsonTable */
4
3
  /** @typedef {import('./parse-rows.js').ParsedRow} ParsedRow */
@@ -1,4 +1,3 @@
1
- /*! minimo - json-table: client-side sorting */
2
1
 
3
2
  /** @typedef {import('./parse-rows.js').ParsedRow} ParsedRow */
4
3
  /** @typedef {'asc'|'desc'} SortDir */
@@ -1,4 +1,3 @@
1
- /*! minimo - json-table: tbody rendering */
2
1
 
3
2
  import * as styles from '../json-table-component.module.css';
4
3
  import { domBuilder } from '../../../utilities/dom-builder/dom-builder.js';
@@ -1,8 +1,7 @@
1
- /*! minimo - json-table: parte tabella (tabella, caption e barra del footer) */
2
1
 
3
2
  import * as styles from '../json-table-component.module.css';
4
3
  import { classnames } from '../../../utilities/classnames.js';
5
- import { theadPart } from './table-thead.js';
4
+ import { theadPart } from './thead.js';
6
5
 
7
6
  /** @typedef {import('./defaults.js').JsonTableParams} JsonTableParams */
8
7
  /** @typedef {import('../json-table-component.js').JsonTable} JsonTable */
@@ -1,4 +1,3 @@
1
- /*! minimo - json-table: tfoot rendering */
2
1
 
3
2
  import { domBuilder } from '../../../utilities/dom-builder/dom-builder.js';
4
3
  import { classnames } from '../../../utilities/classnames.js';
@@ -1,6 +1,5 @@
1
- /*! minimo - json-table: thead */
1
+ import * as styles from './thead.module.css';
2
2
 
3
- import * as styles from '../json-table-component.module.css';
4
3
  import { classnames } from '../../../utilities/classnames.js';
5
4
  import { setContent } from './content-utils.js';
6
5
  import { iconContent } from './icons.js';
@@ -117,7 +116,7 @@ export function setSortListener(jt) {
117
116
 
118
117
 
119
118
  /**
120
- * Elemento domBuilder del `<thead>`.
119
+ * Elemento domBuilder per `<thead>`.
121
120
  *
122
121
  * Generated structure:
123
122
  * ```
@@ -0,0 +1,47 @@
1
+ /* purgecss start ignore */
2
+ .sortable {
3
+ @media (hover: hover) {
4
+ &:hover {
5
+ background-color: var(--jt-thead-hover-background-color);
6
+ }
7
+ }
8
+ }
9
+
10
+ .sortBtn {
11
+ display: flex;
12
+ gap: var(--jt-sort-icon-gap);
13
+ align-items: center;
14
+ width: 100%;
15
+ height: 100%;
16
+ padding: var(--jt-sort-btn-padding-block) var(--jt-sort-btn-padding-inline);
17
+ font: inherit;
18
+ line-height: var(--jt-sort-btn-line-height);
19
+ color: inherit;
20
+ text-align: inherit;
21
+ cursor: pointer;
22
+ }
23
+
24
+ .sortTitle {
25
+ flex: 1 1 auto;
26
+ }
27
+
28
+ .sortIcon {
29
+ display: inline-flex;
30
+ flex: none;
31
+ width: var(--jt-sort-icon-size);
32
+ aspect-ratio: 1;
33
+ opacity: var(--jt-sort-icon-none-opacity);
34
+
35
+ svg {
36
+ width: 100%;
37
+ height: 100%;
38
+ fill: currentColor;
39
+ }
40
+
41
+ /* un ordinamento attivo (aria-sort sul th) mostra l'icona a piena opacità */
42
+ [aria-sort] & {
43
+ opacity: 1;
44
+ }
45
+ }
46
+
47
+ /* purgecss end ignore */
@@ -1,4 +1,3 @@
1
- /*! minimo - json-table: info text update */
2
1
 
3
2
  import { setContent } from './content-utils.js';
4
3