@ceed/ads 0.0.57 → 0.0.58
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ComponentProps, ReactNode } from "react";
|
|
2
2
|
import { Table } from "../Table";
|
|
3
|
-
type Column<T extends Record<string, unknown
|
|
3
|
+
type Column<T extends Record<string, V>, V = unknown> = {
|
|
4
4
|
type?: "number" | "string";
|
|
5
5
|
field: keyof T;
|
|
6
6
|
headerName?: string;
|
|
@@ -8,7 +8,10 @@ type Column<T extends Record<string, unknown>> = {
|
|
|
8
8
|
minWidth?: string;
|
|
9
9
|
maxWidth?: string;
|
|
10
10
|
resizable?: boolean;
|
|
11
|
-
renderCell?: (
|
|
11
|
+
renderCell?: (params: {
|
|
12
|
+
row: T;
|
|
13
|
+
value?: V;
|
|
14
|
+
}) => ReactNode;
|
|
12
15
|
};
|
|
13
16
|
type DataTableProps<T extends Record<string, unknown>> = {
|
|
14
17
|
rows: T[];
|
package/dist/index.js
CHANGED
|
@@ -1477,7 +1477,7 @@ function DataTable(props) {
|
|
|
1477
1477
|
textAlign: column.type === "number" ? "end" : "start"
|
|
1478
1478
|
}
|
|
1479
1479
|
},
|
|
1480
|
-
column.renderCell?.(row) ?? row[column.field]
|
|
1480
|
+
column.renderCell?.({ row, value: row[column.field] }) ?? row[column.field]
|
|
1481
1481
|
))
|
|
1482
1482
|
);
|
|
1483
1483
|
})), Footer && /* @__PURE__ */ React10.createElement(Footer, null))
|
package/framer/index.js
CHANGED
|
@@ -38389,7 +38389,7 @@ function DataTable(props) {
|
|
|
38389
38389
|
style: {
|
|
38390
38390
|
textAlign: column2.type === "number" ? "end" : "start"
|
|
38391
38391
|
},
|
|
38392
|
-
children: (_b = (_a2 = column2.renderCell) == null ? void 0 : _a2.call(column2, row)) != null ? _b : row[column2.field]
|
|
38392
|
+
children: (_b = (_a2 = column2.renderCell) == null ? void 0 : _a2.call(column2, { row, value: row[column2.field] })) != null ? _b : row[column2.field]
|
|
38393
38393
|
},
|
|
38394
38394
|
column2.field
|
|
38395
38395
|
);
|