@obolnetwork/obol-ui 1.0.26 → 1.0.27
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,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { CSS } from "../../../stitches.config";
|
|
2
3
|
export declare type RowDef<T> = {
|
|
3
4
|
id: string;
|
|
4
5
|
isRemovable?: boolean;
|
|
@@ -16,6 +17,7 @@ export declare type CellDef = {
|
|
|
16
17
|
export declare type ColumnDef<T> = {
|
|
17
18
|
accessorKey: keyof T;
|
|
18
19
|
header: string | React.ReactNode;
|
|
20
|
+
css?: CSS;
|
|
19
21
|
cell?: CellDef;
|
|
20
22
|
};
|
|
21
23
|
export interface TableProps {
|
package/dist/index.es.js
CHANGED
|
@@ -2007,7 +2007,10 @@ var AddNewRow = function (_a) {
|
|
|
2007
2007
|
};
|
|
2008
2008
|
var SplitterTable = function (_a) {
|
|
2009
2009
|
var rows = _a.rows, columns = _a.columns, onAddRow = _a.onAddRow, onRemoveRow = _a.onRemoveRow, onUpdateRow = _a.onUpdateRow, _b = _a.totalSplitFooter, totalSplitFooter = _b === void 0 ? 100 : _b;
|
|
2010
|
-
return (jsxs(StyledTable, { children: [jsx("thead", { children: jsxs("tr", { children: [jsx(Th, {}), columns.map(function (
|
|
2010
|
+
return (jsxs(StyledTable, { children: [jsx("thead", { children: jsxs("tr", { children: [jsx(Th, {}), columns.map(function (_a, index) {
|
|
2011
|
+
var css = _a.css, column = __rest(_a, ["css"]);
|
|
2012
|
+
return (jsx(Th, __assign({ css: __assign({ textAlign: "start" }, css) }, { children: column.header }), "header-".concat(index)));
|
|
2013
|
+
}), jsx(Th, {})] }) }), jsxs("tbody", { children: [rows.map(function (_a, rowIndex) {
|
|
2011
2014
|
var _b = _a.isRemovable, isRemovable = _b === void 0 ? true : _b, _c = _a.isEditable, isEditable = _c === void 0 ? true : _c, row = __rest(_a, ["isRemovable", "isEditable"]);
|
|
2012
2015
|
return (jsxs("tr", { children: [jsx(Td, __assign({ textCenter: true, size: "sm" }, { children: rowIndex + 1 })), columns.map(function (column, cellIndex) {
|
|
2013
2016
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -2059,7 +2062,10 @@ var SplitterTable = function (_a) {
|
|
|
2059
2062
|
};
|
|
2060
2063
|
var Table = function (_a) {
|
|
2061
2064
|
var rows = _a.rows, columns = _a.columns;
|
|
2062
|
-
return (jsxs(StyledTable, { children: [jsx("thead", { children: jsx("tr", { children: columns.map(function (
|
|
2065
|
+
return (jsxs(StyledTable, { children: [jsx("thead", { children: jsx("tr", { children: columns.map(function (_a, index) {
|
|
2066
|
+
var css = _a.css, column = __rest(_a, ["css"]);
|
|
2067
|
+
return (jsx(Th, __assign({ css: __assign({ textAlign: "start" }, css) }, { children: column.header }), "header-".concat(index)));
|
|
2068
|
+
}) }) }), jsx("tbody", { children: rows.map(function (row, rowIndex) { return (jsx("tr", { children: columns.map(function (column, cellIndex) {
|
|
2063
2069
|
return (jsx(Td, __assign({ css: { color: "$light" } }, { children: row[column.accessorKey] }), "cell ".concat(cellIndex)));
|
|
2064
2070
|
}) }, "row ".concat(rowIndex))); }) })] }));
|
|
2065
2071
|
};
|
package/dist/index.js
CHANGED
|
@@ -2039,7 +2039,10 @@ var AddNewRow = function (_a) {
|
|
|
2039
2039
|
};
|
|
2040
2040
|
var SplitterTable = function (_a) {
|
|
2041
2041
|
var rows = _a.rows, columns = _a.columns, onAddRow = _a.onAddRow, onRemoveRow = _a.onRemoveRow, onUpdateRow = _a.onUpdateRow, _b = _a.totalSplitFooter, totalSplitFooter = _b === void 0 ? 100 : _b;
|
|
2042
|
-
return (jsxRuntime.jsxs(StyledTable, { children: [jsxRuntime.jsx("thead", { children: jsxRuntime.jsxs("tr", { children: [jsxRuntime.jsx(Th, {}), columns.map(function (
|
|
2042
|
+
return (jsxRuntime.jsxs(StyledTable, { children: [jsxRuntime.jsx("thead", { children: jsxRuntime.jsxs("tr", { children: [jsxRuntime.jsx(Th, {}), columns.map(function (_a, index) {
|
|
2043
|
+
var css = _a.css, column = __rest(_a, ["css"]);
|
|
2044
|
+
return (jsxRuntime.jsx(Th, __assign({ css: __assign({ textAlign: "start" }, css) }, { children: column.header }), "header-".concat(index)));
|
|
2045
|
+
}), jsxRuntime.jsx(Th, {})] }) }), jsxRuntime.jsxs("tbody", { children: [rows.map(function (_a, rowIndex) {
|
|
2043
2046
|
var _b = _a.isRemovable, isRemovable = _b === void 0 ? true : _b, _c = _a.isEditable, isEditable = _c === void 0 ? true : _c, row = __rest(_a, ["isRemovable", "isEditable"]);
|
|
2044
2047
|
return (jsxRuntime.jsxs("tr", { children: [jsxRuntime.jsx(Td, __assign({ textCenter: true, size: "sm" }, { children: rowIndex + 1 })), columns.map(function (column, cellIndex) {
|
|
2045
2048
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -2091,7 +2094,10 @@ var SplitterTable = function (_a) {
|
|
|
2091
2094
|
};
|
|
2092
2095
|
var Table = function (_a) {
|
|
2093
2096
|
var rows = _a.rows, columns = _a.columns;
|
|
2094
|
-
return (jsxRuntime.jsxs(StyledTable, { children: [jsxRuntime.jsx("thead", { children: jsxRuntime.jsx("tr", { children: columns.map(function (
|
|
2097
|
+
return (jsxRuntime.jsxs(StyledTable, { children: [jsxRuntime.jsx("thead", { children: jsxRuntime.jsx("tr", { children: columns.map(function (_a, index) {
|
|
2098
|
+
var css = _a.css, column = __rest(_a, ["css"]);
|
|
2099
|
+
return (jsxRuntime.jsx(Th, __assign({ css: __assign({ textAlign: "start" }, css) }, { children: column.header }), "header-".concat(index)));
|
|
2100
|
+
}) }) }), jsxRuntime.jsx("tbody", { children: rows.map(function (row, rowIndex) { return (jsxRuntime.jsx("tr", { children: columns.map(function (column, cellIndex) {
|
|
2095
2101
|
return (jsxRuntime.jsx(Td, __assign({ css: { color: "$light" } }, { children: row[column.accessorKey] }), "cell ".concat(cellIndex)));
|
|
2096
2102
|
}) }, "row ".concat(rowIndex))); }) })] }));
|
|
2097
2103
|
};
|