@massimo-cassandro/minimo 1.5.11 → 1.5.13

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/TODO.md CHANGED
@@ -2,3 +2,6 @@ completare
2
2
  aggionare la documentazione e aggiungere i test a demo (in _wrk)
3
3
 
4
4
  implementare tooltip nativo nei file svg, ora viene aggiunto un data-title, ma non è gestito
5
+
6
+
7
+ aggiungere export specifico in package.json
@@ -45,25 +45,6 @@ export function polarToCartesianString(degrees_angle, cx, cy, circleRadius) {
45
45
  }
46
46
 
47
47
 
48
- // TODO unificare con classnames globale
49
- /**
50
- * Concatena i nomi delle classi filtrando i valori falsy.
51
- * @param {...any} args - I nomi delle classi o condizioni.
52
- * @returns {string} Una stringa di nomi di classi separati da spazio.
53
- */
54
- export function classnames(...args) {
55
- return args.filter(Boolean).join(' ');
56
- }
57
-
58
- /**
59
- * Concatena i nomi delle classi filtrando i valori falsy; restituisce null se il risultato è una stringa vuota.
60
- * @param {...any} args - I nomi delle classi o condizioni.
61
- * @returns {string|null} Una stringa di nomi di classi o null.
62
- */
63
- export function classnamesNull(...args) {
64
- return args.filter(Boolean).join(' ') || null;
65
- }
66
-
67
48
  /**
68
49
  * Calcola le coordinate per un elemento `path` di tipo arco (arc).
69
50
  * Lo `start_angle` è il punto di inizio e `percentage` è la lunghezza percentuale dell'arco rispetto a `max_angle`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@massimo-cassandro/minimo",
3
- "version": "1.5.11",
3
+ "version": "1.5.13",
4
4
  "description": "Light css framework & utilities",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -1,3 +1,14 @@
1
1
  export function classnames(...args) {
2
- return args.filter(Boolean).join(' ');
2
+ return args.flat().filter(x => {
3
+ if (x && typeof x !== 'string') {
4
+ // eslint-disable-next-line no-console
5
+ console.error('[classnames] valore non stringa ignorato in ', ...args);
6
+ return false;
7
+ }
8
+ return Boolean(x);
9
+ }).join(' ');
10
+ }
11
+
12
+ export function classnamesNull(...args) {
13
+ return classnames(...args) || null;
3
14
  }