@bsol-oss/react-datatable5 12.0.0-beta.10 → 12.0.0-beta.11

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.d.ts CHANGED
@@ -443,8 +443,9 @@ declare const getColumns: <TData extends unknown>({ schema, include, ignore, wid
443
443
 
444
444
  interface TableDataDisplayProps {
445
445
  colorPalette?: string;
446
+ emptyComponent?: ReactNode;
446
447
  }
447
- declare const TableDataDisplay: ({ colorPalette }: TableDataDisplayProps) => react_jsx_runtime.JSX.Element;
448
+ declare const TableDataDisplay: ({ colorPalette, emptyComponent, }: TableDataDisplayProps) => react_jsx_runtime.JSX.Element;
448
449
 
449
450
  interface FilterOptionsProps {
450
451
  column: string;
package/dist/index.js CHANGED
@@ -3520,7 +3520,7 @@ const getColumns = ({ schema, include = [], ignore = [], width = [], meta = {},
3520
3520
  return columns;
3521
3521
  };
3522
3522
 
3523
- const TableDataDisplay = ({ colorPalette }) => {
3523
+ const TableDataDisplay = ({ colorPalette, emptyComponent, }) => {
3524
3524
  const { table, columns, translate, data } = useDataTableContext();
3525
3525
  const columnDef = table._getColumnDefs();
3526
3526
  console.log(columnDef, "glp");
@@ -3562,6 +3562,9 @@ const TableDataDisplay = ({ colorPalette }) => {
3562
3562
  borderBottomWidth: "1px",
3563
3563
  ...{ colorPalette },
3564
3564
  };
3565
+ if (data.length <= 0) {
3566
+ return jsxRuntime.jsx(jsxRuntime.Fragment, { children: emptyComponent });
3567
+ }
3565
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) => {
3566
3569
  return (jsxRuntime.jsx(react.Box, { flex: "1 0 0%", paddingX: "2", py: "1", overflow: "auto", textOverflow: "ellipsis", children: translate.t(`column_header.${header}`) }));
3567
3570
  }) }), data.map((record) => {
package/dist/index.mjs CHANGED
@@ -3500,7 +3500,7 @@ const getColumns = ({ schema, include = [], ignore = [], width = [], meta = {},
3500
3500
  return columns;
3501
3501
  };
3502
3502
 
3503
- const TableDataDisplay = ({ colorPalette }) => {
3503
+ const TableDataDisplay = ({ colorPalette, emptyComponent, }) => {
3504
3504
  const { table, columns, translate, data } = useDataTableContext();
3505
3505
  const columnDef = table._getColumnDefs();
3506
3506
  console.log(columnDef, "glp");
@@ -3542,6 +3542,9 @@ const TableDataDisplay = ({ colorPalette }) => {
3542
3542
  borderBottomWidth: "1px",
3543
3543
  ...{ colorPalette },
3544
3544
  };
3545
+ if (data.length <= 0) {
3546
+ return jsx(Fragment, { children: emptyComponent });
3547
+ }
3545
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) => {
3546
3549
  return (jsx(Box, { flex: "1 0 0%", paddingX: "2", py: "1", overflow: "auto", textOverflow: "ellipsis", children: translate.t(`column_header.${header}`) }));
3547
3550
  }) }), data.map((record) => {
@@ -1,4 +1,6 @@
1
+ import { ReactNode } from "react";
1
2
  export interface TableDataDisplayProps {
2
3
  colorPalette?: string;
4
+ emptyComponent?: ReactNode;
3
5
  }
4
- export declare const TableDataDisplay: ({ colorPalette }: TableDataDisplayProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const TableDataDisplay: ({ colorPalette, emptyComponent, }: TableDataDisplayProps) => import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bsol-oss/react-datatable5",
3
- "version": "12.0.0-beta.10",
3
+ "version": "12.0.0-beta.11",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",