@bsol-oss/react-datatable5 12.0.0-beta.14 → 12.0.0-beta.16
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/index.js +10 -6
- package/dist/index.mjs +10 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3558,6 +3558,8 @@ const TableDataDisplay = ({ colorPalette, emptyComponent, }) => {
|
|
|
3558
3558
|
overflow: "auto",
|
|
3559
3559
|
paddingX: "2",
|
|
3560
3560
|
py: "1",
|
|
3561
|
+
color: { base: "colorPalette.900", _dark: "colorPalette.100" },
|
|
3562
|
+
bgColor: { base: "colorPalette.50", _dark: "colorPalette.950" },
|
|
3561
3563
|
borderBottomColor: { base: "colorPalette.200", _dark: "colorPalette.800" },
|
|
3562
3564
|
borderBottomWidth: "1px",
|
|
3563
3565
|
...{ colorPalette },
|
|
@@ -3565,20 +3567,22 @@ const TableDataDisplay = ({ colorPalette, emptyComponent, }) => {
|
|
|
3565
3567
|
if (data.length <= 0) {
|
|
3566
3568
|
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: emptyComponent });
|
|
3567
3569
|
}
|
|
3568
|
-
return (jsxRuntime.jsxs(react.Grid, { templateColumns: `${columnWidths}`, overflow: "auto", borderWidth: "1px", borderColor: { base: "colorPalette.200", _dark: "colorPalette.800" }, colorPalette, children: [jsxRuntime.jsx(react.Grid, { templateColumns: `${columnWidths}`, column: `1/span ${columns.length}`, bg: { base: "colorPalette.200", _dark: "colorPalette.800" }, colorPalette, children: columnHeaders.map((header) => {
|
|
3570
|
+
return (jsxRuntime.jsxs(react.Grid, { templateColumns: `${columnWidths}`, overflow: "auto", borderWidth: "1px", color: { base: "colorPalette.900", _dark: "colorPalette.100" }, borderColor: { base: "colorPalette.200", _dark: "colorPalette.800" }, colorPalette, children: [jsxRuntime.jsx(react.Grid, { templateColumns: `${columnWidths}`, column: `1/span ${columns.length}`, bg: { base: "colorPalette.200", _dark: "colorPalette.800" }, colorPalette, children: columnHeaders.map((header) => {
|
|
3569
3571
|
return (jsxRuntime.jsx(react.Box, { flex: "1 0 0%", paddingX: "2", py: "1", overflow: "auto", textOverflow: "ellipsis", children: translate.t(`column_header.${header}`) }));
|
|
3570
3572
|
}) }), data.map((record) => {
|
|
3571
3573
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: columnHeaders.map((header) => {
|
|
3574
|
+
const { cell } = columnsMap[header];
|
|
3575
|
+
const value = record[header];
|
|
3572
3576
|
if (!!record === false) {
|
|
3573
3577
|
return (jsxRuntime.jsx(react.Box, { ...cellProps, children: translate.t(`column_cell.placeholder`) }));
|
|
3574
3578
|
}
|
|
3575
|
-
if (
|
|
3576
|
-
return (jsxRuntime.jsx(react.Box, { ...cellProps, children:
|
|
3579
|
+
if (cell) {
|
|
3580
|
+
return (jsxRuntime.jsx(react.Box, { ...cellProps, children: cell({ row: { original: record } }) }));
|
|
3577
3581
|
}
|
|
3578
|
-
if (typeof
|
|
3579
|
-
return (jsxRuntime.jsx(react.Box, { ...cellProps, children: jsxRuntime.jsx(RecordDisplay, { object:
|
|
3582
|
+
if (typeof value === "object") {
|
|
3583
|
+
return (jsxRuntime.jsx(react.Box, { ...cellProps, children: jsxRuntime.jsx(RecordDisplay, { object: value }) }));
|
|
3580
3584
|
}
|
|
3581
|
-
return jsxRuntime.jsx(react.Box, { ...cellProps, children:
|
|
3585
|
+
return jsxRuntime.jsx(react.Box, { ...cellProps, children: value });
|
|
3582
3586
|
}) }));
|
|
3583
3587
|
})] }));
|
|
3584
3588
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -3538,6 +3538,8 @@ const TableDataDisplay = ({ colorPalette, emptyComponent, }) => {
|
|
|
3538
3538
|
overflow: "auto",
|
|
3539
3539
|
paddingX: "2",
|
|
3540
3540
|
py: "1",
|
|
3541
|
+
color: { base: "colorPalette.900", _dark: "colorPalette.100" },
|
|
3542
|
+
bgColor: { base: "colorPalette.50", _dark: "colorPalette.950" },
|
|
3541
3543
|
borderBottomColor: { base: "colorPalette.200", _dark: "colorPalette.800" },
|
|
3542
3544
|
borderBottomWidth: "1px",
|
|
3543
3545
|
...{ colorPalette },
|
|
@@ -3545,20 +3547,22 @@ const TableDataDisplay = ({ colorPalette, emptyComponent, }) => {
|
|
|
3545
3547
|
if (data.length <= 0) {
|
|
3546
3548
|
return jsx(Fragment, { children: emptyComponent });
|
|
3547
3549
|
}
|
|
3548
|
-
return (jsxs(Grid, { templateColumns: `${columnWidths}`, overflow: "auto", borderWidth: "1px", borderColor: { base: "colorPalette.200", _dark: "colorPalette.800" }, colorPalette, children: [jsx(Grid, { templateColumns: `${columnWidths}`, column: `1/span ${columns.length}`, bg: { base: "colorPalette.200", _dark: "colorPalette.800" }, colorPalette, children: columnHeaders.map((header) => {
|
|
3550
|
+
return (jsxs(Grid, { templateColumns: `${columnWidths}`, overflow: "auto", borderWidth: "1px", color: { base: "colorPalette.900", _dark: "colorPalette.100" }, borderColor: { base: "colorPalette.200", _dark: "colorPalette.800" }, colorPalette, children: [jsx(Grid, { templateColumns: `${columnWidths}`, column: `1/span ${columns.length}`, bg: { base: "colorPalette.200", _dark: "colorPalette.800" }, colorPalette, children: columnHeaders.map((header) => {
|
|
3549
3551
|
return (jsx(Box, { flex: "1 0 0%", paddingX: "2", py: "1", overflow: "auto", textOverflow: "ellipsis", children: translate.t(`column_header.${header}`) }));
|
|
3550
3552
|
}) }), data.map((record) => {
|
|
3551
3553
|
return (jsx(Fragment, { children: columnHeaders.map((header) => {
|
|
3554
|
+
const { cell } = columnsMap[header];
|
|
3555
|
+
const value = record[header];
|
|
3552
3556
|
if (!!record === false) {
|
|
3553
3557
|
return (jsx(Box, { ...cellProps, children: translate.t(`column_cell.placeholder`) }));
|
|
3554
3558
|
}
|
|
3555
|
-
if (
|
|
3556
|
-
return (jsx(Box, { ...cellProps, children:
|
|
3559
|
+
if (cell) {
|
|
3560
|
+
return (jsx(Box, { ...cellProps, children: cell({ row: { original: record } }) }));
|
|
3557
3561
|
}
|
|
3558
|
-
if (typeof
|
|
3559
|
-
return (jsx(Box, { ...cellProps, children: jsx(RecordDisplay, { object:
|
|
3562
|
+
if (typeof value === "object") {
|
|
3563
|
+
return (jsx(Box, { ...cellProps, children: jsx(RecordDisplay, { object: value }) }));
|
|
3560
3564
|
}
|
|
3561
|
-
return jsx(Box, { ...cellProps, children:
|
|
3565
|
+
return jsx(Box, { ...cellProps, children: value });
|
|
3562
3566
|
}) }));
|
|
3563
3567
|
})] }));
|
|
3564
3568
|
};
|