@massimo-cassandro/minimo 1.43.1 → 1.43.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.
- package/charts/src/helpers/parse-std-axis-opts.js +2 -1
- package/charts/src/lines.js +12 -0
- package/dev-tools/starter-kit/source_files/root/package-tpl.json +2 -1
- package/dev-tools/starter-kit/source_files/root/webpack.config.mjs +24 -17
- package/package.json +1 -1
- package/src/css/grid.css +16 -4
- package/types/classes.d.ts +5 -0
|
@@ -25,6 +25,7 @@ export function parseStdAxisOpts(params = {} ) {
|
|
|
25
25
|
values: [], // array flat dei valori per il calcolo di maxValues e minValues, qualora fossero null
|
|
26
26
|
legenda: null,
|
|
27
27
|
padding: 0, // spazio intorno ai bordi del grafico
|
|
28
|
+
padding_right: null, // padding del solo lato destro; se null viene usato `padding`
|
|
28
29
|
width: null, // width e height non possono essere null, vanno verificate prima
|
|
29
30
|
height: null,
|
|
30
31
|
eti_asseX_height: null, // non può essere null, va verificato prima
|
|
@@ -96,7 +97,7 @@ export function parseStdAxisOpts(params = {} ) {
|
|
|
96
97
|
// i lati sx e inferiore corrispondono agli assi
|
|
97
98
|
parsed.chart_area = {
|
|
98
99
|
top : legenda_height + gap_legenda + params.padding, // coordinata y superiore
|
|
99
|
-
right : params.width - params.padding, // coordinata x dx
|
|
100
|
+
right : params.width - (params.padding_right?? params.padding), // coordinata x dx
|
|
100
101
|
bottom : params.height - params.eti_asseX_height - params.ticksLength - params.padding, // coordinata y inferiore
|
|
101
102
|
left : params.eti_asseY_width + params.ticksLength + params.padding // coordinata x sx
|
|
102
103
|
};
|
package/charts/src/lines.js
CHANGED
|
@@ -274,6 +274,17 @@ export async function lines(params) {
|
|
|
274
274
|
.viewbox(0, 0, params.width, params.height)
|
|
275
275
|
.attr({...params.svgAttrs});
|
|
276
276
|
|
|
277
|
+
/*
|
|
278
|
+
L'ultimo punto di ogni linea cade sul limite destro della chart area:
|
|
279
|
+
se il padding è inferiore al raggio massimo dei punti, il cerchio verrebbe tagliato dal bordo dell'svg.
|
|
280
|
+
In tal caso il padding destro viene portato al raggio massimo.
|
|
281
|
+
*/
|
|
282
|
+
const radii = Array.isArray(params.data_points_attrs.r)
|
|
283
|
+
? params.data_points_attrs.r
|
|
284
|
+
: [params.data_points_attrs.r];
|
|
285
|
+
const maxPointRadius = Math.max(0, ...radii.map(r => Number(r) || 0));
|
|
286
|
+
const paddingRight = Math.max(params.padding, maxPointRadius);
|
|
287
|
+
|
|
277
288
|
// pre-elaborazione e calcolo di alcuni elementi (chartArea)
|
|
278
289
|
// nuove variabili definite da parseStdAxisOpts
|
|
279
290
|
const {
|
|
@@ -291,6 +302,7 @@ export async function lines(params) {
|
|
|
291
302
|
values: flatValues,
|
|
292
303
|
legenda: params.legenda,
|
|
293
304
|
padding: params.padding,
|
|
305
|
+
padding_right: paddingRight,
|
|
294
306
|
width: params.width,
|
|
295
307
|
height: params.height,
|
|
296
308
|
eti_asseX_height: params.xAxisLabelHeight,
|
|
@@ -103,21 +103,27 @@ const isDevelopment = process.env.NODE_ENV === 'development'
|
|
|
103
103
|
,minimo_path = './node_modules/@massimo-cassandro/minimo' // fromProjectRoot('node_modules/@massimo-cassandro/minimo')
|
|
104
104
|
|
|
105
105
|
,usePurgeCss = true // false per disattivare PurgeCSS (debug rapido di problemi legati al purge)
|
|
106
|
+
,purgeCssInDev = false
|
|
106
107
|
,purgeCSSOptions = {
|
|
107
108
|
keyframes: true, // rimuove i @keyframes non referenziati
|
|
108
109
|
debug: false // true per loggare i selettori rimossi da PurgeCSS a fine build
|
|
109
110
|
}
|
|
110
111
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
112
|
+
/*
|
|
113
|
+
plugin per l'estrazione ottimizzata delle custom properties (vedi
|
|
114
|
+
webpack-config-modules/custom-props-purgecss-plugin.mjs): dopo la
|
|
115
|
+
minificazione inietta nei css compilati SOLO le definizioni di custom
|
|
116
|
+
properties effettivamente usate, prese dal file master. I css del progetto
|
|
117
|
+
contengono quindi solo usi `var(--nome)`, mai definizioni (custom-properties.css
|
|
118
|
+
NON va importato nelle entry css). Se false il plugin non viene nemmeno
|
|
119
|
+
caricato e la gestione delle custom properties resta a carico del progetto
|
|
120
|
+
*/
|
|
118
121
|
,useCustomPropsPlugin = true
|
|
119
|
-
|
|
120
|
-
|
|
122
|
+
|
|
123
|
+
/*
|
|
124
|
+
file master con TUTTE le definizioni di custom properties disponibili
|
|
125
|
+
(copiato da minimo da starter-install.sh, generato da `npm run 'build tokens'`)
|
|
126
|
+
*/
|
|
121
127
|
,customPropsFile = path.resolve(__dirname, './app/css/custom-properties.css')
|
|
122
128
|
|
|
123
129
|
/*
|
|
@@ -143,14 +149,15 @@ const isDevelopment = process.env.NODE_ENV === 'development'
|
|
|
143
149
|
*/
|
|
144
150
|
,standaloneEntries = []
|
|
145
151
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
/*
|
|
153
|
+
PurgeCSS e plugin custom properties lavorano sugli asset css finali:
|
|
154
|
+
in dev, con `false`, sono entrambi disattivati (build più veloce, css
|
|
155
|
+
iniettato con style-loader; se `useCustomPropsPlugin` è true le definizioni
|
|
156
|
+
vengono aggiunte per intero alle entry, vedi `parsedEntries`).
|
|
157
|
+
Con `purgeCssInDev = true` (a scopo di test) sono attivi come in produzione (secondo i
|
|
158
|
+
rispettivi flag `usePurgeCss` / `useCustomPropsPlugin`) e `inlineCssInDevMode`
|
|
159
|
+
viene forzato a false
|
|
160
|
+
*/
|
|
154
161
|
,runCustomPropsPlugin = useCustomPropsPlugin && (!isDevelopment || purgeCssInDev)
|
|
155
162
|
// ,manifest_shared_seed = {}
|
|
156
163
|
;
|
package/package.json
CHANGED
package/src/css/grid.css
CHANGED
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
.grid {
|
|
4
4
|
--_cols: 1;
|
|
5
|
-
/* --_min-col-width: calc((100% - calc(var(--_cols) * var(--flex-grid-gap))) / var(--grid-cols)); NB custom prop rimossa */
|
|
6
5
|
|
|
7
6
|
display: grid;
|
|
8
|
-
/* grid-template-columns: repeat(var(--_cols), minmax(var(--grid-min-col-width), 1fr)); NB custom prop rimossa */
|
|
9
7
|
grid-template-columns: repeat(var(--_cols), minmax(0, 1fr));
|
|
10
8
|
grid-auto-flow: row;
|
|
11
9
|
gap: var(--flex-grid-gap);
|
|
@@ -28,7 +26,7 @@
|
|
|
28
26
|
@media (--media-large-viewport-up) {
|
|
29
27
|
--_cols: 4;
|
|
30
28
|
|
|
31
|
-
/* versione a
|
|
29
|
+
/* versione a 2-10 colonne */
|
|
32
30
|
&.grid-2 {
|
|
33
31
|
--_cols: 2;
|
|
34
32
|
}
|
|
@@ -44,9 +42,18 @@
|
|
|
44
42
|
&.grid-6 {
|
|
45
43
|
--_cols: 6;
|
|
46
44
|
}
|
|
45
|
+
&.grid-7 {
|
|
46
|
+
--_cols: 6;
|
|
47
|
+
}
|
|
47
48
|
&.grid-8 {
|
|
48
49
|
--_cols: 8;
|
|
49
50
|
}
|
|
51
|
+
&.grid-9 {
|
|
52
|
+
--_cols: 9;
|
|
53
|
+
}
|
|
54
|
+
&.grid-10 {
|
|
55
|
+
--_cols: 10;
|
|
56
|
+
}
|
|
50
57
|
|
|
51
58
|
> .span-2 {
|
|
52
59
|
grid-column-end: span 2;
|
|
@@ -54,10 +61,15 @@
|
|
|
54
61
|
> .span-3 {
|
|
55
62
|
grid-column-end: span 3;
|
|
56
63
|
}
|
|
57
|
-
|
|
58
64
|
> .span-4 {
|
|
59
65
|
grid-column-end: span 4;
|
|
60
66
|
}
|
|
67
|
+
> .span-5 {
|
|
68
|
+
grid-column-end: span 5;
|
|
69
|
+
}
|
|
70
|
+
> .span-6 {
|
|
71
|
+
grid-column-end: span 6;
|
|
72
|
+
}
|
|
61
73
|
} /* end @media */
|
|
62
74
|
|
|
63
75
|
/* grid items */
|
package/types/classes.d.ts
CHANGED
|
@@ -76,12 +76,15 @@ export type MinimoClass =
|
|
|
76
76
|
| 'gap-0'
|
|
77
77
|
| 'gap-2'
|
|
78
78
|
| 'grid'
|
|
79
|
+
| 'grid-10'
|
|
79
80
|
| 'grid-2'
|
|
80
81
|
| 'grid-3'
|
|
81
82
|
| 'grid-4'
|
|
82
83
|
| 'grid-5'
|
|
83
84
|
| 'grid-6'
|
|
85
|
+
| 'grid-7'
|
|
84
86
|
| 'grid-8'
|
|
87
|
+
| 'grid-9'
|
|
85
88
|
| 'grid-full-row'
|
|
86
89
|
| 'grid-item-last'
|
|
87
90
|
| 'grid-new-row'
|
|
@@ -854,6 +857,8 @@ export type MinimoClass =
|
|
|
854
857
|
| 'span-2'
|
|
855
858
|
| 'span-3'
|
|
856
859
|
| 'span-4'
|
|
860
|
+
| 'span-5'
|
|
861
|
+
| 'span-6'
|
|
857
862
|
| 'spinner'
|
|
858
863
|
| 'table'
|
|
859
864
|
| 'table-bordered'
|