@massimo-cassandro/minimo 1.41.4 → 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.
Files changed (131) hide show
  1. package/README.md +12 -12
  2. package/charts/src/node-helpers/create-svg-canvas-node.mjs +2 -2
  3. package/charts/src/node-helpers/svg-text-to-path.js +9 -9
  4. package/charts/src/rating-display/index.js +1 -1
  5. package/charts/src/rating-display/ratindDisplayAnimation.js +3 -3
  6. package/design-tokens/README.md +2 -2
  7. package/design-tokens/_src/_readme.md +26 -26
  8. package/dev-tools/README.md +16 -16
  9. package/dev-tools/create-favicons/README.md +31 -31
  10. package/dev-tools/create-favicons/src/create-ico.mjs +2 -2
  11. package/dev-tools/create-favicons/src/default-params.mjs +1 -1
  12. package/dev-tools/create-favicons/src/init.mjs +1 -1
  13. package/dev-tools/design-tokens-builder/README.md +102 -102
  14. package/dev-tools/design-tokens-builder/build-tokens-src/build-source-modes.mjs +85 -73
  15. package/dev-tools/design-tokens-builder/build-tokens-src/config.mjs +109 -85
  16. package/dev-tools/design-tokens-builder/build-tokens-src/formats/css.mjs +113 -90
  17. package/dev-tools/design-tokens-builder/build-tokens-src/formats/json.mjs +107 -95
  18. package/dev-tools/design-tokens-builder/build-tokens-src/legacy-tokens-parser.mjs +71 -64
  19. package/dev-tools/design-tokens-builder/build-tokens-src/light-dark.mjs +75 -65
  20. package/dev-tools/design-tokens-builder/build-tokens-src/merge-css.mjs +113 -102
  21. package/dev-tools/design-tokens-builder/build-tokens-src/platforms.mjs +36 -30
  22. package/dev-tools/design-tokens-builder/build-tokens-src/resolve-source-paths.mjs +15 -13
  23. package/dev-tools/design-tokens-builder/build-tokens-src/source-prefixes.mjs +44 -42
  24. package/dev-tools/design-tokens-builder/build-tokens-src/source-transforms.mjs +89 -83
  25. package/dev-tools/design-tokens-builder/build-tokens-src/token-rename-parser.mjs +99 -86
  26. package/dev-tools/design-tokens-builder/build-tokens-src/transforms.mjs +64 -48
  27. package/dev-tools/design-tokens-builder/build-tokens.mjs +80 -68
  28. package/dev-tools/design-tokens-builder/check-unresolved-custom-props.mjs +103 -77
  29. package/dev-tools/design-tokens-builder/tokens-config-sample.mjs +275 -238
  30. package/dev-tools/find-orphan-css-classes/find-orphan-css-classes.mjs +2 -2
  31. package/dev-tools/starter-kit/source_files/app/CLAUDE.md +4 -2
  32. package/dev-tools/starter-kit/source_files/app/{css/index.css → index.css} +2 -2
  33. package/dev-tools/starter-kit/source_files/app/index.js +1 -1
  34. package/dev-tools/starter-kit/source_files/root/_sf/controller/ImgViewerController.php +3 -3
  35. package/dev-tools/starter-kit/source_files/root/_sf/controller/ViewerController.php +2 -2
  36. package/dev-tools/starter-kit/source_files/root/stylelint.config.mjs +1 -1
  37. package/dev-tools/starter-kit/source_files/root/webpack-config-modules/css-rules.mjs +1 -1
  38. package/dev-tools/stylelint-config/README.md +7 -7
  39. package/dev-tools/svg-icons-tools/README.md +32 -32
  40. package/dev-tools/svg-icons-tools/src/config-manager.mjs +1 -1
  41. package/dev-tools/svg-icons-tools/src/default-config.mjs +118 -118
  42. package/dev-tools/svg-icons-tools/src/jsx-icon-file-builder.mjs +24 -24
  43. package/dev-tools/svg-icons-tools/src/parse-svg-filename.mjs +3 -3
  44. package/dev-tools/svg-icons-tools/src/parse-svg-files.mjs +1 -1
  45. package/dev-tools/svg-icons-tools/src/parse-svg-markup.mjs +4 -4
  46. package/dev-tools/svg-icons-tools/src/svg-to-jsx.mjs +2 -2
  47. package/dev-tools/svg-icons-tools/src/svg-to-optimized.mjs +2 -2
  48. package/dev-tools/svg-icons-tools/src/svg-to-symbols.mjs +2 -2
  49. package/dev-tools/upd@m/README.md +1 -1
  50. package/dev-tools/upd@m/index.mjs +1 -1
  51. package/dev-tools/update-version/README.md +9 -9
  52. package/package.json +1 -1
  53. package/snippets/unsplash-browser-app/README.md +1 -1
  54. package/snippets/unsplash-browser-app/unsplash-utilities.js +9 -9
  55. package/src/components/autocomplete/README.md +3 -3
  56. package/src/components/autocomplete/autocomplete-engine.js +75 -63
  57. package/src/components/autocomplete/check-autocomplete.js +3 -3
  58. package/src/components/dismiss-alerts.js +3 -3
  59. package/src/components/form-reset-submit.js +6 -6
  60. package/src/components/inner-nav/inner-nav.js +2 -2
  61. package/src/components/modal-alert/modal-alert.js +67 -65
  62. package/src/components/modal-alert/modal-alert.minimo.tokens.mjs +1 -1
  63. package/src/components/modal-popup/modal-popup.js +56 -56
  64. package/src/components/overlay/overlay.js +3 -3
  65. package/src/components/sf-macro/readme.md +1 -1
  66. package/src/components/sf-macro/sf-macro.js +27 -23
  67. package/src/components/slide-up-down-toggle/slide-up-down-toggle.js +83 -79
  68. package/src/components/slide-up-down-toggle/slide-up-down-toggle.module.css +44 -44
  69. package/src/components/snackbar/snackbar.js +19 -19
  70. package/src/components/spinner/spinner.js +3 -3
  71. package/src/components/unsplash-page/README.md +8 -8
  72. package/src/components/unsplash-page/fetch-unsplash-data.js +3 -3
  73. package/src/components/unsplash-page/unsplash-page.js +33 -33
  74. package/src/components/unsplash-page/unsplash-page.module.css +1 -1
  75. package/src/css/alerts.css +2 -2
  76. package/src/css/forms/forms.css +4 -4
  77. package/src/css/forms/validation.css +1 -1
  78. package/src/css/margin-padding-media.css +4 -4
  79. package/src/css/margin-padding.css +4 -4
  80. package/src/css/reset.css +11 -11
  81. package/src/icons/read-me.md +1 -1
  82. package/src/minimo.css +3 -3
  83. package/src/utilities/better-text-with-places.js +22 -22
  84. package/src/utilities/better-text.js +42 -35
  85. package/src/utilities/classnames.js +8 -8
  86. package/src/utilities/cookies.js +6 -6
  87. package/src/utilities/create-id.js +3 -3
  88. package/src/utilities/disable-btns-on-submit.js +2 -2
  89. package/src/utilities/dom-builder/dom-builder.js +89 -86
  90. package/src/utilities/dom-builder/domBuilderBasicSetup.js +9 -9
  91. package/src/utilities/dom-builder/parseDomString.js +23 -23
  92. package/src/utilities/dom-builder-helpers/README.md +2 -2
  93. package/src/utilities/dom-builder-helpers/form-tags.js +100 -100
  94. package/src/utilities/dom-builder-helpers/picture-tag.js +39 -39
  95. package/src/utilities/enable-submit-btns.js +1 -1
  96. package/src/utilities/escape-html.js +2 -2
  97. package/src/utilities/generate-pwd.js +4 -4
  98. package/src/utilities/linked-dates.js +13 -13
  99. package/src/utilities/parse-file-size.js +6 -6
  100. package/src/utilities/random-id.js +3 -3
  101. package/src/utilities/relative-date.js +40 -40
  102. package/src/utilities/sentence-case.js +1 -1
  103. package/src/utilities/strip-tags.js +1 -1
  104. package/src/utilities/title-case.js +1 -1
  105. package/src/utilities/truncate-string.js +5 -5
  106. package/src/utilities/validation-error-class.js +12 -12
  107. package/src/web-components/json-table/json-table-component.js +123 -121
  108. package/src/web-components/json-table/json-table-component.module.css +6 -6
  109. package/src/web-components/json-table/json-table.minimo.tokens.mjs +6 -6
  110. package/src/web-components/json-table/readme.md +72 -108
  111. package/src/web-components/json-table/src/cell-content.js +25 -25
  112. package/src/web-components/json-table/src/content-utils.js +21 -21
  113. package/src/web-components/json-table/src/data-types.js +32 -32
  114. package/src/web-components/json-table/src/defaults.js +230 -191
  115. package/src/web-components/json-table/src/get-data.js +55 -38
  116. package/src/web-components/json-table/src/icons.js +17 -17
  117. package/src/web-components/json-table/src/info-section.js +18 -18
  118. package/src/web-components/json-table/src/main-builder.js +45 -45
  119. package/src/web-components/json-table/src/pagination.js +32 -32
  120. package/src/web-components/json-table/src/parse-cols.js +18 -18
  121. package/src/web-components/json-table/src/parse-rows.js +17 -17
  122. package/src/web-components/json-table/src/resolve-params.js +53 -41
  123. package/src/web-components/json-table/src/search.js +13 -13
  124. package/src/web-components/json-table/src/sorting.js +20 -20
  125. package/src/web-components/json-table/src/table-body.js +13 -13
  126. package/src/web-components/json-table/src/table-builder.js +34 -34
  127. package/src/web-components/json-table/src/table-tfoot.js +8 -8
  128. package/src/web-components/json-table/src/table-thead.js +21 -21
  129. package/src/web-components/json-table/src/update-info.js +11 -11
  130. package/types/classes.d.ts +2 -2
  131. package/types/global.d.ts +18 -12
@@ -3,7 +3,7 @@
3
3
  /* eslint-disable no-console */
4
4
  /* eslint-env node */
5
5
 
6
- // run npm update for all packeges inside `node_modules/@massimo-cassandro` folder
6
+ // esegue npm update per tutti i pacchetti presenti nella cartella `node_modules/@massimo-cassandro`
7
7
 
8
8
  import * as fs from 'fs';
9
9
  import {execSync} from 'child_process';
@@ -1,20 +1,20 @@
1
1
  # Update Version
2
2
 
3
- Reads the version stored in `package.json`, updates it, and maintains a log file.
3
+ Legge la versione memorizzata in `package.json`, la aggiorna e mantiene un file di log.
4
4
 
5
- Each update adds a line to the `changelog.md` file located at the project root. Each line contains the date, the updated version, and optionally, a descriptive text.
5
+ Ogni aggiornamento aggiunge una riga al file `changelog.md` presente nella root del progetto. Ogni riga contiene la data, la versione aggiornata e, facoltativamente, un testo descrittivo.
6
6
 
7
- The updated version number and descriptive text are copied to the clipboard to speed up commenting for any subsequent commits.
7
+ Il numero di versione aggiornato e il testo descrittivo vengono copiati negli appunti per velocizzare la scrittura del messaggio dei commit successivi.
8
8
 
9
- Usage:
9
+ Utilizzo:
10
10
 
11
11
  ```bash
12
12
  npx update-version <options>
13
13
  ```
14
14
 
15
- Options:
15
+ Opzioni:
16
16
 
17
- * `--pkg`: Path to the `package.json` file relative to the current directory (default: `./package.json`)
18
- * `--log-file`: Path to the log file relative to the current directory (default: `./changelog.md`). If the file name ends with `.txt`, the log type is assumed to be the previous version of `update-version`, where each line is in the form `timestamp | version | description`
19
- * `--log-patch`: If present, patch changes are also recorded in the log.
20
- * `--no-log-v0`: If `true` (default), the log is not written when the major version is `0`, except for the initial log entry created when the changelog file is first initialized. Pass `--no-log-v0` to enable it explicitly, or `--no-log-v0=false` to disable it from the command line.
17
+ * `--pkg`: Percorso del file `package.json` relativo alla directory corrente (default: `./package.json`)
18
+ * `--log-file`: Percorso del file di log relativo alla directory corrente (default: `./changelog.md`). Se il nome del file termina con `.txt`, si assume il formato di log della versione precedente di `update-version`, in cui ogni riga ha la forma `timestamp | version | description`
19
+ * `--log-patch`: Se presente, vengono registrate nel log anche le modifiche di tipo patch.
20
+ * `--no-log-v0`: Se `true` (default), il log non viene scritto quando la versione major è `0`, tranne per la voce iniziale creata alla prima inizializzazione del file changelog. Passare `--no-log-v0` per abilitarlo esplicitamente, oppure `--no-log-v0=false` per disabilitarlo da riga di comando.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@massimo-cassandro/minimo",
3
- "version": "1.41.4",
3
+ "version": "1.41.5",
4
4
  "description": "Light css framework & utilities",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -1 +1 @@
1
- with bootstrap css
1
+ con css bootstrap
@@ -67,21 +67,21 @@ export const unsplashParams = {
67
67
 
68
68
 
69
69
 
70
- // Default query parameters for the Unsplash /search/photos endpoint.
71
- // All params are optional except `query` (passed at call time).
70
+ // Parametri di query di default per l'endpoint /search/photos di Unsplash.
71
+ // Tutti i parametri sono opzionali tranne `query` (passato al momento della chiamata).
72
72
  const defaultUnsplashParams = {
73
- per_page: 18, // results per page — max: 30
73
+ per_page: 18, // risultati per pagina — max: 30
74
74
  // order_by: 'relevant', // "relevant" | "latest"
75
- content_filter: 'high', // "low" | "high" — filters explicit content
75
+ content_filter: 'high', // "low" | "high" — filtra i contenuti espliciti
76
76
  orientation: 'landscape', // "landscape" | "portrait" | "squarish"
77
77
  lang: 'it',
78
78
 
79
- // Other available params (not set by default):
80
- // page : (int) — page number, default 1
79
+ // Altri parametri disponibili (non impostati di default):
80
+ // page : (int) — numero di pagina, default 1
81
81
  // color : (string) — "black_and_white" | "black" | "white" | "yellow" |
82
82
  // "orange" | "red" | "purple" | "magenta" |
83
83
  // "green" | "teal" | "blue"
84
- // collections : (string) — comma-separated collection IDs to narrow results
84
+ // collections : (string) — ID delle collezioni separati da virgola per restringere i risultati
85
85
  }
86
86
 
87
87
  ,app_data = getAppData()
@@ -170,7 +170,7 @@ export function unsplashPictureTag(img_data, options = {}){
170
170
  ...options
171
171
  };
172
172
 
173
- const formats = ['avif', 'webp', 'pjpg'] // `fmt` parameter, in order of use
173
+ const formats = ['avif', 'webp', 'pjpg'] // parametro `fmt`, in ordine di utilizzo
174
174
  ,base_url = new URL(img_data.raw_url)
175
175
  ,searchParams = new URLSearchParams(base_url.search)
176
176
  ,img_params = [['q', '60']]
@@ -264,7 +264,7 @@ export function unsplashPictureTag(img_data, options = {}){
264
264
 
265
265
  // img_params.push(
266
266
  // ['fit', 'crop'],
267
- // ['crop', 'faces,entropy,edges'], // top, bottom, left, right, faces, focalpoint, edges, and entropy
267
+ // ['crop', 'faces,entropy,edges'], // top, bottom, left, right, faces, focalpoint, edges ed entropy
268
268
  // );
269
269
  // const sizes = [
270
270
  // {w: 2560, ratio: 16/9},
@@ -1,11 +1,11 @@
1
1
  # Autocomplete
2
2
 
3
- Implementation of [@tarekraafat/autocomplete.js](https://tarekraafat.github.io/autoComplete.js/#/) to manage key-value items
3
+ Implementazione di [@tarekraafat/autocomplete.js](https://tarekraafat.github.io/autoComplete.js/#/) per gestire elementi chiave-valore
4
4
 
5
- Requires package `@tarekraafat/autocomplete.js`:
5
+ Richiede il pacchetto `@tarekraafat/autocomplete.js`:
6
6
 
7
7
  ```bash
8
8
  npm i -S @tarekraafat/autocomplete.js
9
9
  ```
10
10
 
11
- Includes the `checkAutocomplete` function: checks that autocomplete fields are filled in correctly.
11
+ Include la funzione `checkAutocomplete`: verifica che i campi autocomplete siano compilati correttamente.
@@ -5,20 +5,20 @@ import autoComplete from '@tarekraafat/autocomplete.js';
5
5
 
6
6
  export const ac_default_params = {
7
7
  placeholder: 'Inserisci tre o più caratteri',
8
- ac_url: null, // search URL; must have leading and trailing slashes
8
+ ac_url: null, // URL di ricerca; deve avere slash iniziale e finale
9
9
 
10
- // when true, the search query string is not appended to the URL (useful with a static JSON)
10
+ // se true, la stringa di ricerca non viene accodata all'URL (utile con un JSON statico)
11
11
  test_mode: false,
12
12
 
13
13
  /*
14
- Function that receives the fetch result and returns an array of objects in the form:
14
+ Funzione che riceve il risultato del fetch e restituisce un array di oggetti nella forma:
15
15
  {
16
- id <== element id
17
- val <== value shown as the selection result
18
- list_display <== string shown in the results list
16
+ id <== id dell'elemento
17
+ val <== valore mostrato come risultato della selezione
18
+ list_display <== stringa mostrata nell'elenco dei risultati
19
19
  }
20
20
 
21
- example:
21
+ esempio:
22
22
  data => data.map(item => {
23
23
  return {
24
24
  id: item.id,
@@ -26,78 +26,90 @@ export const ac_default_params = {
26
26
  list_display: `#${item.id} ${item.agenzia} (${item.network})`+
27
27
  (item.ragioneSociale? `<br><small>${item.ragioneSociale}</small>` : '—')
28
28
 
29
- // optional:
30
- __xxx__: item (or other custom data)
29
+ // opzionale:
30
+ __xxx__: item (o altri dati personalizzati)
31
31
  };
32
32
  });
33
33
  */
34
- // @ts-ignore — parameter type inferred from library callback
34
+ // @ts-ignore — tipo del parametro dedotto dalla callback della libreria
35
35
  fetch_result_function: data => data,
36
36
 
37
- // field element or function returning the element
37
+ // elemento del campo o funzione che restituisce l'elemento
38
38
  autocomplete_field: null,
39
39
 
40
- // selector of the container element that wraps autocomplete_field and related elements
40
+ // selettore dell'elemento contenitore che racchiude autocomplete_field e gli elementi correlati
41
41
  autocomplete_parent_selector: '.form-group',
42
42
 
43
- // extra query parameters to append to the search URL (GET mode)
44
- // values can be a single string/number or an array
45
- // e.g. {param1: 'val1', param2: ['val2', 'val3']}
43
+ /*
44
+ parametri di query extra da accodare all'URL di ricerca (modalità GET)
45
+ i valori possono essere una singola stringa/numero oppure un array
46
+ es. {param1: 'val1', param2: ['val2', 'val3']}
47
+ */
46
48
  extra_query_params: {},
47
49
 
48
- // name and id of the hidden input that stores the selected id
49
- // `name` is ignored if the element already exists
50
- // if none of hidden_id, hidden_field, or select_id is set, the selected id is not managed
50
+ /*
51
+ name e id dell'input hidden che memorizza l'id selezionato
52
+ `name` viene ignorato se l'elemento esiste già
53
+ se non è impostato nessuno tra hidden_id, hidden_field o select_id, l'id selezionato non viene gestito
54
+ */
51
55
  hidden_name: null,
52
56
  hidden_id: null,
53
57
 
54
- // hidden field element; when set, `hidden_name` and `hidden_id` are ignored
58
+ // elemento del campo hidden; se impostato, `hidden_name` e `hidden_id` vengono ignorati
55
59
  hidden_field: null,
56
60
 
57
- // uses an existing <select> element with the given id
58
- // when set, `hidden_name` and `hidden_id` are ignored
59
- // treated as multiple if `select_multiple === true`
60
- // in multiple mode, duplicate ids are not allowed
61
+ /*
62
+ usa un elemento <select> esistente con l'id indicato
63
+ se impostato, `hidden_name` e `hidden_id` vengono ignorati
64
+ trattato come multiplo se `select_multiple === true`
65
+ in modalità multipla non sono ammessi id duplicati
66
+ */
61
67
  select_id: null,
62
68
  select_multiple: true,
63
69
 
64
- // id of the element used to render selected-option badges
65
- // only applies when `select_id` is set (multiple mode)
66
- // if absent, badge rendering must be handled externally
70
+ /*
71
+ id dell'elemento usato per mostrare i badge delle opzioni selezionate
72
+ si applica solo quando `select_id` è impostato (modalità multipla)
73
+ se assente, il rendering dei badge va gestito esternamente
74
+ */
67
75
  badges_container_id: null,
68
76
 
69
- // callback invoked when a badge is removed;
70
- // receives the id and label text of the removed item
77
+ // callback invocata quando un badge viene rimosso;
78
+ // riceve l'id e il testo dell'etichetta dell'elemento rimosso
71
79
  badges_remove_callback: null,
72
80
 
73
- // custom function for building badge markup
74
- // receives `event.detail.selection.value` and the `params` object
75
- // if null, the default markup is used
76
- // NB: for pre-registered items the first argument only contains `id` and `val`
77
- // NB: the badge must have class `ac-badge` and attribute `data-id`; must return complete badge HTML
81
+ /*
82
+ funzione personalizzata per costruire il markup dei badge
83
+ riceve `event.detail.selection.value` e l'oggetto `params`
84
+ se null, viene usato il markup predefinito
85
+ NB: per gli elementi preregistrati il primo argomento contiene solo `id` e `val`
86
+ NB: il badge deve avere la classe `ac-badge` e l'attributo `data-id`; deve restituire l'HTML completo del badge
87
+ */
78
88
  badges_builder: null,
79
89
 
80
- // class assigned to the span containing the badge label
90
+ // classe assegnata allo span che contiene l'etichetta del badge
81
91
  badge_label_class: 'ac-badge-label',
82
92
 
83
- // class assigned to the badge remove button
93
+ // classe assegnata al pulsante di rimozione del badge
84
94
  badge_btn_class: 'ac-badge-btn',
85
95
 
86
96
 
87
- // autocomplete callback
88
- // when present, called with 5 arguments: id, val, autocomplete field element, list_display (outerHTML), and row
89
- // NB: row is only available after an option has been selected
97
+ /*
98
+ callback dell'autocomplete
99
+ se presente, viene chiamata con 5 argomenti: id, val, elemento del campo autocomplete, list_display (outerHTML) e row
100
+ NB: row è disponibile solo dopo la selezione di un'opzione
101
+ */
90
102
  callback: null,
91
103
 
92
- // optional extra class for the results list
104
+ // classe extra opzionale per l'elenco dei risultati
93
105
  resultList_extra_class: null,
94
106
 
95
- // optional extra class for the outer wrapper
107
+ // classe extra opzionale per il wrapper esterno
96
108
  wrapper_extra_class: null
97
109
  };
98
110
 
99
111
  /**
100
- * Initialises an autocomplete field using @tarekraafat/autocomplete.js.
112
+ * Inizializza un campo autocomplete usando @tarekraafat/autocomplete.js.
101
113
  * @param {Record<string, any>} [params={}] (default: {})
102
114
  * @returns {void}
103
115
  */
@@ -107,7 +119,7 @@ export default function (params = {}) {
107
119
 
108
120
  params = {...ac_default_params, ...params};
109
121
 
110
- // @ts-ignore — circular reference: bparams defaults to params
122
+ // @ts-ignore — riferimento circolare: il default di bparams è params
111
123
  params.badges_builder ??= (result_obj, bparams = params) => `<span class="ac-badge badge rounded-pill text-bg-secondary" data-id="${result_obj.id}">` +
112
124
  `<span class="${bparams.badge_label_class}">${result_obj.val}</span>` +
113
125
  `<button type="button" class="${bparams.badge_btn_class}">&times;</button>` +
@@ -120,7 +132,7 @@ export default function (params = {}) {
120
132
  params.autocomplete_field = params.autocomplete_field();
121
133
  }
122
134
 
123
- // set autocomplete field attributes
135
+ // imposta gli attributi del campo autocomplete
124
136
  params.autocomplete_field.type = 'search';
125
137
  ['spellcheck=false', 'autocorrect=off', 'autocomplete=off', 'autocapitalize=off'].forEach(item => {
126
138
  const [attr, val] = item.split('=');
@@ -138,7 +150,7 @@ export default function (params = {}) {
138
150
  let extra_query_params = [];
139
151
  for(const i in params.extra_query_params) {
140
152
  if(Array.isArray(params.extra_query_params[i])) {
141
- // @ts-ignore — extra_query_params values are untyped (string, number, or array)
153
+ // @ts-ignore — i valori di extra_query_params non sono tipizzati (stringa, numero o array)
142
154
  params.extra_query_params[i].forEach(item => {
143
155
  extra_query_params.push(`${i}[]=${item}`);
144
156
  });
@@ -160,7 +172,7 @@ export default function (params = {}) {
160
172
  }
161
173
 
162
174
  } else {
163
- // hidden field — created if not already present
175
+ // campo hidden — creato se non già presente
164
176
  if(params.hidden_field) {
165
177
  hidden_field = params.hidden_field;
166
178
 
@@ -181,16 +193,16 @@ export default function (params = {}) {
181
193
  diacritics: true,
182
194
  threshold: 3,
183
195
  data: {
184
- // @ts-ignore — library callback; query type defined by autoComplete.js
196
+ // @ts-ignore — callback della libreria; tipo di query definito da autoComplete.js
185
197
  src: async (query) => {
186
198
  const ac_url = params.ac_url +
187
199
  (params.test_mode? '' : encodeURIComponent(query)) + extra_query_params_string;
188
200
 
189
201
 
190
202
  try {
191
- // Fetch Data from external Source
203
+ // Recupera i dati da una sorgente esterna
192
204
  const source = await fetch(ac_url);
193
- // Data is array of `Objects` | `Strings`
205
+ // I dati sono un array di `Objects` | `Strings`
194
206
  const data = await source.json();
195
207
 
196
208
  return params.fetch_result_function(data);
@@ -199,7 +211,7 @@ export default function (params = {}) {
199
211
  return error;
200
212
  }
201
213
  },
202
- // Data 'Object' key to be searched
214
+ // Chiave dell'oggetto dati in cui cercare
203
215
  keys:['list_display'],
204
216
  cache: false
205
217
  },
@@ -207,16 +219,16 @@ export default function (params = {}) {
207
219
  class: params.resultList_extra_class,
208
220
 
209
221
  destination: '#' + params.autocomplete_field.id,
210
- // @ts-ignore — library callback; types defined by autoComplete.js
222
+ // @ts-ignore — callback della libreria; tipi definiti da autoComplete.js
211
223
  element: (list, data) => {
212
224
  if (!data.results.length) {
213
- // Create "No Results" message element
225
+ // Crea l'elemento del messaggio "Nessun risultato"
214
226
  const message = document.createElement('div');
215
- // Add class to the created element
227
+ // Aggiunge la classe all'elemento creato
216
228
  message.setAttribute('class', 'no-result');
217
- // Add message text content
229
+ // Aggiunge il testo del messaggio
218
230
  message.innerHTML = `<span>Nessun risultato per <strong>"${data.query}"</strong></span>`;
219
- // Append message element to the results list
231
+ // Accoda l'elemento del messaggio all'elenco dei risultati
220
232
  list.prepend(message);
221
233
  }
222
234
  },
@@ -228,7 +240,7 @@ export default function (params = {}) {
228
240
  events: {
229
241
 
230
242
  input: {
231
- // @ts-ignore — library event; type defined by autoComplete.js
243
+ // @ts-ignore — evento della libreria; tipo definito da autoComplete.js
232
244
  selection: (event) => {
233
245
  // console.log(event.detail.selection.value);
234
246
 
@@ -241,7 +253,7 @@ export default function (params = {}) {
241
253
  const option_element = new Option(selected_text, selected_id, true, true);
242
254
 
243
255
  if(params.select_multiple) {
244
- // prevent duplicate entries
256
+ // evita le voci duplicate
245
257
  const registered_option = select_field.querySelector(`option[value="${selected_id}"]`),
246
258
  new_badge = params.badges_builder(event.detail.selection.value, params);
247
259
 
@@ -254,7 +266,7 @@ export default function (params = {}) {
254
266
  badges_container.insertAdjacentHTML('beforeend', new_badge);
255
267
  }
256
268
 
257
- // replace the existing badge to always show the latest version
269
+ // sostituisce il badge esistente per mostrare sempre l'ultima versione
258
270
  } else {
259
271
  registered_option.replaceWith(option_element);
260
272
  if(badges_container) {
@@ -265,7 +277,7 @@ export default function (params = {}) {
265
277
  }
266
278
  }
267
279
 
268
- } else { // single select
280
+ } else { // select singola
269
281
  select_field.innerHTML = '';
270
282
  select_field.appendChild(option_element);
271
283
  }
@@ -284,9 +296,9 @@ export default function (params = {}) {
284
296
  }
285
297
  }); // end autoComplete
286
298
 
287
- // TODO improve and make the callback invocation more efficient
299
+ // TODO migliorare e rendere più efficiente l'invocazione della callback
288
300
 
289
- // reset hidden field when the autocomplete value is cleared or mismatched
301
+ // azzera il campo hidden quando il valore dell'autocomplete viene cancellato o non corrisponde
290
302
  const check_ac = () => {
291
303
  if(params.autocomplete_field.value === '' ||
292
304
  (params.autocomplete_field.dataset.sel !== undefined &&
@@ -317,7 +329,7 @@ export default function (params = {}) {
317
329
  check_ac();
318
330
  }, false);
319
331
 
320
- // badge click listener
332
+ // listener click dei badge
321
333
  badges_container?.addEventListener('click', e => {
322
334
  const target = /** @type {HTMLElement} */ (e.target);
323
335
  const btn = target.closest(`.${params.badge_btn_class}`);
@@ -337,11 +349,11 @@ export default function (params = {}) {
337
349
  }
338
350
  }, false);
339
351
 
340
- // render badges for any pre-registered select options
352
+ // mostra i badge per le eventuali opzioni preregistrate della select
341
353
  if(select_field) {
342
354
 
343
355
  if(params.select_multiple && badges_container) {
344
- // any data attributes on the option are forwarded to `badges_builder` under the `dataset` key
356
+ // gli eventuali attributi data dell'option vengono passati a `badges_builder` sotto la chiave `dataset`
345
357
 
346
358
  select_field.querySelectorAll('option[selected]').forEach(option => {
347
359
  const opt = /** @type {HTMLOptionElement} */ (option);
@@ -1,8 +1,8 @@
1
- // TODO trigger ac selection
1
+ // TODO attivare la selezione dell'autocomplete
2
2
 
3
3
  /**
4
- * Resets both the autocomplete and hidden fields when the current value does not match
5
- * the last confirmed selection.
4
+ * Azzera sia il campo autocomplete sia il campo hidden quando il valore corrente non corrisponde
5
+ * all'ultima selezione confermata.
6
6
  * @param {HTMLInputElement | null | undefined} autocomplete_field
7
7
  * @param {HTMLInputElement | null | undefined} hidden_field
8
8
  * @returns {void}
@@ -1,8 +1,8 @@
1
1
  /*! minimo - Dismiss Alerts */
2
2
  /**
3
- * Adds click listeners to all `[data-dismiss]` elements to remove their closest ancestor
4
- * that matches the class specified in the `data-dismiss` attribute.
5
- * Typically used to remove alert boxes.
3
+ * Aggiunge listener click a tutti gli elementi `[data-dismiss]` per rimuovere il loro antenato
4
+ * più vicino che corrisponde alla classe indicata nell'attributo `data-dismiss`.
5
+ * Tipicamente usato per rimuovere i box di alert.
6
6
  * @returns {void}
7
7
  */
8
8
  export function dismissAlerts(){
@@ -1,12 +1,12 @@
1
1
  /*! minimo - Form Reset Submit */
2
- // import './form.css'; // included in the main CSS entry point
2
+ // import './form.css'; // incluso nell'entry point CSS principale
3
3
  import { enableSubmitBtns } from '../utilities/enable-submit-btns.js';
4
4
 
5
5
  /**
6
- * Wires up submit validation and button-disabling behaviour on all forms.
7
- * - Adds `was-validated` class on submit (unless `data-no-was-validated` is present).
8
- * - Clears `.is-invalid` / `.is-valid` classes before each submission attempt.
9
- * - Disables submit buttons on valid submission (unless `data-no-disabling` is present).
6
+ * Collega la validazione al submit e il comportamento di disabilitazione dei pulsanti a tutti i form.
7
+ * - Aggiunge la classe `was-validated` al submit (a meno che sia presente `data-no-was-validated`).
8
+ * - Rimuove le classi `.is-invalid` / `.is-valid` prima di ogni tentativo di invio.
9
+ * - Disabilita i pulsanti submit a invio valido (a meno che sia presente `data-no-disabling`).
10
10
  * @returns {void}
11
11
  */
12
12
  export function formResetSubmit(){
@@ -34,7 +34,7 @@ export function formResetSubmit(){
34
34
  enableSubmitBtns();
35
35
 
36
36
  } else {
37
- // 'data-disable-submit' kept for backwards compatibility
37
+ // 'data-disable-submit' mantenuto per retrocompatibilità
38
38
  if(!form.hasAttribute('data-no-disabling') && !form.hasAttribute('data-disable-submit')) {
39
39
  form.querySelectorAll('[type="submit"]').forEach(btn => {
40
40
  const button = /** @type {HTMLButtonElement} */ (btn);
@@ -1,5 +1,5 @@
1
1
  /*! minimo - Inner Nav */
2
- // tab / list navigation — copies the primary nav markup into all `.inner-nav` containers
2
+ // navigazione a tab / lista — copia il markup della nav principale in tutti i contenitori `.inner-nav`
3
3
  /*
4
4
  <p class="inner-nav-main">...</p>
5
5
  ...
@@ -9,7 +9,7 @@
9
9
  import './inner-nav.css';
10
10
 
11
11
  /**
12
- * Copies the inner HTML of `.inner-nav-main` into every `.inner-nav` element on the page.
12
+ * Copia l'HTML interno di `.inner-nav-main` in ogni elemento `.inner-nav` della pagina.
13
13
  * @returns {void}
14
14
  */
15
15
  export function innerNav(){