@massimo-cassandro/minimo 0.12.5 → 0.12.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@massimo-cassandro/minimo",
3
- "version": "0.12.5",
3
+ "version": "0.12.7",
4
4
  "description": "Light css framework & utilities",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/massimo-cassandro/minimo#readme",
@@ -251,6 +251,22 @@ class SimpleDatatableAdapter extends HTMLElement {
251
251
  }
252
252
  }
253
253
 
254
+ /**
255
+ * Distrugge l'istanza DataTable interna e svuota il componente.
256
+ * Equivale a datatable.destroy() di simple-datatables.
257
+ * Dopo la chiamata è possibile richiamare init() per reinizializzare
258
+ * la tabella con nuovi dati o colonne, senza ricreare l'elemento.
259
+ */
260
+ destroy() {
261
+ if (this._dt) {
262
+ this._dt.destroy();
263
+ this._dt = null;
264
+ }
265
+ this._loadStarted = false;
266
+ this._loadGeneration++;
267
+ this.innerHTML = '';
268
+ }
269
+
254
270
  /**
255
271
  * Restituisce l'istanza DataTable interna di simple-datatables.
256
272
  * Utile per operazioni non coperte dall'API del componente.
@@ -469,9 +485,13 @@ class SimpleDatatableAdapter extends HTMLElement {
469
485
  (value.timezone === 'UTC' ? 'Z' : '');
470
486
  }
471
487
 
488
+
489
+ // TODO rendere più snella la gestione di questoi casi (???)
490
+ // TODO pasare il valore `nullAs` al render predefinito
472
491
  // Applica _renderNullAs al valore della cella se null/undefined
473
492
  // e la cella non ha già un template che gestisce la visualizzazione.
474
- if (value == null && col_item._cellRender == null) {
493
+ // se _renderMode è impostato, il valore null è gestito direttamente dal gestore predefinito
494
+ if (value == null && col_item._cellRender == null && col_item._renderMode == null) {
475
495
  value = nullAs;
476
496
  }
477
497