@bouku/core 0.0.8 → 0.0.9
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.
|
@@ -10,6 +10,6 @@ interface Props<T> {
|
|
|
10
10
|
count: number;
|
|
11
11
|
}
|
|
12
12
|
export type Row = Record<string, CellValue>;
|
|
13
|
-
export type CellValue = string | number | boolean;
|
|
13
|
+
export type CellValue = string | number | boolean | object;
|
|
14
14
|
export declare function TableRow<T extends Row>({ config, data, count }: Props<T>): import("react").JSX.Element;
|
|
15
15
|
export {};
|
|
@@ -22,7 +22,7 @@ function TableRow({ config, data, count }) {
|
|
|
22
22
|
cellValue = (0, ts_helper_kit_1.padNum)(cellValue, options.pad);
|
|
23
23
|
else if ((0, exports.isDateLike)(cellValue.toString()))
|
|
24
24
|
cellValue = new Date(cellValue.toString()).toLocaleDateString();
|
|
25
|
-
return ((0, jsx_runtime_1.jsxs)(flex_1.RowBox, { style: s.cell, children: [options && options?.link && (0, jsx_runtime_1.jsx)("a", { className: "text-primary underline duration-200 hover:text-accent", href: options.link?.replace("[x]", rawValue), children: cellValue }), options && !options?.link && ((0, jsx_runtime_1.jsx)("span", { className: "truncate", children: value === true ? (0, jsx_runtime_1.jsx)(check_circle_svg_1.default, { className: "text-success" }) : value === false ? (0, jsx_runtime_1.jsx)(x_circle_svg_1.default, { className: "text-error" }) : cellValue }))] }, i));
|
|
25
|
+
return ((0, jsx_runtime_1.jsxs)(flex_1.RowBox, { style: s.cell, children: [options && options?.link && (0, jsx_runtime_1.jsx)("a", { className: "text-primary underline duration-200 hover:text-accent", href: options.link?.replace("[x]", rawValue), children: cellValue }), options && !options?.link && ((0, jsx_runtime_1.jsx)("span", { className: "truncate", children: value === true ? (0, jsx_runtime_1.jsx)(check_circle_svg_1.default, { className: "text-success" }) : value === false ? (0, jsx_runtime_1.jsx)(x_circle_svg_1.default, { className: "text-error" }) : (typeof cellValue === "object" ? JSON.stringify(cellValue) : cellValue) }))] }, i));
|
|
26
26
|
}), count > 1 && ((0, jsx_runtime_1.jsx)("span", { className: "absolute top-0 left-0 pb-px px-1 bg-surface-light border-b border-r rounded-br border-border-light font-bold font-mono text-px text-accent", children: count }))] }));
|
|
27
27
|
}
|
|
28
28
|
const s = {
|