@massimo-cassandro/minimo 0.11.7 → 0.11.8
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
|
@@ -384,20 +384,22 @@ class SimpleDatatableAdapter extends HTMLElement {
|
|
|
384
384
|
.join(' ')
|
|
385
385
|
: null;
|
|
386
386
|
|
|
387
|
-
|
|
388
|
-
console.log('col:', col_item._heading, '| value:', value, '| sortValue:', sortValue, '| searchValue:', searchValue);
|
|
389
|
-
|
|
390
|
-
|
|
391
387
|
// Se sono definiti _sortValue o _searchValue, restituisce un
|
|
392
388
|
// oggetto cella strutturato; altrimenti il valore grezzo.
|
|
393
389
|
// Se sono definiti _sortValue o _searchValue, restituisce un
|
|
394
390
|
// oggetto cella strutturato con attributi data-order / data-search
|
|
395
391
|
// che simple-datatables può leggere in modo affidabile.
|
|
392
|
+
// Se sono definiti _sortValue o _searchValue, restituisce un
|
|
393
|
+
// oggetto cellType strutturato secondo le API di simple-datatables:
|
|
394
|
+
// { data, order?, attributes? }
|
|
395
|
+
// - `data` → contenuto visualizzato (obbligatorio)
|
|
396
|
+
// - `order` → valore alternativo per l'ordinamento (campo nativo)
|
|
397
|
+
// - `attributes['data-search']` → valore per searchMethod
|
|
396
398
|
if (sortValue !== null || searchValue !== null) {
|
|
397
|
-
const
|
|
398
|
-
if (sortValue !== null)
|
|
399
|
-
if (searchValue !== null)
|
|
400
|
-
return
|
|
399
|
+
const cellObj = { data: value ?? '' };
|
|
400
|
+
if (sortValue !== null) cellObj.order = sortValue;
|
|
401
|
+
if (searchValue !== null) cellObj.attributes = { 'data-search': searchValue };
|
|
402
|
+
return cellObj;
|
|
401
403
|
}
|
|
402
404
|
|
|
403
405
|
return value;
|