@rufous/ui 0.2.96 → 0.2.97
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/dist/main.cjs +8 -3
- package/dist/main.js +8 -3
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -4666,9 +4666,14 @@ function DataGrid({
|
|
|
4666
4666
|
const headers = exportableCols.map((c) => c.headerName).join(",");
|
|
4667
4667
|
const rows = sortedData.map(
|
|
4668
4668
|
(item) => exportableCols.map((c) => {
|
|
4669
|
-
const
|
|
4670
|
-
const
|
|
4671
|
-
|
|
4669
|
+
const field = String(c.field);
|
|
4670
|
+
const raw = item[field];
|
|
4671
|
+
let val = c.valueGetter ? c.valueGetter({ value: raw, row: item, field }) : raw;
|
|
4672
|
+
if (c.valueFormatter) {
|
|
4673
|
+
val = c.valueFormatter({ value: val, row: item, field });
|
|
4674
|
+
}
|
|
4675
|
+
const str = val === null || val === void 0 ? "" : String(val).replace(/"/g, '""');
|
|
4676
|
+
return `"${str}"`;
|
|
4672
4677
|
}).join(",")
|
|
4673
4678
|
);
|
|
4674
4679
|
const csv = [headers, ...rows].join("\n");
|
package/dist/main.js
CHANGED
|
@@ -4536,9 +4536,14 @@ function DataGrid({
|
|
|
4536
4536
|
const headers = exportableCols.map((c) => c.headerName).join(",");
|
|
4537
4537
|
const rows = sortedData.map(
|
|
4538
4538
|
(item) => exportableCols.map((c) => {
|
|
4539
|
-
const
|
|
4540
|
-
const
|
|
4541
|
-
|
|
4539
|
+
const field = String(c.field);
|
|
4540
|
+
const raw = item[field];
|
|
4541
|
+
let val = c.valueGetter ? c.valueGetter({ value: raw, row: item, field }) : raw;
|
|
4542
|
+
if (c.valueFormatter) {
|
|
4543
|
+
val = c.valueFormatter({ value: val, row: item, field });
|
|
4544
|
+
}
|
|
4545
|
+
const str = val === null || val === void 0 ? "" : String(val).replace(/"/g, '""');
|
|
4546
|
+
return `"${str}"`;
|
|
4542
4547
|
}).join(",")
|
|
4543
4548
|
);
|
|
4544
4549
|
const csv = [headers, ...rows].join("\n");
|