@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 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 raw = item[c.field];
4670
- const val = raw === null || raw === void 0 ? "" : String(raw).replace(/"/g, '""');
4671
- return `"${val}"`;
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 raw = item[c.field];
4540
- const val = raw === null || raw === void 0 ? "" : String(raw).replace(/"/g, '""');
4541
- return `"${val}"`;
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");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rufous/ui",
3
3
  "private": false,
4
- "version": "0.2.96",
4
+ "version": "0.2.97",
5
5
  "type": "module",
6
6
  "description": "Experimental: A lightweight React UI component library (Beta)",
7
7
  "style": "./dist/main.css",