@massimo-cassandro/minimo 1.18.4 → 1.19.1

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 (171) hide show
  1. package/README.md +5 -1
  2. package/design-tokens/{utilities/readme.md → README.md} +26 -16
  3. package/design-tokens/tokens/src/components/unsplash-page/unsplash-page.minimo.tokens.jsonc +69 -31
  4. package/design-tokens/{utilities/tokens-config-sample.mjs → tokens-config-sample.mjs} +18 -10
  5. package/design-tokens/utilities/build-tokens-src/config.mjs +5 -0
  6. package/design-tokens/utilities/build-tokens-src/formats/css.mjs +18 -2
  7. package/design-tokens/utilities/build-tokens-src/merge-css.mjs +60 -0
  8. package/design-tokens/utilities/build-tokens.mjs +12 -0
  9. package/dev-tools/README.md +8 -0
  10. package/dev-tools/starter-kit/starter-install.sh +46 -26
  11. package/package.json +6 -2
  12. package/snippets/error-pages/error-pages.js +3 -2
  13. package/src/components/unsplash-page/unsplash-page.minimo.tokens.mjs +78 -39
  14. package/src/components/unsplash-page/unsplash-page.module.css +25 -6
  15. package/src/custom-properties.css +8 -1
  16. package/src/minimo.css +1 -1
  17. package/src/web-components/s-datatable-component/s-datatable-component.js +4 -1
  18. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/index.js +0 -92
  19. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/hbars.js +0 -356
  20. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/pie.js +0 -245
  21. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/radial-bars.js +0 -177
  22. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/rating-display.js +0 -835
  23. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/costruzione-assi.js +0 -212
  24. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/costruzione-linee.js +0 -101
  25. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/defaults.js +0 -185
  26. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/display-current.js +0 -27
  27. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/grid-areas.js +0 -129
  28. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/parse-opts.js +0 -64
  29. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/paths-setup.js +0 -73
  30. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile.js +0 -126
  31. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/signal-bars.js +0 -290
  32. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/week-utils.js +0 -122
  33. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/hbars-test.js +0 -52
  34. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/mcn-test.js +0 -74
  35. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/pie-test.js +0 -16
  36. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/radial-bars-test.js +0 -48
  37. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/settimanale-mensile-dati-settimanale.js +0 -426
  38. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/settimanale-mensile-test.js +0 -260
  39. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/signal-bars-test.js +0 -64
  40. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/node-test.mjs +0 -86
  41. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/hBars-node-test.mjs +0 -40
  42. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/lines-node-test.mjs +0 -73
  43. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/mcn-node-test.mjs +0 -64
  44. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/pie-node-test.mjs +0 -12
  45. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/radialsBar-node-test.mjs +0 -44
  46. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/settimanale-mensile-node-test.mjs +0 -258
  47. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/signalBars-node-test.mjs +0 -36
  48. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/test-readme.md +0 -24
  49. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/textToPath-test.mjs +0 -14
  50. package/charts/TODO charts/???/InfoBox.js +0 -456
  51. package/charts/TODO charts/???/README-upg OLD/342/206/222NEW.md" +0 -53
  52. package/charts/TODO charts/???/README.md +0 -1
  53. package/charts/TODO charts/???/TODO.md +0 -39
  54. package/charts/TODO charts/???/base-cfg.js +0 -66
  55. package/charts/TODO charts/???/rating-displayOLD.js +0 -837
  56. package/charts/TODO charts/docs/TODO.md +0 -1
  57. package/charts/TODO charts/docs/costruzione display rating.md +0 -145
  58. package/charts/TODO charts/test/node-test.mjs +0 -92
  59. package/charts/TODO charts/test/test-readme.md +0 -23
  60. package/charts/TODO charts/test/test-src/rating-display-extra-test.js +0 -132
  61. package/charts/TODO charts/test/test-src/rating-display-test.js +0 -155
  62. package/charts/TODO charts/test/textToPath-test.mjs +0 -14
  63. package/charts/TODO.md +0 -7
  64. package/charts/src/node-helpers/TODO.md +0 -2
  65. package/dev-tools/starter-kit/TODO.md +0 -135
  66. package/src/components/TODO form-multiselect/form-multiselect.css +0 -40
  67. package/src/components/TODO form-multiselect/form-multiselect.js +0 -83
  68. package/src/components/TODO vanilla-cookie-consent/cookie-consent.css +0 -20
  69. package/src/components/TODO vanilla-cookie-consent/cookie-consent.js +0 -76
  70. package/src/components/TODO vanilla-cookie-consent/render-cookie-list.js +0 -32
  71. package/src/components/TODO vanilla-cookie-consent/src/cookie-list.js +0 -85
  72. package/src/components/TODO vanilla-cookie-consent/src/it-translation.js +0 -38
  73. package/src/components/TODO vanilla-cookie-consent/src/run-analytics.js +0 -54
  74. package/src/components/TODO vanilla-cookie-consent/src/run-recaptcha.js +0 -71
  75. package/src/components/autocomplete/TODO.md +0 -4
  76. package/src/web-components/TODO json-table/README.md +0 -67
  77. package/src/web-components/TODO json-table/TODO.md +0 -12
  78. package/src/web-components/TODO json-table/_work/OLD/docs/custom-props-list.md +0 -69
  79. package/src/web-components/TODO json-table/_work/OLD/script/create-css-custom-props-doc.mjs +0 -113
  80. package/src/web-components/TODO json-table/_work/OLD/script/src/custom-props-end.md +0 -4
  81. package/src/web-components/TODO json-table/_work/OLD/script/src/custom-props-start.md +0 -30
  82. package/src/web-components/TODO json-table/_work/OLD/src/css/icons.module.css +0 -22
  83. package/src/web-components/TODO json-table/_work/OLD/src/css/info.module.css +0 -42
  84. package/src/web-components/TODO json-table/_work/OLD/src/css/main-wrapper.module.css +0 -4
  85. package/src/web-components/TODO json-table/_work/OLD/src/css/table.module.css +0 -154
  86. package/src/web-components/TODO json-table/_work/OLD/src/css/utility.module.css +0 -9
  87. package/src/web-components/TODO json-table/_work/OLD/src/icons/false.svg +0 -1
  88. package/src/web-components/TODO json-table/_work/OLD/src/icons/search-arrows.svg +0 -1
  89. package/src/web-components/TODO json-table/_work/OLD/src/icons/true.svg +0 -1
  90. package/src/web-components/TODO json-table/_work/OLD/src/index.js +0 -56
  91. package/src/web-components/TODO json-table/_work/OLD/src/js/default-columns-data-types.js +0 -172
  92. package/src/web-components/TODO json-table/_work/OLD/src/js/defaults.js +0 -156
  93. package/src/web-components/TODO json-table/_work/OLD/src/js/info-section.js +0 -31
  94. package/src/web-components/TODO json-table/_work/OLD/src/js/listeners.js +0 -17
  95. package/src/web-components/TODO json-table/_work/OLD/src/js/main-builder.js +0 -26
  96. package/src/web-components/TODO json-table/_work/OLD/src/js/parse-params.js +0 -121
  97. package/src/web-components/TODO json-table/_work/OLD/src/js/set-column-classname.js +0 -22
  98. package/src/web-components/TODO json-table/_work/OLD/src/js/table-builder.js +0 -64
  99. package/src/web-components/TODO json-table/_work/OLD/src/js/table-foot.js +0 -8
  100. package/src/web-components/TODO json-table/_work/OLD/src/js/table-head.js +0 -47
  101. package/src/web-components/TODO json-table/_work/OLD/src/js/table-row.js +0 -83
  102. package/src/web-components/TODO json-table/_work/OLD/src/js/utilities.js +0 -5
  103. package/src/web-components/TODO json-table/_work/__json-table-react/index.js +0 -4
  104. package/src/web-components/TODO json-table/_work/__json-table-react/src/build-page-array.js +0 -73
  105. package/src/web-components/TODO json-table/_work/__json-table-react/src/columns-data-types.js +0 -73
  106. package/src/web-components/TODO json-table/_work/__json-table-react/src/defaults.js +0 -50
  107. package/src/web-components/TODO json-table/_work/__json-table-react/src/download-excel.js +0 -156
  108. package/src/web-components/TODO json-table/_work/__json-table-react/src/set-className.js +0 -19
  109. package/src/web-components/TODO json-table/_work/__json-table-react/src/set-download-filename.js +0 -17
  110. package/src/web-components/TODO json-table/_work/__json-table-react/src/table-to-csv.js +0 -48
  111. package/src/web-components/TODO json-table/_work/archived/table-to-csv.js +0 -48
  112. package/src/web-components/TODO json-table/_work/arrow.svg +0 -3
  113. package/src/web-components/TODO json-table/_work/da decidere/get-cell-data.js +0 -18
  114. package/src/web-components/TODO json-table/_work/download-button.js +0 -29
  115. package/src/web-components/TODO json-table/_work/download-excel.js +0 -155
  116. package/src/web-components/TODO json-table/_work/pagination-array-builder.js +0 -73
  117. package/src/web-components/TODO json-table/_work/pagination.js +0 -37
  118. package/src/web-components/TODO json-table/_work/set-download-filename.js +0 -19
  119. package/src/web-components/TODO json-table/_work/table-info.js +0 -24
  120. package/src/web-components/TODO json-table/demo/README.md +0 -66
  121. package/src/web-components/TODO json-table/demo/assets/link-simple.svg +0 -1
  122. package/src/web-components/TODO json-table/demo/demo-data/json-static-table-demo-data.js +0 -512
  123. package/src/web-components/TODO json-table/demo/demo.css +0 -32
  124. package/src/web-components/TODO json-table/demo/demo.js +0 -24
  125. package/src/web-components/TODO json-table/demo/js/demo-ajax-table.js +0 -165
  126. package/src/web-components/TODO json-table/demo/js/demo-static-table.js +0 -180
  127. package/src/web-components/TODO json-table/demo/webpack-modules/css-rules.mjs +0 -122
  128. package/src/web-components/TODO json-table/demo/webpack-modules/get-jsConfig-aliases.mjs +0 -33
  129. package/src/web-components/TODO json-table/demo/webpack-modules/svg-rules.mjs +0 -108
  130. package/src/web-components/TODO json-table/demo/webpack-modules/svgo.config.mjs +0 -26
  131. package/src/web-components/TODO json-table/demo/webpack.config.mjs +0 -333
  132. package/src/web-components/TODO json-table/docs/custom-props-list.md +0 -74
  133. package/src/web-components/TODO json-table/docs-builder/create-css-custom-props-doc.mjs +0 -157
  134. package/src/web-components/TODO json-table/docs-builder/src/custom-props-end.md +0 -6
  135. package/src/web-components/TODO json-table/docs-builder/src/custom-props-start.md +0 -29
  136. package/src/web-components/TODO json-table/src/TODO.md +0 -1
  137. package/src/web-components/TODO json-table/src/__json-table-react/build-page-array.js +0 -73
  138. package/src/web-components/TODO json-table/src/__json-table-react/columns-data-types.js +0 -73
  139. package/src/web-components/TODO json-table/src/__json-table-react/defaults.js +0 -50
  140. package/src/web-components/TODO json-table/src/__json-table-react/download-excel.js +0 -156
  141. package/src/web-components/TODO json-table/src/__json-table-react/set-className.js +0 -19
  142. package/src/web-components/TODO json-table/src/__json-table-react/set-download-filename.js +0 -17
  143. package/src/web-components/TODO json-table/src/__json-table-react/table-to-csv.js +0 -48
  144. package/src/web-components/TODO json-table/src/css/custom-media.css +0 -16
  145. package/src/web-components/TODO json-table/src/css/icons.module.css +0 -22
  146. package/src/web-components/TODO json-table/src/css/info-section.module.css +0 -78
  147. package/src/web-components/TODO json-table/src/css/main-builder.module.css +0 -6
  148. package/src/web-components/TODO json-table/src/css/table.module.css +0 -172
  149. package/src/web-components/TODO json-table/src/css/utility.module.css +0 -9
  150. package/src/web-components/TODO json-table/src/icons/arrow-down-bold.svg +0 -1
  151. package/src/web-components/TODO json-table/src/icons/false.svg +0 -1
  152. package/src/web-components/TODO json-table/src/icons/true.svg +0 -1
  153. package/src/web-components/TODO json-table/src/index.js +0 -125
  154. package/src/web-components/TODO json-table/src/js/default-columns-data-types.js +0 -172
  155. package/src/web-components/TODO json-table/src/js/defaults.js +0 -510
  156. package/src/web-components/TODO json-table/src/js/get-ajax-data.js +0 -72
  157. package/src/web-components/TODO json-table/src/js/info-section.js +0 -39
  158. package/src/web-components/TODO json-table/src/js/init-ajax-table.js +0 -30
  159. package/src/web-components/TODO json-table/src/js/init-static-table.js +0 -18
  160. package/src/web-components/TODO json-table/src/js/main-builder.js +0 -87
  161. package/src/web-components/TODO json-table/src/js/parse-data-row.js +0 -123
  162. package/src/web-components/TODO json-table/src/js/parse-params.js +0 -118
  163. package/src/web-components/TODO json-table/src/js/set-search-listener.js +0 -62
  164. package/src/web-components/TODO json-table/src/js/set-sort-listeners.js +0 -115
  165. package/src/web-components/TODO json-table/src/js/static-data-sorting.js +0 -23
  166. package/src/web-components/TODO json-table/src/js/table-builder.js +0 -45
  167. package/src/web-components/TODO json-table/src/js/table-row.js +0 -43
  168. package/src/web-components/TODO json-table/src/js/table-tfoot.js +0 -9
  169. package/src/web-components/TODO json-table/src/js/table-thead.js +0 -91
  170. package/src/web-components/TODO json-table/src/js/update-info.js +0 -42
  171. package/src/web-components/TODO json-table/src/js/utilities.js +0 -5
@@ -1,510 +0,0 @@
1
- /** Module defaults and inline JSDoc for `defaults_params` */
2
- /**
3
- * @typedef {Object} DateLocaleOpts
4
- * @property {'numeric'|'2-digit'|'short'|'long'|'narrow'} [year]
5
- * @property {'numeric'|'2-digit'|'short'|'long'|'narrow'} [month]
6
- * @property {'numeric'|'2-digit'|'short'|'long'|'narrow'} [day]
7
- *
8
- * @typedef {Object} TimeLocaleOpts
9
- * @property {boolean} [hour12]
10
- * @property {'2-digit'|'numeric'} [hour]
11
- * @property {'2-digit'|'numeric'} [minute]
12
- * @property {'2-digit'|'numeric'} [second]
13
- *
14
- * @typedef {Object} NumberFormatOpts
15
- * @property {number} [maximumFractionDigits]
16
- * @property {number} [minimumFractionDigits]
17
- *
18
- *
19
- * @typedef {'string'|'number'|'date'|'boolean'|'currency'|'percentage'|'custom'} DataType
20
- */
21
-
22
- import trueIcon from '../icons/true.svg?inline';
23
- import falseIcon from '../icons/false.svg?inline';
24
- import sortArrow from '../icons/arrow-down-bold.svg?inline';
25
-
26
- export const defaults_params = {
27
- /**
28
- * If true, logs debug info to the console.
29
- * @type {boolean}
30
- */
31
- debug : false,
32
-
33
- /**
34
- * Element to insert the table into.
35
- * @type {HTMLElement|null}
36
- */
37
- container : null,
38
-
39
- /**
40
- * Collection of generated DOM elements used by the table instance.
41
- * @type {Object}
42
- */
43
- elements : {},
44
-
45
- /**
46
- * Columns definitions (see `columns_default`).
47
- * @type {Array<ColumnDefault>}
48
- */
49
- columns : [],
50
-
51
- /**
52
- * If true, fetch rows from `ajaxUrl` and ignore `data`.
53
- * @type {boolean}
54
- */
55
- ajax : false,
56
-
57
- /**
58
- * Ajax URL for rows data.
59
- * @type {string|null}
60
- */
61
- ajaxUrl : null,
62
-
63
- /**
64
- * If null, default config (see `ajax_config_default` at bottom of this file) is used
65
- * If Object, must provide parameters about ajax request, according to `ajax_config_default` obj
66
- * @type {null|Object}
67
- */
68
- ajaxConfig : null,
69
-
70
- /**
71
- * Static rows data.
72
- * @type {Array}
73
- */
74
- data : [],
75
-
76
- /**
77
- * Footer data for static tables.
78
- * @type {Array}
79
- */
80
- footerData : [],
81
-
82
- /**
83
- * Table caption (string or HTML).
84
- * @type {string|null}
85
- */
86
- caption : null,
87
-
88
- /**
89
- * Enable search input.
90
- * @type {boolean}
91
- */
92
- search : true,
93
-
94
- /**
95
- * Enable column sorting.
96
- * @type {boolean}
97
- */
98
- sort : true,
99
-
100
- /**
101
- * Default sorting object: { key: 'asc'|'desc' }.
102
- * @type {Object}
103
- */
104
- defaultSorting : {},
105
-
106
- /**
107
- * Aria label for ascending sort button.
108
- * @type {string}
109
- */
110
- sortButtonAriaLabelAsc : 'Ordina questa colonna in senso ascendente (A\u00A0→\u00A0Z)',
111
-
112
- /**
113
- * Aria label for descending sort button.
114
- * @type {string}
115
- */
116
- sortButtonAriaLabelDesc : 'Ordina questa colonna in senso discendente (Z\u00A0→\u00A0A)',
117
-
118
- /**
119
- * Aria label to remove sorting.
120
- * @type {string}
121
- */
122
- sortButtonAriaLabelNone : 'Rimuovi l’ordinamento a questa colonna',
123
-
124
- /**
125
- * Locale string used for date/number formatting.
126
- * @type {string}
127
- */
128
- locale : 'it-IT',
129
-
130
- /**
131
- * Options passed to Intl.DateTimeFormat for dates.
132
- * @type {DateLocaleOpts}
133
- */
134
- datesLocaleOpts : { year: 'numeric', month: 'short', day: 'numeric' },
135
-
136
- /**
137
- * Options passed to Intl.DateTimeFormat for times.
138
- * @type {TimeLocaleOpts}
139
- */
140
- timesLocaleOpts : { hour12: false, hour:'2-digit', minute:'2-digit' },
141
-
142
- /**
143
- * Number formatting options.
144
- * @type {NumberFormatOpts}
145
- */
146
- numbersLocaleOpts : { maximumFractionDigits: 2 },
147
-
148
- /**
149
- * Currency/percentage formatting options.
150
- * @type {NumberFormatOpts}
151
- */
152
- currPercLocaleOpts : { maximumFractionDigits: 2, minimumFractionDigits: 2 },
153
-
154
- /**
155
- * Custom table id if needed.
156
- * @type {string|null}
157
- */
158
- tableId : null,
159
-
160
- /**
161
- * Extra class for the div that wraps the table.
162
- * @type {string|null}
163
- */
164
- tableWrapperExtraClassName : null,
165
-
166
- /**
167
- * Class name to assign to the <table> element.
168
- * @type {string|null}
169
- */
170
- tableClassName : null,
171
-
172
- /**
173
- * Extra class for main wrapper (contains info and table).
174
- * @type {string|null}
175
- */
176
- mainWrapperExtraClassName : null,
177
-
178
- /**
179
- * Extra class for outer info section.
180
- * @type {string|null}
181
- */
182
- outerInfoExtraClassName : null,
183
-
184
- /**
185
- * Extra class for info section.
186
- * @type {string|null}
187
- */
188
- infoExtraClassName : null,
189
-
190
- /**
191
- * If true, make info container sticky.
192
- * @type {boolean}
193
- */
194
- stickyInfo : true,
195
-
196
- /**
197
- * If true, make the table header sticky.
198
- * @type {boolean}
199
- */
200
- stickyThead : true,
201
-
202
- /**
203
- * Class for inline-end alignment.
204
- * @type {string|null}
205
- */
206
- inlineEndAlignClassName : null,
207
-
208
- /**
209
- * Class to prevent wrapping of content.
210
- * @type {string|null}
211
- */
212
- nowrapClassName : null,
213
-
214
- /**
215
- * Class for euro currency formatting.
216
- * @type {string|null}
217
- */
218
- euroClassName : null,
219
-
220
- /**
221
- * Class for percentage formatting.
222
- * @type {string|null}
223
- */
224
- percClassName : null,
225
-
226
- /**
227
- * If true, date cells are rendered with nowrap.
228
- * @type {boolean}
229
- */
230
- datesNowrap : true,
231
-
232
- /**
233
- * If true, treat 0 as an alternate (dash) character.
234
- * @type {boolean}
235
- */
236
- useZeroAltChar : true,
237
-
238
- /**
239
- * Character used for zero values when `useZeroAltChar` is true.
240
- * @type {string}
241
- */
242
- zeroAltChar : '\u2014',
243
-
244
- /**
245
- * Character used for NaN numeric values or `false` to disable.
246
- * @type {string|boolean}
247
- */
248
- isNaNChar : '\u2014',
249
-
250
- /**
251
- * Class added to both true/false boolean icon cells.
252
- * @type {string|null}
253
- */
254
- boolValuesClassName : null,
255
-
256
- /**
257
- * Class added to true icons.
258
- * @type {string|null}
259
- */
260
- boolTrueClassName : null,
261
-
262
- /**
263
- * Class added to false icons.
264
- * @type {string|null}
265
- */
266
- boolFalseClassName : null,
267
-
268
- /**
269
- * Icons used by the table for booleans and sorting.
270
- *
271
- * - `boolTrueIcon`: icon/markup for boolean true
272
- * - `boolFalseIcon`: icon/markup for boolean false
273
- * - `sortArrowIcon`: icon/markup for the sort arrow
274
- *
275
- * Imported icons can be a string, HTMLElement, SVGElement or a function returning markup.
276
- * Note: if you use custom icons, until you recompile the library, the default icons markup
277
- * remains embedded in the build even if you provide custom icons.
278
- * Note: The default sortArrowIcon is downward-oriented; if the custom one is upward-oriented,
279
- * you'll need to change the CSS properties `--jt-sort-asc-arrow-rotate` and `--jt-sort-desc-arrow-rotate`
280
- * or change something else in the CSS.
281
- * @type {string|HTMLElement|SVGElement|Function}
282
- */
283
- boolTrueIcon : trueIcon,
284
- boolFalseIcon : falseIcon,
285
- sortArrowIcon : sortArrow,
286
-
287
- /**
288
- * Alternative class for the search input (overrides default).
289
- * @type {string|null}
290
- */
291
- searchInputAltClassName : null,
292
-
293
- /**
294
- * Additional class for the search input.
295
- * @type {string|null}
296
- */
297
- searchInputExtraClassName : null,
298
-
299
- /**
300
- * Title attribute for search input.
301
- * @type {string}
302
- */
303
- searchInputTitle : 'Filtra records: inserisci un termine per eseguire la ricerca',
304
-
305
- /**
306
- * Placeholder text for search input.
307
- * @type {string}
308
- */
309
- searchInputPlaceholder : 'Inserisci il termine da cercare',
310
-
311
- /**
312
- * Aria-label for search input.
313
- * @type {string}
314
- */
315
- searchInputAriaLabel : 'Filtra risultati',
316
-
317
- /**
318
- * Callback invoked after each row (<tr>) rendering.
319
- * Signature: (trElement: HTMLElement, rowData: Object, params: Object)
320
- * @type {Function|null}
321
- */
322
- trCallback : null,
323
-
324
- // TODO download button (xlsx) (???)
325
- /*
326
- showDownloadBtn : false, // se `ajax` === true, è forzato su false
327
- downloadBtnLabel : 'Download',
328
- downloadBtnClassName : 'btn btn-outline-secondary btn-sm',
329
- separateDownloadBtn : false, // se true viene restituito un array con tabella e pulsante download separati
330
- downloadFilename : 'download',
331
- downloadFormat : 'excel', // 'excel' o 'csv'
332
- */
333
-
334
- };
335
-
336
-
337
- /**
338
- * Column default options.
339
- * @typedef {Object} ColumnDefault
340
- * @property {string|null} key - REQUIRED json object key (= db column name).
341
- * @property {string|null} title - Column title (th text, can be an HTML string).
342
- * @property {string} [dataType='string'] - Cell data type; must be one of keys of `data_types`.
343
- * @property {string|null} className - Class assigned to the cell; overrides default.
344
- * @property {Function|null} render - Rendering function for the cell.
345
- * @property {Function|null} parse - Parsing function for the cell.
346
- * @property {boolean} [rowHeading=false] - If true, the cell is a row heading (th[scope=row]).
347
- * @property {boolean} [tfoot=true]
348
- * @property {boolean} [searchable=true]
349
- * @property {boolean} [sortable=true]
350
- * @property {Function|null} sortValueCustomParser - Custom sort function for static tables.
351
- * @property {Function|null} searchValueCustomParser - Custom search function for static tables.
352
- */
353
-
354
- export const columns_default = {
355
-
356
- /**
357
- * REQUIRED: json object key (db column name)
358
- * @type {string|null}
359
- */
360
- key : null,
361
-
362
- /**
363
- * Column title (th text, can be an HTML string)
364
- * @type {string|null}
365
- */
366
- title : null,
367
-
368
- /**
369
- * Cell data type (one of keys in `data_types`).
370
- * @type {DataType}
371
- */
372
- dataType : 'string',
373
-
374
- /**
375
- * Class to assign to the cell; overrides default for the data type.
376
- * @type {string|null}
377
- */
378
- className : null,
379
-
380
- /**
381
- * Custom rendering function for the cell.
382
- * @type {Function|null}
383
- */
384
- render : null,
385
-
386
- /**
387
- * Parsing function applied to the raw value before rendering.
388
- * @type {Function|null}
389
- */
390
- parse : null,
391
-
392
- /**
393
- * If true, render cell as a row heading (th[scope=row]).
394
- * @type {boolean}
395
- */
396
- rowHeading : false,
397
-
398
- /**
399
- * If false, cell won't be rendered in the tfoot element.
400
- * @type {boolean}
401
- */
402
- tfoot : true,
403
-
404
- /**
405
- * If true, column content is searchable.
406
- * @type {boolean}
407
- */
408
- searchable : true,
409
-
410
- /**
411
- * If true, column content is sortable.
412
- * @type {boolean}
413
- */
414
- sortable : true,
415
-
416
- /**
417
- * Custom sort function for static tables; should match default parser signature.
418
- * @type {Function|null}
419
- */
420
- sortValueCustomParser : null,
421
-
422
- /**
423
- * Custom search function for static tables; should match default parser signature.
424
- * @type {Function|null}
425
- */
426
- searchValueCustomParser : null,
427
- };
428
-
429
-
430
- /**
431
- * ajax config default options.
432
- * Defaults values are referred to datatables keys
433
- * @typedef {Object} AjaxConfigDefault
434
- */
435
-
436
- export const ajax_config_default = {
437
-
438
-
439
- /**
440
- * Config for ajax url
441
- * @type {Object|null}
442
- */
443
- urlParamsKeys: {
444
-
445
-
446
- /**
447
- * Key for start item, record or page, of the returned data
448
- * @type {string|null}
449
- */
450
- startItem: `start`,
451
-
452
- /**
453
- * Key for number of record to be returned
454
- * @type {string|null}
455
- */
456
- perPage : 'length',
457
-
458
- /**
459
- * Key for search strings
460
- * @type {string|null}
461
- */
462
- search : 'search[value]',
463
-
464
- // TODO columns + order
465
- },
466
-
467
- urlParams: {
468
- /**
469
- * array of static item to be appended to query string
470
- * Each item is a key-value array
471
- * @type {array|null}
472
- */
473
- staticValues: [['draw', 1]],
474
-
475
- perPageValue: 25
476
-
477
- },
478
-
479
-
480
- /**
481
- * Config for returned object keys
482
- * @type {Object|null}
483
- */
484
- jsonKeys: {
485
- /**
486
- * array of static item to be appended to returned object
487
- * Each item is a key-value array
488
- * @type {array|null}
489
- */
490
- staticParams: [['draw', 1]],
491
-
492
- /**
493
- * Key for number of records found
494
- * @type {string|null}
495
- */
496
- totRec : 'recordsTotal',
497
-
498
- /**
499
- * Key for number of records found when filtered by search
500
- * @type {string|null}
501
- */
502
- totRecFiltered : 'recordsFiltered',
503
-
504
- /**
505
- * Key for data object
506
- * @type {string|null}
507
- */
508
- data : 'data',
509
- }
510
- }
@@ -1,72 +0,0 @@
1
- export async function getAjaxData(urlParams = {}){
2
-
3
- urlParams = {
4
- ...{
5
- startValue: 0,
6
- searchValue: null
7
- },
8
- ...urlParams
9
- };
10
-
11
-
12
- /* urlParamsKeys: {
13
-
14
-
15
-
16
- startItem: `start`,
17
-
18
-
19
- perPage : 'length',
20
-
21
-
22
- search : 'search[value]',
23
-
24
- // TODO columns + order
25
- },
26
-
27
- urlParams: {
28
-
29
- staticValues: [['draw', 1]],
30
-
31
- perPageValue: 25,
32
-
33
-
34
- }, */
35
-
36
- const searchParams = new URLSearchParams({
37
- [this.params.ajaxConfig.urlParamsKeys.startItem]: urlParams.startValue,
38
- [this.params.ajaxConfig.urlParamsKeys.perPage]: this.params.ajaxConfig.urlParams.perPageValue,
39
-
40
- ...(urlParams.searchValue != null
41
- ? {[this.params.ajaxConfig.urlParamsKeys.search]: urlParams.searchValue}
42
- : {}
43
- ),
44
-
45
- ...(
46
- (this.params.ajaxConfig.urlParams.staticValues != null && Array.isArray(this.params.ajaxConfig.urlParams.staticValues))
47
- ? this.params.ajaxConfig.urlParams.staticValues.map(i => ({[i[0]]: i[1]}))
48
- : {}
49
- ),
50
-
51
- '_': Date.now()
52
- });
53
-
54
-
55
- const url = new URL(this.params.ajaxUrl);
56
- url.search = searchParams.toString();
57
-
58
- try {
59
- const response = await fetch(url.toString());
60
-
61
- this.params.data = await response.json();
62
-
63
-
64
- } catch(err) {
65
- /* eslint-disable no-console */
66
- console.error(url);
67
- console.error(err);
68
- /* eslint-enable no-console */
69
- }
70
-
71
-
72
- }
@@ -1,39 +0,0 @@
1
- import * as styles from '../css/info-section.module.css';
2
- import { classnames } from '@massimo-cassandro/js-utilities/index.js';
3
-
4
- export function infoSection() {
5
-
6
- return [
7
- {
8
- // TODO gestire this.params.stickyInfo
9
-
10
- className: classnames(styles.infoOuterContainer, this.params.outerInfoExtraClassName),
11
- children: [
12
- {
13
- className: classnames(styles.infoContainer, this.params.infoExtraClassName),
14
- children: [
15
- {
16
- className: styles.resultInfo,
17
- callback: el => this.params.elements.info = el
18
- },
19
- {
20
- condition: this.params.search,
21
-
22
- tag: [`div.${styles.search}`, 'input'],
23
- className: this.params.searchInputAltClassName?? classnames(styles.searchInput, this.params.searchInputExtraClassName),
24
- callback: el => this.params.elements.searchInput = el,
25
- attrs: {
26
- type: 'search',
27
- title: this.params.searchInputTitle,
28
- placeholder: this.params.searchInputPlaceholder,
29
- 'aria-label': this.params.searchInputAriaLabel
30
- }
31
- }
32
- ]
33
- }
34
- ]
35
- }
36
- ];
37
-
38
- }
39
-
@@ -1,30 +0,0 @@
1
- import { ajax_config_default } from './js/defaults.js';
2
-
3
- export async function initAjaxTable(){
4
-
5
- try {
6
-
7
- if(!this.params.ajaxUrl) {
8
- throw 'Missing `ajaxUrl` parameter';
9
- }
10
-
11
- if(this.params.ajaxConfig === null) {
12
- this.params.ajaxConfig = structuredClone(ajax_config_default);
13
-
14
- } else {
15
-
16
- Object.keys(ajax_config_default).forEach(k => {
17
- this.params.ajaxConfig[k] = {
18
- ...ajax_config_default[k],
19
- ...(this.params.ajaxConfig[k]?? {})
20
- }
21
- });
22
- }
23
-
24
- } catch(e) {
25
- console.error( e ); // eslint-disable-line
26
-
27
- }
28
-
29
-
30
- }
@@ -1,18 +0,0 @@
1
- export function initStaticTable() {
2
-
3
- this.params.data = this.params.data.map((row, idx) => this.parseDataRow({
4
- dataRow: row,
5
- idx: idx,
6
- }));
7
-
8
- if (this.params.footerData.length) {
9
- this.params.footerData = this.params.footerData.map((row, idx) => this.parseDataRow({
10
- dataRow: row,
11
- idx: idx,
12
- isTbody: false
13
- }));
14
- }
15
-
16
- // first sorting
17
- this.params.data = this.staticDataSorting(true);
18
- }