@massimo-cassandro/minimo 0.12.3 → 0.12.4
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
|
@@ -34,7 +34,7 @@ import caretRightIcon from '../../icons/caret-right.svg?inline';
|
|
|
34
34
|
* - stringa mustache-like con segnaposto `[[key]]`
|
|
35
35
|
* (i segnaposto vengono sostituiti con i valori della riga corrente)
|
|
36
36
|
* - funzione `(row) => string` (riceve l'oggetto riga corrente)
|
|
37
|
-
* @property {string|Function} [
|
|
37
|
+
* @property {string|Function} [_cellRender] stringa o funzione per renderizzare il contenuto della cella.
|
|
38
38
|
* Accetta:
|
|
39
39
|
* - stringa mustache-like con segnaposto `[[key]]`
|
|
40
40
|
* (sostituiti con i valori dell'oggetto riga;
|
|
@@ -54,7 +54,7 @@ import caretRightIcon from '../../icons/caret-right.svg?inline';
|
|
|
54
54
|
* @property {string} [_renderNullAs] Stringa da mostrare al posto di valori null/undefined.
|
|
55
55
|
* Default: `'—'` (trattino em).
|
|
56
56
|
* Applicato al valore della cella e ai segnaposto
|
|
57
|
-
* di `
|
|
57
|
+
* di `_cellRender` che si risolvono a null.
|
|
58
58
|
* @property {'id'|'email'|'sf_datetime'} [_renderMode]
|
|
59
59
|
* Modalità di visualizzazione predefinita:
|
|
60
60
|
* - `id` – colonna numerica, non ricercabile, allineata a destra
|
|
@@ -440,12 +440,13 @@ class SimpleDatatableAdapter extends HTMLElement {
|
|
|
440
440
|
: null;
|
|
441
441
|
|
|
442
442
|
|
|
443
|
-
//
|
|
443
|
+
// _cellRender: template per il rendering del valore.
|
|
444
444
|
// Accetta stringa mustache-like ([[key]]) o funzione (row) => string.
|
|
445
445
|
// Delega a resolveTemplate, passando nullAs e l'indice di colonna
|
|
446
446
|
// per i warning di chiavi mancanti.
|
|
447
|
-
if (col_item.
|
|
448
|
-
|
|
447
|
+
if (col_item._cellRender) {
|
|
448
|
+
col_item.render = null; // se presente lo annulla ad evitare conflitti
|
|
449
|
+
value = resolveTemplate(col_item._cellRender, row, { nullAs, warnColIdx: col_idx });
|
|
449
450
|
|
|
450
451
|
} else if (col_item._renderMode === 'sf_datetime' && value != null) {
|
|
451
452
|
value = value.date.replace(' ', 'T') +
|
|
@@ -454,7 +455,7 @@ class SimpleDatatableAdapter extends HTMLElement {
|
|
|
454
455
|
|
|
455
456
|
// Applica _renderNullAs al valore della cella se null/undefined
|
|
456
457
|
// e la cella non ha già un template che gestisce la visualizzazione.
|
|
457
|
-
if (value == null && col_item.
|
|
458
|
+
if (value == null && col_item._cellRender == null) {
|
|
458
459
|
value = nullAs;
|
|
459
460
|
}
|
|
460
461
|
|