@nulogy/components 15.1.1 → 15.1.2

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/main.js CHANGED
@@ -52952,7 +52952,7 @@
52952
52952
  borderCollapse: "collapse"
52953
52953
  });
52954
52954
  });
52955
- var renderRows$1 = function renderRows(rows, columns, keyField, noRowsContent, rowHovers, compact, onRowMouseLeave, onRowMouseEnter, rowBorder) {
52955
+ var renderRows$1 = function renderRows(rows, columns, keyField, rowHovers, noRowsContent, compact, onRowMouseLeave, onRowMouseEnter, rowBorder) {
52956
52956
  return rows.length > 0 ? rows.map(function (row, rowIndex) {
52957
52957
  var rowKey = row[keyField] !== undefined ? row[keyField] : rowIndex;
52958
52958
  return /*#__PURE__*/React__default["default"].createElement(TableBodyRow, {
@@ -53054,7 +53054,7 @@
53054
53054
  rowBorder = _ref6.rowBorder;
53055
53055
  return /*#__PURE__*/React__default["default"].createElement("tbody", {
53056
53056
  "data-testid": "table-body"
53057
- }, !loading ? renderRows$1(rows, columns, keyField, noRowsContent, rowHovers, compact, onRowMouseLeave, onRowMouseEnter, rowBorder) : (/*#__PURE__*/React__default["default"].createElement(LoadingContent, {
53057
+ }, !loading ? renderRows$1(rows, columns, keyField, rowHovers, noRowsContent, compact, onRowMouseLeave, onRowMouseEnter, rowBorder) : (/*#__PURE__*/React__default["default"].createElement(LoadingContent, {
53058
53058
  colSpan: columns.length
53059
53059
  })));
53060
53060
  };
@@ -52935,7 +52935,7 @@ var StyledTr = styled.tr.withConfig({
52935
52935
  borderCollapse: "collapse"
52936
52936
  });
52937
52937
  });
52938
- var renderRows$1 = function renderRows(rows, columns, keyField, noRowsContent, rowHovers, compact, onRowMouseLeave, onRowMouseEnter, rowBorder) {
52938
+ var renderRows$1 = function renderRows(rows, columns, keyField, rowHovers, noRowsContent, compact, onRowMouseLeave, onRowMouseEnter, rowBorder) {
52939
52939
  return rows.length > 0 ? rows.map(function (row, rowIndex) {
52940
52940
  var rowKey = row[keyField] !== undefined ? row[keyField] : rowIndex;
52941
52941
  return /*#__PURE__*/React__default.createElement(TableBodyRow, {
@@ -53037,7 +53037,7 @@ var TableBody = function TableBody(_ref6) {
53037
53037
  rowBorder = _ref6.rowBorder;
53038
53038
  return /*#__PURE__*/React__default.createElement("tbody", {
53039
53039
  "data-testid": "table-body"
53040
- }, !loading ? renderRows$1(rows, columns, keyField, noRowsContent, rowHovers, compact, onRowMouseLeave, onRowMouseEnter, rowBorder) : (/*#__PURE__*/React__default.createElement(LoadingContent, {
53040
+ }, !loading ? renderRows$1(rows, columns, keyField, rowHovers, noRowsContent, compact, onRowMouseLeave, onRowMouseEnter, rowBorder) : (/*#__PURE__*/React__default.createElement(LoadingContent, {
53041
53041
  colSpan: columns.length
53042
53042
  })));
53043
53043
  };
@@ -1,9 +1,9 @@
1
- import React from "react";
1
+ import React, { type ReactNode } from "react";
2
2
  import { RowType, Columns, RowBorder } from "./Table.types";
3
3
  export type BaseTableProps<ColumnMetaData> = {
4
4
  columns: Columns<ColumnMetaData>;
5
5
  rows: RowType[];
6
- noRowsContent?: string;
6
+ noRowsContent?: ReactNode;
7
7
  keyField?: string;
8
8
  id?: string;
9
9
  loading?: boolean;
@@ -72,7 +72,7 @@ declare class StatefulTable<ColumnMetaData> extends Component<StatefulTableProps
72
72
  getControlProps: () => {
73
73
  rows: any;
74
74
  columns: any[];
75
- noRowsContent?: string;
75
+ noRowsContent?: React.ReactNode;
76
76
  keyField?: string;
77
77
  id?: string;
78
78
  loading?: boolean;
@@ -1,16 +1,16 @@
1
- import React from "react";
1
+ import React, { type ReactNode } from "react";
2
2
  import { RowBorder } from "./Table.types";
3
- type TableBodyProps = {
3
+ interface TableBodyProps {
4
4
  rows: any[];
5
5
  columns: any[];
6
6
  keyField?: string;
7
- noRowsContent?: any;
7
+ noRowsContent: ReactNode;
8
8
  loading?: boolean;
9
9
  rowHovers?: boolean;
10
10
  compact?: boolean;
11
- onRowMouseLeave?: any;
12
- onRowMouseEnter?: any;
11
+ onRowMouseLeave?: (...args: any[]) => any;
12
+ onRowMouseEnter?: (...args: any[]) => any;
13
13
  rowBorder?: RowBorder;
14
- };
14
+ }
15
15
  declare const TableBody: ({ rows, columns, keyField, noRowsContent, loading, rowHovers, compact, onRowMouseLeave, onRowMouseEnter, rowBorder, }: TableBodyProps) => React.JSX.Element;
16
16
  export default TableBody;
@@ -15,7 +15,7 @@ const StyledTr = styled.tr(({ rowHovers, rowBorder, theme }) => (Object.assign({
15
15
  borderBottomColor: theme.colors.lightGrey,
16
16
  borderCollapse: "collapse",
17
17
  }))));
18
- const renderRows = (rows, columns, keyField, noRowsContent, rowHovers, compact, onRowMouseLeave, onRowMouseEnter, rowBorder) => rows.length > 0 ? (rows.map((row, rowIndex) => {
18
+ const renderRows = (rows, columns, keyField, rowHovers, noRowsContent, compact, onRowMouseLeave, onRowMouseEnter, rowBorder) => rows.length > 0 ? (rows.map((row, rowIndex) => {
19
19
  const rowKey = row[keyField] !== undefined ? row[keyField] : rowIndex;
20
20
  return (React.createElement(TableBodyRow, { key: rowKey, row: row, columns: columns, keyField: keyField, rowHovers: rowHovers, compact: compact, rowClassName: row.rowClassName, onMouseEnter: (e) => onRowMouseEnter({ row, e }), onMouseLeave: (e) => onRowMouseLeave({ row, e }), rowBorder: rowBorder }));
21
21
  })) : (React.createElement(TableMessageContainer, { colSpan: columns.length }, noRowsContent));
@@ -33,5 +33,5 @@ const TableMessageContainer = ({ colSpan, children }) => (React.createElement("t
33
33
  React.createElement("td", { colSpan: colSpan },
34
34
  React.createElement(StyledMessageContainer, { className: "nds-table__no-rows-content" }, children))));
35
35
  const LoadingContent = ({ colSpan }) => (React.createElement(TableMessageContainer, { colSpan: colSpan }, "Loading..."));
36
- const TableBody = ({ rows, columns, keyField = "id", noRowsContent = "No records have been created for this table.", loading, rowHovers, compact, onRowMouseLeave, onRowMouseEnter, rowBorder, }) => (React.createElement("tbody", { "data-testid": "table-body" }, !loading ? (renderRows(rows, columns, keyField, noRowsContent, rowHovers, compact, onRowMouseLeave, onRowMouseEnter, rowBorder)) : (React.createElement(LoadingContent, { colSpan: columns.length }))));
36
+ const TableBody = ({ rows, columns, keyField = "id", noRowsContent = "No records have been created for this table.", loading, rowHovers, compact, onRowMouseLeave, onRowMouseEnter, rowBorder, }) => (React.createElement("tbody", { "data-testid": "table-body" }, !loading ? (renderRows(rows, columns, keyField, rowHovers, noRowsContent, compact, onRowMouseLeave, onRowMouseEnter, rowBorder)) : (React.createElement(LoadingContent, { colSpan: columns.length }))));
37
37
  export default TableBody;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nulogy/components",
3
- "version": "15.1.1",
3
+ "version": "15.1.2",
4
4
  "description": "Component library for the Nulogy Design System - http://nulogy.design",
5
5
  "private": false,
6
6
  "publishConfig": {