@massimo-cassandro/minimo 1.41.3 → 1.41.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.
- package/README.md +12 -12
- package/charts/src/node-helpers/create-svg-canvas-node.mjs +2 -2
- package/charts/src/node-helpers/svg-text-to-path.js +9 -9
- package/charts/src/rating-display/index.js +1 -1
- package/charts/src/rating-display/ratindDisplayAnimation.js +3 -3
- package/design-tokens/README.md +2 -2
- package/design-tokens/_src/_readme.md +26 -26
- package/dev-tools/README.md +16 -16
- package/dev-tools/create-favicons/README.md +31 -31
- package/dev-tools/create-favicons/src/create-ico.mjs +2 -2
- package/dev-tools/create-favicons/src/default-params.mjs +1 -1
- package/dev-tools/create-favicons/src/init.mjs +1 -1
- package/dev-tools/design-tokens-builder/README.md +102 -102
- package/dev-tools/design-tokens-builder/build-tokens-src/build-source-modes.mjs +85 -73
- package/dev-tools/design-tokens-builder/build-tokens-src/config.mjs +109 -85
- package/dev-tools/design-tokens-builder/build-tokens-src/formats/css.mjs +113 -90
- package/dev-tools/design-tokens-builder/build-tokens-src/formats/json.mjs +107 -95
- package/dev-tools/design-tokens-builder/build-tokens-src/legacy-tokens-parser.mjs +71 -64
- package/dev-tools/design-tokens-builder/build-tokens-src/light-dark.mjs +75 -65
- package/dev-tools/design-tokens-builder/build-tokens-src/merge-css.mjs +113 -102
- package/dev-tools/design-tokens-builder/build-tokens-src/platforms.mjs +36 -30
- package/dev-tools/design-tokens-builder/build-tokens-src/resolve-source-paths.mjs +15 -13
- package/dev-tools/design-tokens-builder/build-tokens-src/source-prefixes.mjs +44 -42
- package/dev-tools/design-tokens-builder/build-tokens-src/source-transforms.mjs +89 -83
- package/dev-tools/design-tokens-builder/build-tokens-src/token-rename-parser.mjs +99 -86
- package/dev-tools/design-tokens-builder/build-tokens-src/transforms.mjs +64 -48
- package/dev-tools/design-tokens-builder/build-tokens.mjs +80 -68
- package/dev-tools/design-tokens-builder/check-unresolved-custom-props.mjs +103 -77
- package/dev-tools/design-tokens-builder/tokens-config-sample.mjs +275 -238
- package/dev-tools/find-orphan-css-classes/find-orphan-css-classes.mjs +2 -2
- package/dev-tools/starter-kit/source_files/app/CLAUDE.md +4 -2
- package/dev-tools/starter-kit/source_files/app/index.css +10 -0
- package/dev-tools/starter-kit/source_files/app/index.js +1 -1
- package/dev-tools/starter-kit/source_files/root/_sf/controller/ImgViewerController.php +3 -3
- package/dev-tools/starter-kit/source_files/root/_sf/controller/ViewerController.php +2 -2
- package/dev-tools/starter-kit/source_files/root/stylelint.config.mjs +1 -1
- package/dev-tools/starter-kit/source_files/root/webpack-config-modules/css-rules.mjs +1 -1
- package/dev-tools/starter-kit/starter-install.sh +2 -2
- package/dev-tools/stylelint-config/README.md +7 -7
- package/dev-tools/svg-icons-tools/README.md +32 -32
- package/dev-tools/svg-icons-tools/src/config-manager.mjs +1 -1
- package/dev-tools/svg-icons-tools/src/default-config.mjs +118 -118
- package/dev-tools/svg-icons-tools/src/jsx-icon-file-builder.mjs +24 -24
- package/dev-tools/svg-icons-tools/src/parse-svg-filename.mjs +3 -3
- package/dev-tools/svg-icons-tools/src/parse-svg-files.mjs +1 -1
- package/dev-tools/svg-icons-tools/src/parse-svg-markup.mjs +4 -4
- package/dev-tools/svg-icons-tools/src/svg-to-jsx.mjs +2 -2
- package/dev-tools/svg-icons-tools/src/svg-to-optimized.mjs +2 -2
- package/dev-tools/svg-icons-tools/src/svg-to-symbols.mjs +2 -2
- package/dev-tools/upd@m/README.md +1 -1
- package/dev-tools/upd@m/index.mjs +1 -1
- package/dev-tools/update-version/README.md +9 -9
- package/index.js +1 -0
- package/package.json +3 -1
- package/snippets/unsplash-browser-app/README.md +1 -1
- package/snippets/unsplash-browser-app/unsplash-utilities.js +9 -9
- package/src/components/autocomplete/README.md +3 -3
- package/src/components/autocomplete/autocomplete-engine.js +75 -63
- package/src/components/autocomplete/check-autocomplete.js +3 -3
- package/src/components/dismiss-alerts.js +3 -3
- package/src/components/form-reset-submit.js +6 -6
- package/src/components/inner-nav/inner-nav.js +2 -2
- package/src/components/modal-alert/modal-alert.js +67 -65
- package/src/components/modal-alert/modal-alert.minimo.tokens.mjs +1 -1
- package/src/components/modal-popup/modal-popup.js +56 -56
- package/src/components/overlay/overlay.js +3 -3
- package/src/components/sf-macro/readme.md +1 -1
- package/src/components/sf-macro/sf-macro.js +27 -23
- package/src/components/slide-up-down-toggle/slide-up-down-toggle.js +83 -79
- package/src/components/slide-up-down-toggle/slide-up-down-toggle.module.css +44 -44
- package/src/components/snackbar/snackbar.js +19 -19
- package/src/components/spinner/spinner.js +3 -3
- package/src/components/unsplash-page/README.md +8 -8
- package/src/components/unsplash-page/fetch-unsplash-data.js +3 -3
- package/src/components/unsplash-page/unsplash-page.js +33 -33
- package/src/components/unsplash-page/unsplash-page.module.css +1 -1
- package/src/css/alerts.css +2 -2
- package/src/css/forms/forms.css +4 -4
- package/src/css/forms/validation.css +1 -1
- package/src/css/margin-padding-media.css +4 -4
- package/src/css/margin-padding.css +4 -4
- package/src/css/reset.css +11 -11
- package/src/icons/read-me.md +1 -1
- package/src/minimo.css +3 -9
- package/src/utilities/better-text-with-places.js +105 -105
- package/src/utilities/better-text.js +42 -35
- package/src/utilities/classnames.js +8 -8
- package/src/utilities/cookies.js +6 -6
- package/src/utilities/create-id.js +3 -3
- package/src/utilities/disable-btns-on-submit.js +2 -2
- package/src/utilities/dom-builder/dom-builder.js +89 -86
- package/src/utilities/dom-builder/domBuilderBasicSetup.js +9 -9
- package/src/utilities/dom-builder/parseDomString.js +23 -23
- package/src/utilities/dom-builder-helpers/README.md +2 -2
- package/src/utilities/dom-builder-helpers/form-tags.js +100 -100
- package/src/utilities/dom-builder-helpers/picture-tag.js +39 -39
- package/src/utilities/enable-submit-btns.js +1 -1
- package/src/utilities/escape-html.js +2 -2
- package/src/utilities/generate-pwd.js +4 -4
- package/src/utilities/linked-dates.js +13 -13
- package/src/utilities/parse-file-size.js +6 -6
- package/src/utilities/random-id.js +3 -3
- package/src/utilities/relative-date.js +40 -40
- package/src/utilities/sentence-case.js +1 -1
- package/src/utilities/strip-tags.js +1 -1
- package/src/utilities/title-case.js +1 -1
- package/src/utilities/truncate-string.js +5 -5
- package/src/utilities/validation-error-class.js +12 -12
- package/src/web-components/json-table/json-table-component.js +123 -121
- package/src/web-components/json-table/json-table-component.module.css +6 -6
- package/src/web-components/json-table/json-table.minimo.tokens.mjs +6 -6
- package/src/web-components/json-table/readme.md +76 -110
- package/src/web-components/json-table/src/cell-content.js +25 -25
- package/src/web-components/json-table/src/content-utils.js +21 -21
- package/src/web-components/json-table/src/data-types.js +32 -32
- package/src/web-components/json-table/src/defaults.js +230 -191
- package/src/web-components/json-table/src/get-data.js +55 -38
- package/src/web-components/json-table/src/icons.js +17 -17
- package/src/web-components/json-table/src/info-section.js +18 -18
- package/src/web-components/json-table/src/main-builder.js +45 -45
- package/src/web-components/json-table/src/pagination.js +32 -32
- package/src/web-components/json-table/src/parse-cols.js +18 -18
- package/src/web-components/json-table/src/parse-rows.js +17 -17
- package/src/web-components/json-table/src/resolve-params.js +53 -41
- package/src/web-components/json-table/src/search.js +13 -13
- package/src/web-components/json-table/src/sorting.js +20 -20
- package/src/web-components/json-table/src/table-body.js +13 -13
- package/src/web-components/json-table/src/table-builder.js +34 -34
- package/src/web-components/json-table/src/table-tfoot.js +8 -8
- package/src/web-components/json-table/src/table-thead.js +21 -21
- package/src/web-components/json-table/src/update-info.js +11 -11
- package/types/classes.d.ts +2 -2
- package/types/global.d.ts +18 -12
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! minimo - json-table:
|
|
1
|
+
/*! minimo - json-table: parte tabella (tabella, caption e barra del footer) */
|
|
2
2
|
|
|
3
3
|
import * as styles from '../json-table-component.module.css';
|
|
4
4
|
import { classnames } from '../../../utilities/classnames.js';
|
|
@@ -8,14 +8,14 @@ import { theadPart } from './table-thead.js';
|
|
|
8
8
|
/** @typedef {import('../json-table-component.js').JsonTable} JsonTable */
|
|
9
9
|
/** @typedef {import('./main-builder.js').JsonTableElements} JsonTableElements */
|
|
10
10
|
|
|
11
|
-
/**
|
|
11
|
+
/** Contatore usato per generare id univoci delle caption */
|
|
12
12
|
let captionUid = 0;
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* Id
|
|
16
|
-
*
|
|
15
|
+
* Id dell'elemento caption di una tabella (usato da `aria-labelledby`): `<tableId>-caption`, oppure un
|
|
16
|
+
* id univoco generato quando `tableId` non è impostato.
|
|
17
17
|
*
|
|
18
|
-
* @param {JsonTableParams} params -
|
|
18
|
+
* @param {JsonTableParams} params - Parametri risolti
|
|
19
19
|
* @returns {string}
|
|
20
20
|
*
|
|
21
21
|
* @example
|
|
@@ -28,21 +28,21 @@ export function captionId(params) {
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
* domBuilder
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
31
|
+
* Elemento domBuilder della caption (slot del template `caption`), renderizzato solo quando `params.caption`
|
|
32
|
+
* è impostato. È un semplice contenitore collocato sotto la tabella (barra del footer) invece di un elemento
|
|
33
|
+
* `<caption>`: la tabella è collegata a esso tramite `aria-labelledby`, che dà alla tabella lo stesso
|
|
34
|
+
* nome accessibile che avrebbe con un `<caption>`.
|
|
35
35
|
*
|
|
36
|
-
*
|
|
36
|
+
* Struttura generata: `div.caption[classes.caption]#<id>`; l'elemento viene memorizzato in `elements.caption`.
|
|
37
37
|
*
|
|
38
|
-
* @param {JsonTable} jt -
|
|
39
|
-
* @param {JsonTableElements} elements -
|
|
40
|
-
* @param {string} id - Id
|
|
38
|
+
* @param {JsonTable} jt - L'istanza del componente
|
|
39
|
+
* @param {JsonTableElements} elements - Oggetto che raccoglie gli elementi generati (modificato)
|
|
40
|
+
* @param {string} id - Id dell'elemento (vedi `captionId`)
|
|
41
41
|
* @returns {DomBuilderItem}
|
|
42
42
|
*
|
|
43
43
|
* @example
|
|
44
44
|
* domBuilder([captionPart(jt, elements, 'users-caption')], host);
|
|
45
|
-
* elements.caption; // → HTMLElement (
|
|
45
|
+
* elements.caption; // → HTMLElement (quando params.caption è impostato)
|
|
46
46
|
*/
|
|
47
47
|
export function captionPart(jt, elements, id) {
|
|
48
48
|
|
|
@@ -59,16 +59,16 @@ export function captionPart(jt, elements, id) {
|
|
|
59
59
|
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
|
-
* domBuilder
|
|
63
|
-
*
|
|
64
|
-
*
|
|
62
|
+
* Elemento domBuilder della barra del footer sotto la tabella: caption (lato iniziale) e paginazione (lato
|
|
63
|
+
* finale). Renderizzato solo quando `children` non è vuoto (vedi `mainBuilder`, che rimuove le parti
|
|
64
|
+
* collocate altrove dal template).
|
|
65
65
|
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
66
|
+
* Struttura generata: `div.tableFooter[classes.tableFooter] > [caption] [pagination]`; l'elemento
|
|
67
|
+
* viene memorizzato in `elements.tableFooter`.
|
|
68
68
|
*
|
|
69
|
-
* @param {JsonTable} jt -
|
|
70
|
-
* @param {JsonTableElements} elements -
|
|
71
|
-
* @param {DomBuilderItem[]} children -
|
|
69
|
+
* @param {JsonTable} jt - L'istanza del componente
|
|
70
|
+
* @param {JsonTableElements} elements - Oggetto che raccoglie gli elementi generati (modificato)
|
|
71
|
+
* @param {DomBuilderItem[]} children - Parti del footer (elementi caption e/o paginazione)
|
|
72
72
|
* @returns {DomBuilderItem}
|
|
73
73
|
*
|
|
74
74
|
* @example
|
|
@@ -89,30 +89,30 @@ export function tableFooterPart(jt, elements, children) {
|
|
|
89
89
|
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
|
-
* domBuilder
|
|
92
|
+
* Elemento domBuilder della tabella (slot del template `table`).
|
|
93
93
|
*
|
|
94
94
|
* Generated structure:
|
|
95
95
|
* ```
|
|
96
96
|
* div.tableWrapper[classes.tableWrapper]
|
|
97
|
-
* table#tableId.table[classes.table][aria-labelledby=<caption id>] (aria-labelledby
|
|
97
|
+
* table#tableId.table[classes.table][aria-labelledby=<caption id>] (aria-labelledby se `caption`)
|
|
98
98
|
* thead ← theadPart()
|
|
99
|
-
* tbody ←
|
|
100
|
-
* tfoot (
|
|
101
|
-
* div.tableFooter ← footerBar (caption +
|
|
99
|
+
* tbody ← riempito da `renderTbody()`
|
|
100
|
+
* tfoot (se `tfoot`) ← riempito da `renderTfoot()`
|
|
101
|
+
* div.tableFooter ← footerBar (caption + paginazione), se indicata
|
|
102
102
|
* ```
|
|
103
103
|
*
|
|
104
|
-
*
|
|
104
|
+
* I riferimenti agli elementi generati vengono memorizzati in `elements`
|
|
105
105
|
* (`tableWrapper`, `table`, `thead`, `tbody`, `tfoot`).
|
|
106
106
|
*
|
|
107
|
-
* @param {JsonTable} jt -
|
|
108
|
-
* @param {JsonTableElements} elements -
|
|
109
|
-
* @param {DomBuilderItem|null} [footerBar=null] -
|
|
110
|
-
* @param {string|null} [captionElId=null] - Id
|
|
111
|
-
* @returns {DomBuilderItem}
|
|
107
|
+
* @param {JsonTable} jt - L'istanza del componente (`params`, `cols`)
|
|
108
|
+
* @param {JsonTableElements} elements - Oggetto che raccoglie gli elementi generati (modificato)
|
|
109
|
+
* @param {DomBuilderItem|null} [footerBar=null] - Elemento della barra del footer (vedi `tableFooterPart`) (default: null)
|
|
110
|
+
* @param {string|null} [captionElId=null] - Id dell'elemento caption, per `aria-labelledby` (default: null)
|
|
111
|
+
* @returns {DomBuilderItem} Un `div` che racchiude il wrapper della tabella e la barra del footer
|
|
112
112
|
*
|
|
113
113
|
* @example
|
|
114
114
|
* domBuilder([tablePart(jt, elements, footerBar, 'users-caption')], host);
|
|
115
|
-
* elements.tbody; // → HTMLTableSectionElement (
|
|
115
|
+
* elements.tbody; // → HTMLTableSectionElement (vuoto finché non viene chiamato renderTbody())
|
|
116
116
|
*/
|
|
117
117
|
export function tablePart(jt, elements, footerBar = null, captionElId = null) {
|
|
118
118
|
|
|
@@ -8,20 +8,20 @@ import { tfootContent } from './cell-content.js';
|
|
|
8
8
|
/** @typedef {import('../json-table-component.js').JsonTable} JsonTable */
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* `tfootContent()` (
|
|
11
|
+
* Renderizza la riga del footer dentro `elements.tfoot` (presente solo quando `params.tfoot` è true),
|
|
12
|
+
* sostituendo il contenuto precedente. Ogni colonna produce una cella il cui contenuto proviene da
|
|
13
|
+
* `tfootContent()` (`tfootRender` della colonna); il footer viene svuotato quando non ci sono righe.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
* `updateFooterOnPageChange`
|
|
15
|
+
* Le righe passate a `tfootRender` sono l'intero insieme filtrato, oppure solo la pagina corrente quando
|
|
16
|
+
* `updateFooterOnPageChange` è true.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
18
|
+
* Struttura generata: `tr > td[data-key][cellClass]…`
|
|
19
19
|
*
|
|
20
|
-
* @param {JsonTable} jt -
|
|
20
|
+
* @param {JsonTable} jt - L'istanza del componente
|
|
21
21
|
* @returns {void}
|
|
22
22
|
*
|
|
23
23
|
* @example
|
|
24
|
-
* renderTfoot(jt); //
|
|
24
|
+
* renderTfoot(jt); // dopo l'aggiornamento di `jt.state`
|
|
25
25
|
*/
|
|
26
26
|
export function renderTfoot(jt) {
|
|
27
27
|
|
|
@@ -13,13 +13,13 @@ import { nextSortDir } from './sorting.js';
|
|
|
13
13
|
/** @typedef {'none'|'ascending'|'descending'} SortState */
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* click,
|
|
16
|
+
* Aggiorna lo stato di ordinamento di un `<th>` ordinabile: attributo `aria-sort` (rimosso quando `none`),
|
|
17
|
+
* icona e `title`/`aria-label` del pulsante di ordinamento (entrambi descrivono l'azione del prossimo
|
|
18
|
+
* click, ad es. "ordina in modo decrescente" quando è attivo l'ordinamento crescente).
|
|
19
19
|
*
|
|
20
|
-
* @param {HTMLTableCellElement} th -
|
|
21
|
-
* @param {SortState} state -
|
|
22
|
-
* @param {JsonTableParams} params -
|
|
20
|
+
* @param {HTMLTableCellElement} th - Il `<th>` generato da `theadPart()`
|
|
21
|
+
* @param {SortState} state - Stato di ordinamento da applicare
|
|
22
|
+
* @param {JsonTableParams} params - Parametri risolti (icone e label)
|
|
23
23
|
* @returns {void}
|
|
24
24
|
*
|
|
25
25
|
* @example
|
|
@@ -57,15 +57,15 @@ export function setSortState(th, state, params) {
|
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
60
|
+
* Applica l'ordinamento corrente (`jt.state.sort`) a ogni `<th>` ordinabile del thead: la colonna
|
|
61
|
+
* ordinata riceve `aria-sort` e l'icona corrispondente, le altre vengono riportate a `none`.
|
|
62
62
|
*
|
|
63
|
-
* @param {JsonTable} jt -
|
|
63
|
+
* @param {JsonTable} jt - L'istanza del componente
|
|
64
64
|
* @returns {void}
|
|
65
65
|
*
|
|
66
66
|
* @example
|
|
67
67
|
* jt.state.sort = { key: 'name', dir: 'desc' };
|
|
68
|
-
* applySortState(jt); // th[data-key=name][aria-sort=descending],
|
|
68
|
+
* applySortState(jt); // th[data-key=name][aria-sort=descending], gli altri th senza aria-sort
|
|
69
69
|
*/
|
|
70
70
|
export function applySortState(jt) {
|
|
71
71
|
|
|
@@ -84,11 +84,11 @@ export function applySortState(jt) {
|
|
|
84
84
|
|
|
85
85
|
|
|
86
86
|
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
87
|
+
* Collega il listener `click` delegato al thead: un click su un pulsante di ordinamento fa scorrere
|
|
88
|
+
* l'ordinamento della colonna (nessuno → asc → desc → nessuno, vedi `nextSortDir`) tramite `jt.setSort()`.
|
|
89
|
+
* Il thead non viene ricostruito all'ordinamento, quindi il focus resta sul pulsante cliccato.
|
|
90
90
|
*
|
|
91
|
-
* @param {JsonTable} jt -
|
|
91
|
+
* @param {JsonTable} jt - L'istanza del componente
|
|
92
92
|
* @returns {void}
|
|
93
93
|
*
|
|
94
94
|
* @example
|
|
@@ -117,22 +117,22 @@ export function setSortListener(jt) {
|
|
|
117
117
|
|
|
118
118
|
|
|
119
119
|
/**
|
|
120
|
-
* domBuilder
|
|
120
|
+
* Elemento domBuilder del `<thead>`.
|
|
121
121
|
*
|
|
122
122
|
* Generated structure:
|
|
123
123
|
* ```
|
|
124
124
|
* thead > tr
|
|
125
|
-
* th[scope=col][data-key][headerClass] ←
|
|
126
|
-
* th.sortable[scope=col][data-key][data-sortable=true][headerClass] ←
|
|
125
|
+
* th[scope=col][data-key][headerClass] ← non ordinabile: contenuto = col.title
|
|
126
|
+
* th.sortable[scope=col][data-key][data-sortable=true][headerClass] ← ordinabile
|
|
127
127
|
* button.sortBtn[classes.sortBtn][type=button][data-key][title][aria-label]
|
|
128
128
|
* span.sortTitle[data-jt-sort-title] ← col.title
|
|
129
|
-
* span.sortIcon[data-jt-sort-icon] ←
|
|
129
|
+
* span.sortIcon[data-jt-sort-icon] ← icona di ordinamento (vedi `setSortState`)
|
|
130
130
|
* ```
|
|
131
131
|
*
|
|
132
|
-
*
|
|
132
|
+
* Il `<thead>` viene memorizzato in `elements.thead`; il listener di ordinamento è collegato da `setSortListener()`.
|
|
133
133
|
*
|
|
134
|
-
* @param {JsonTable} jt -
|
|
135
|
-
* @param {JsonTableElements} elements -
|
|
134
|
+
* @param {JsonTable} jt - L'istanza del componente (`params`, `cols`)
|
|
135
|
+
* @param {JsonTableElements} elements - Oggetto che raccoglie gli elementi generati (modificato)
|
|
136
136
|
* @returns {DomBuilderItem}
|
|
137
137
|
*
|
|
138
138
|
* @example
|
|
@@ -5,24 +5,24 @@ import { setContent } from './content-utils.js';
|
|
|
5
5
|
/** @typedef {import('../json-table-component.js').JsonTable} JsonTable */
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Aggiorna il testo informativo (`elements.resultInfo`) a partire dallo stato corrente.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
* - `params.infoText`
|
|
12
|
-
* -
|
|
13
|
-
* -
|
|
14
|
-
*
|
|
15
|
-
*
|
|
10
|
+
* Risoluzione del contenuto:
|
|
11
|
+
* - funzione `params.infoText` → `infoText(start, end, totRec, filteredRec, page, totPages)`
|
|
12
|
+
* - nessuna riga → `labels.noResults` (ricerca attiva) oppure `labels.noRows`
|
|
13
|
+
* - altrimenti il template in stile mustache `params.infoText` (stringa) o `labels.info`, con i
|
|
14
|
+
* segnaposto `{start}`, `{end}`, `{totRec}`, `{filteredRec}`, `{page}`, `{totPages}` sostituiti
|
|
15
|
+
* dai numeri formattati secondo il locale
|
|
16
16
|
*
|
|
17
|
-
* `start`/`end`
|
|
18
|
-
*
|
|
17
|
+
* `start`/`end` sono gli indici (da 1) della prima/ultima riga della pagina corrente all'interno
|
|
18
|
+
* dell'insieme filtrato (0 quando non ci sono righe).
|
|
19
19
|
*
|
|
20
|
-
* @param {JsonTable} jt -
|
|
20
|
+
* @param {JsonTable} jt - L'istanza del componente
|
|
21
21
|
* @returns {void}
|
|
22
22
|
*
|
|
23
23
|
* @example
|
|
24
24
|
* updateInfo(jt);
|
|
25
|
-
* //
|
|
25
|
+
* // `labels.info` di default, pagina 2 con 25 righe per pagina, 60 righe → "Stai visualizzando le righe da 26 a 50, su un totale di 60 record trovati"
|
|
26
26
|
*/
|
|
27
27
|
export function updateInfo(jt) {
|
|
28
28
|
|
package/types/classes.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
1
|
+
// File generato automaticamente, non modificare a mano.
|
|
2
|
+
// Eseguire `npm run generate:types` per rigenerarlo.
|
|
3
3
|
|
|
4
4
|
export type MinimoClass =
|
|
5
5
|
| 'ac-autocomplete-wrapper'
|
package/types/global.d.ts
CHANGED
|
@@ -1,23 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/*
|
|
2
|
+
Alias globale del tipo dell'oggetto di configurazione di domBuilder, così che il JSDoc in tutto il codice possa
|
|
3
|
+
referenziare direttamente `DomBuilderItem` invece di ripetere una type query `import(...)`.
|
|
4
|
+
La definizione canonica si trova in dom-builder.js — qui viene solo riesportata.
|
|
5
|
+
*/
|
|
4
6
|
type DomBuilderItem = import('../src/utilities/dom-builder/dom-builder.js').DomBuilderItem;
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
/*
|
|
9
|
+
Alias globale della classe del web component `<json-table>`, così che gli script dei consumer possano scrivere
|
|
10
|
+
un'annotazione JSDoc `@type {JsonTable}` senza importare il tipo. L'augmentation della tag name map fa sì che
|
|
11
|
+
`document.querySelector('json-table')` / `document.createElement('json-table')` restituiscano un'istanza
|
|
12
|
+
`JsonTable` senza cast. I consumer ottengono entrambi aggiungendo questo file all'`include` del proprio
|
|
13
|
+
jsconfig/tsconfig (es. "node_modules/@massimo-cassandro/minimo/types/global.d.ts").
|
|
14
|
+
*/
|
|
11
15
|
type JsonTable = import('../src/web-components/json-table/json-table-component.js').JsonTable;
|
|
12
16
|
|
|
13
17
|
interface HTMLElementTagNameMap {
|
|
14
18
|
'json-table': JsonTable;
|
|
15
19
|
}
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
/*
|
|
22
|
+
Sanitizer API (Element.setHTML / getHTML). Dichiarate come membri obbligatori (non opzionali) così che
|
|
23
|
+
l'augmentation resti compatibile con le versioni di lib.dom che già le includono
|
|
24
|
+
(le firme in overload devono essere tutte opzionali o tutte obbligatorie); il codice a runtime controlla comunque
|
|
25
|
+
`typeof el.setHTML === 'function'` prima di usarle.
|
|
26
|
+
*/
|
|
21
27
|
// https://developer.mozilla.org/en-US/docs/Web/API/Element/setHTML
|
|
22
28
|
interface Element {
|
|
23
29
|
setHTML(input: string, options?: { sanitizer?: unknown }): void;
|