@nulogy/components 10.2.2 → 10.2.4

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
@@ -49440,27 +49440,34 @@
49440
49440
  };
49441
49441
  });
49442
49442
 
49443
- var defaultheaderFormatter = function defaultheaderFormatter(_ref2) {
49444
- var label = _ref2.label;
49445
- return label;
49446
- };
49447
-
49448
- var renderHeaderCellContent = function renderHeaderCellContent(_ref3) {
49449
- var _ref3$headerFormatter = _ref3.headerFormatter,
49450
- headerFormatter = _ref3$headerFormatter === void 0 ? defaultheaderFormatter : _ref3$headerFormatter,
49451
- align = _ref3.align,
49452
- label = _ref3.label,
49453
- dataKey = _ref3.dataKey,
49454
- width = _ref3.width;
49455
- return headerFormatter({
49443
+ function renderHeaderCellContent(_ref2) {
49444
+ var _ref2$headerFormatter = _ref2.headerFormatter,
49445
+ headerFormatter = _ref2$headerFormatter === void 0 ? function (_ref3) {
49446
+ var label = _ref3.label;
49447
+ return label;
49448
+ } : _ref2$headerFormatter,
49449
+ align = _ref2.align,
49450
+ label = _ref2.label,
49451
+ width = _ref2.width,
49452
+ metadata = _ref2.metadata,
49453
+ dataKey = _ref2.dataKey,
49454
+ key = _ref2.key;
49455
+ return key ? headerFormatter({
49456
49456
  align: align,
49457
49457
  label: label,
49458
- dataKey: dataKey,
49459
- width: width
49458
+ width: width,
49459
+ metadata: metadata,
49460
+ key: key
49461
+ }) : headerFormatter({
49462
+ align: align,
49463
+ label: label,
49464
+ width: width,
49465
+ metadata: metadata,
49466
+ dataKey: dataKey
49460
49467
  });
49461
- };
49468
+ }
49462
49469
 
49463
- var TableHead = function TableHead(_ref4) {
49470
+ function TableHead(_ref4) {
49464
49471
  var columns = _ref4.columns,
49465
49472
  compact = _ref4.compact,
49466
49473
  sticky = _ref4.sticky;
@@ -49481,7 +49488,7 @@
49481
49488
  };
49482
49489
 
49483
49490
  return /*#__PURE__*/React__default["default"].createElement("thead", null, /*#__PURE__*/React__default["default"].createElement(StyledHeaderRow, null, renderColumns(columns)));
49484
- };
49491
+ }
49485
49492
 
49486
49493
  var columnPropType = PropTypes__default["default"].shape({
49487
49494
  align: PropTypes__default["default"].oneOf(["right", "left", "center"]),
@@ -49770,14 +49777,14 @@
49770
49777
  compact: PropTypes__default["default"].bool.isRequired
49771
49778
  };
49772
49779
 
49773
- var TableFoot = function TableFoot(_ref3) {
49780
+ function TableFoot(_ref3) {
49774
49781
  var columns = _ref3.columns,
49775
49782
  rows = _ref3.rows,
49776
49783
  keyField = _ref3.keyField,
49777
49784
  loading = _ref3.loading,
49778
49785
  compact = _ref3.compact;
49779
49786
  return /*#__PURE__*/React__default["default"].createElement("tfoot", null, renderRows(rows, columns, keyField, loading, compact));
49780
- };
49787
+ }
49781
49788
 
49782
49789
  TableFoot.propTypes = {
49783
49790
  columns: columnsPropType.isRequired,
@@ -49802,7 +49809,7 @@
49802
49809
  position: "relative"
49803
49810
  });
49804
49811
 
49805
- var BaseTable = function BaseTable(_a) {
49812
+ function BaseTable(_a) {
49806
49813
  var columns = _a.columns,
49807
49814
  rows = _a.rows,
49808
49815
  _a$noRowsContent = _a.noRowsContent,
@@ -49848,7 +49855,7 @@
49848
49855
  loading: loading,
49849
49856
  compact: compact
49850
49857
  }));
49851
- };
49858
+ }
49852
49859
 
49853
49860
  BaseTable.propTypes = Object.assign(Object.assign({}, propTypes.space), {
49854
49861
  columns: PropTypes__default["default"].any,
@@ -50357,7 +50364,7 @@
50357
50364
  active: false
50358
50365
  };
50359
50366
 
50360
- var Table = function Table(_a) {
50367
+ function Table(_a) {
50361
50368
  var hasSelectableRows = _a.hasSelectableRows,
50362
50369
  rowsPerPage = _a.rowsPerPage,
50363
50370
  hasExpandableRows = _a.hasExpandableRows,
@@ -50384,7 +50391,7 @@
50384
50391
  paginationCss: paginationCss,
50385
50392
  paginationProps: paginationProps
50386
50393
  }, props)) : /*#__PURE__*/React__default["default"].createElement(BaseTable, Object.assign({}, props));
50387
- };
50394
+ }
50388
50395
 
50389
50396
  Table.SortingHeader = SortingColumnHeader;
50390
50397
 
@@ -50395,7 +50402,7 @@
50395
50402
  });
50396
50403
  };
50397
50404
 
50398
- var applySort = function applySort(rows, sortColumn, columns) {
50405
+ function applySort(rows, sortColumn, columns) {
50399
50406
  return [].concat(rows).sort(function (a, b) {
50400
50407
  var column = columns.find(function (col) {
50401
50408
  return col.dataKey === sortColumn;
@@ -50403,14 +50410,14 @@
50403
50410
  var numeric = column.numeric;
50404
50411
  return numericAlphabeticalSort(a[sortColumn], b[sortColumn], numeric);
50405
50412
  });
50406
- };
50413
+ }
50407
50414
 
50408
- var sortRows = function sortRows(rows, columns, sortState) {
50415
+ function sortRows(rows, columns, sortState) {
50409
50416
  var sortedRows = applySort(rows, sortState.sortColumn, columns);
50410
50417
  return sortState.ascending ? sortedRows : sortedRows.reverse();
50411
- };
50418
+ }
50412
50419
 
50413
- var SortingTable = function SortingTable(_a) {
50420
+ function SortingTable(_a) {
50414
50421
  var incomingColumns = _a.columns,
50415
50422
  incomingRows = _a.rows,
50416
50423
  initialSortColumn = _a.initialSortColumn,
@@ -50469,7 +50476,7 @@
50469
50476
  columns: columns,
50470
50477
  rows: rows
50471
50478
  }, props));
50472
- };
50479
+ }
50473
50480
 
50474
50481
  var StatusIndicatorValues = {
50475
50482
  neutral: "neutral",
@@ -49423,27 +49423,34 @@ var StyledHeaderRow = styled.tr.withConfig({
49423
49423
  };
49424
49424
  });
49425
49425
 
49426
- var defaultheaderFormatter = function defaultheaderFormatter(_ref2) {
49427
- var label = _ref2.label;
49428
- return label;
49429
- };
49430
-
49431
- var renderHeaderCellContent = function renderHeaderCellContent(_ref3) {
49432
- var _ref3$headerFormatter = _ref3.headerFormatter,
49433
- headerFormatter = _ref3$headerFormatter === void 0 ? defaultheaderFormatter : _ref3$headerFormatter,
49434
- align = _ref3.align,
49435
- label = _ref3.label,
49436
- dataKey = _ref3.dataKey,
49437
- width = _ref3.width;
49438
- return headerFormatter({
49426
+ function renderHeaderCellContent(_ref2) {
49427
+ var _ref2$headerFormatter = _ref2.headerFormatter,
49428
+ headerFormatter = _ref2$headerFormatter === void 0 ? function (_ref3) {
49429
+ var label = _ref3.label;
49430
+ return label;
49431
+ } : _ref2$headerFormatter,
49432
+ align = _ref2.align,
49433
+ label = _ref2.label,
49434
+ width = _ref2.width,
49435
+ metadata = _ref2.metadata,
49436
+ dataKey = _ref2.dataKey,
49437
+ key = _ref2.key;
49438
+ return key ? headerFormatter({
49439
49439
  align: align,
49440
49440
  label: label,
49441
- dataKey: dataKey,
49442
- width: width
49441
+ width: width,
49442
+ metadata: metadata,
49443
+ key: key
49444
+ }) : headerFormatter({
49445
+ align: align,
49446
+ label: label,
49447
+ width: width,
49448
+ metadata: metadata,
49449
+ dataKey: dataKey
49443
49450
  });
49444
- };
49451
+ }
49445
49452
 
49446
- var TableHead = function TableHead(_ref4) {
49453
+ function TableHead(_ref4) {
49447
49454
  var columns = _ref4.columns,
49448
49455
  compact = _ref4.compact,
49449
49456
  sticky = _ref4.sticky;
@@ -49464,7 +49471,7 @@ var TableHead = function TableHead(_ref4) {
49464
49471
  };
49465
49472
 
49466
49473
  return /*#__PURE__*/React__default.createElement("thead", null, /*#__PURE__*/React__default.createElement(StyledHeaderRow, null, renderColumns(columns)));
49467
- };
49474
+ }
49468
49475
 
49469
49476
  var columnPropType = PropTypes.shape({
49470
49477
  align: PropTypes.oneOf(["right", "left", "center"]),
@@ -49753,14 +49760,14 @@ TableFooterRow.propTypes = {
49753
49760
  compact: PropTypes.bool.isRequired
49754
49761
  };
49755
49762
 
49756
- var TableFoot = function TableFoot(_ref3) {
49763
+ function TableFoot(_ref3) {
49757
49764
  var columns = _ref3.columns,
49758
49765
  rows = _ref3.rows,
49759
49766
  keyField = _ref3.keyField,
49760
49767
  loading = _ref3.loading,
49761
49768
  compact = _ref3.compact;
49762
49769
  return /*#__PURE__*/React__default.createElement("tfoot", null, renderRows(rows, columns, keyField, loading, compact));
49763
- };
49770
+ }
49764
49771
 
49765
49772
  TableFoot.propTypes = {
49766
49773
  columns: columnsPropType.isRequired,
@@ -49785,7 +49792,7 @@ var StyledTable = styled.table.withConfig({
49785
49792
  position: "relative"
49786
49793
  });
49787
49794
 
49788
- var BaseTable = function BaseTable(_a) {
49795
+ function BaseTable(_a) {
49789
49796
  var columns = _a.columns,
49790
49797
  rows = _a.rows,
49791
49798
  _a$noRowsContent = _a.noRowsContent,
@@ -49831,7 +49838,7 @@ var BaseTable = function BaseTable(_a) {
49831
49838
  loading: loading,
49832
49839
  compact: compact
49833
49840
  }));
49834
- };
49841
+ }
49835
49842
 
49836
49843
  BaseTable.propTypes = Object.assign(Object.assign({}, propTypes.space), {
49837
49844
  columns: PropTypes.any,
@@ -50340,7 +50347,7 @@ SortingColumnHeader.defaultProps = {
50340
50347
  active: false
50341
50348
  };
50342
50349
 
50343
- var Table = function Table(_a) {
50350
+ function Table(_a) {
50344
50351
  var hasSelectableRows = _a.hasSelectableRows,
50345
50352
  rowsPerPage = _a.rowsPerPage,
50346
50353
  hasExpandableRows = _a.hasExpandableRows,
@@ -50367,7 +50374,7 @@ var Table = function Table(_a) {
50367
50374
  paginationCss: paginationCss,
50368
50375
  paginationProps: paginationProps
50369
50376
  }, props)) : /*#__PURE__*/React__default.createElement(BaseTable, Object.assign({}, props));
50370
- };
50377
+ }
50371
50378
 
50372
50379
  Table.SortingHeader = SortingColumnHeader;
50373
50380
 
@@ -50378,7 +50385,7 @@ var numericAlphabeticalSort = function numericAlphabeticalSort(a, b, numeric) {
50378
50385
  });
50379
50386
  };
50380
50387
 
50381
- var applySort = function applySort(rows, sortColumn, columns) {
50388
+ function applySort(rows, sortColumn, columns) {
50382
50389
  return [].concat(rows).sort(function (a, b) {
50383
50390
  var column = columns.find(function (col) {
50384
50391
  return col.dataKey === sortColumn;
@@ -50386,14 +50393,14 @@ var applySort = function applySort(rows, sortColumn, columns) {
50386
50393
  var numeric = column.numeric;
50387
50394
  return numericAlphabeticalSort(a[sortColumn], b[sortColumn], numeric);
50388
50395
  });
50389
- };
50396
+ }
50390
50397
 
50391
- var sortRows = function sortRows(rows, columns, sortState) {
50398
+ function sortRows(rows, columns, sortState) {
50392
50399
  var sortedRows = applySort(rows, sortState.sortColumn, columns);
50393
50400
  return sortState.ascending ? sortedRows : sortedRows.reverse();
50394
- };
50401
+ }
50395
50402
 
50396
- var SortingTable = function SortingTable(_a) {
50403
+ function SortingTable(_a) {
50397
50404
  var incomingColumns = _a.columns,
50398
50405
  incomingRows = _a.rows,
50399
50406
  initialSortColumn = _a.initialSortColumn,
@@ -50452,7 +50459,7 @@ var SortingTable = function SortingTable(_a) {
50452
50459
  columns: columns,
50453
50460
  rows: rows
50454
50461
  }, props));
50455
- };
50462
+ }
50456
50463
 
50457
50464
  var StatusIndicatorValues = {
50458
50465
  neutral: "neutral",
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import type { TableProps } from "../Table";
3
- type SortingTableProps = TableProps & {
3
+ type SortingTableProps<ColumnMetadata> = TableProps<ColumnMetadata> & {
4
4
  initialSortColumn: string;
5
5
  };
6
- declare const SortingTable: React.FC<SortingTableProps>;
6
+ declare function SortingTable<ColumnMetadata>({ columns: incomingColumns, rows: incomingRows, initialSortColumn, ...props }: SortingTableProps<ColumnMetadata>): React.JSX.Element;
7
7
  export default SortingTable;
@@ -1,25 +1,8 @@
1
1
  import React from "react";
2
+ import { SortingTable } from ".";
2
3
  declare const _default: {
3
4
  title: string;
4
- component: React.FC<import("../Table/BaseTable").BaseTableProps & {
5
- selectedRows?: string[];
6
- onRowSelectionChange?: (...args: any[]) => any;
7
- onRowExpansionChange?: (...args: any[]) => any;
8
- rowsPerPage?: number;
9
- onPageChange?: (...args: any[]) => any;
10
- selectAllAriaLabel?: string;
11
- deselectAllAriaLabel?: string;
12
- paginationCss?: any;
13
- paginationProps?: any;
14
- expandedRows?: any[];
15
- hasSelectableRows?: boolean;
16
- hasExpandableRows?: boolean;
17
- onSelectRow?: (...args: any[]) => any;
18
- onSelectHeader?: (...args: any[]) => any;
19
- isHeaderSelected?: any;
20
- } & {
21
- initialSortColumn: string;
22
- }>;
5
+ component: typeof SortingTable;
23
6
  };
24
7
  export default _default;
25
8
  export declare const _SortingTable: () => React.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { RowType, Columns } from "./Table.types";
3
- export type BaseTableProps = {
4
- columns: Columns;
3
+ export type BaseTableProps<ColumnMetaData> = {
4
+ columns: Columns<ColumnMetaData>;
5
5
  rows: RowType[];
6
6
  noRowsContent?: string;
7
7
  keyField?: string;
@@ -17,5 +17,21 @@ export type BaseTableProps = {
17
17
  onMouseEnter?: any;
18
18
  onMouseLeave?: any;
19
19
  };
20
- declare const BaseTable: React.FC<BaseTableProps>;
20
+ declare function BaseTable<ColumnMetaData>({ columns, rows, noRowsContent, keyField, id, loading, footerRows, rowHovers, compact, className, stickyHeader, onRowMouseEnter, onRowMouseLeave, ...props }: BaseTableProps<ColumnMetaData>): React.JSX.Element;
21
+ declare namespace BaseTable {
22
+ var propTypes: any;
23
+ var defaultProps: {
24
+ noRowsContent: string;
25
+ keyField: string;
26
+ id: any;
27
+ loading: boolean;
28
+ footerRows: any[];
29
+ rowHovers: boolean;
30
+ compact: boolean;
31
+ className: any;
32
+ stickyHeader: boolean;
33
+ onRowMouseEnter: () => void;
34
+ onRowMouseLeave: () => void;
35
+ };
36
+ }
21
37
  export default BaseTable;
@@ -3,70 +3,16 @@ declare const _default: {
3
3
  title: string;
4
4
  };
5
5
  export default _default;
6
- export declare const WithData: {
7
- (): React.JSX.Element;
8
- story: {
9
- name: string;
10
- };
11
- };
12
- export declare const WithNoData: {
13
- (): React.JSX.Element;
14
- story: {
15
- name: string;
16
- };
17
- };
18
- export declare const WithStickyHeader: {
19
- (): React.JSX.Element;
20
- story: {
21
- name: string;
22
- };
23
- };
24
- export declare const WithLotsOfRowsAndColumns: {
25
- (): React.JSX.Element;
26
- story: {
27
- name: string;
28
- };
29
- };
30
- export declare const WithCustomColumnWidths: {
31
- (): React.JSX.Element;
32
- story: {
33
- name: string;
34
- };
35
- };
36
- export declare const WithACustomCellComponent: {
37
- (): React.JSX.Element;
38
- story: {
39
- name: string;
40
- };
41
- };
42
- export declare const WithCellAlignment: {
43
- (): React.JSX.Element;
44
- story: {
45
- name: string;
46
- };
47
- };
48
- export declare const WithACellFormatter: {
49
- (): React.JSX.Element;
50
- story: {
51
- name: string;
52
- };
53
- };
54
- export declare const WithACustomColumnLabelComponent: {
55
- (): React.JSX.Element;
56
- story: {
57
- name: string;
58
- };
59
- };
60
- export declare const WithFullWidthSection: {
61
- (): React.JSX.Element;
62
- story: {
63
- name: string;
64
- };
65
- };
66
- export declare const WithAFooter: {
67
- (): React.JSX.Element;
68
- story: {
69
- name: string;
70
- };
71
- };
6
+ export declare const WithData: () => React.JSX.Element;
7
+ export declare const WithNoData: () => React.JSX.Element;
8
+ export declare const WithStickyHeader: () => React.JSX.Element;
9
+ export declare const WithLotsOfRowsAndColumns: () => React.JSX.Element;
10
+ export declare const WithCustomColumnWidths: () => React.JSX.Element;
11
+ export declare const WithACustomCellComponent: () => React.JSX.Element;
12
+ export declare const WithCellAlignment: () => React.JSX.Element;
13
+ export declare const WithACellFormatter: () => React.JSX.Element;
14
+ export declare const WithACustomColumnLabelComponent: () => React.JSX.Element;
15
+ export declare const WithMetadata: () => React.JSX.Element;
16
+ export declare const WithFullWidthSection: () => React.JSX.Element;
17
+ export declare const WithAFooter: () => React.JSX.Element;
72
18
  export declare const WithRowBorder: () => React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import React, { Component } from "react";
2
2
  import { BaseTableProps } from "./BaseTable";
3
- export type StatefulTableProps = BaseTableProps & {
3
+ export type StatefulTableProps<ColumnMetaData> = BaseTableProps<ColumnMetaData> & {
4
4
  selectedRows?: string[];
5
5
  onRowSelectionChange?: (...args: any[]) => any;
6
6
  onRowExpansionChange?: (...args: any[]) => any;
@@ -24,7 +24,7 @@ type StatefulTableState = {
24
24
  currentPage: number;
25
25
  paginatedRows: any;
26
26
  };
27
- declare class StatefulTable extends Component<StatefulTableProps, StatefulTableState> {
27
+ declare class StatefulTable<ColumnMetaData> extends Component<StatefulTableProps<ColumnMetaData>, StatefulTableState> {
28
28
  static defaultProps: {
29
29
  hasSelectableRows: boolean;
30
30
  selectedRows: any[];
@@ -34,21 +34,17 @@ declare class StatefulTable extends Component<StatefulTableProps, StatefulTableS
34
34
  deselectAllAriaLabel: any;
35
35
  paginationCss: any;
36
36
  paginationProps: {};
37
- columns?: import("./Table.types").Columns;
38
- rows?: unknown[];
39
- noRowsContent?: string;
40
- keyField?: string;
41
- id?: string;
42
- loading?: boolean;
43
- footerRows?: any;
44
- rowHovers?: boolean;
45
- compact?: boolean;
46
- className?: string;
47
- stickyHeader?: boolean;
48
- onRowMouseEnter?: (...args: any[]) => any;
49
- onRowMouseLeave?: (...args: any[]) => any;
50
- onMouseEnter?: any;
51
- onMouseLeave?: any;
37
+ noRowsContent: string;
38
+ keyField: string;
39
+ id: any;
40
+ loading: boolean;
41
+ footerRows: any[];
42
+ rowHovers: boolean;
43
+ compact: boolean;
44
+ className: any;
45
+ stickyHeader: boolean;
46
+ onRowMouseEnter: () => void;
47
+ onRowMouseLeave: () => void;
52
48
  };
53
49
  constructor(props: any);
54
50
  static getDerivedStateFromProps(nextProps: any, prevState: any): {
@@ -1,13 +1,13 @@
1
1
  import React from "react";
2
2
  import { StatefulTableProps } from "./StatefulTable";
3
3
  import { ColumnType, RowType, CellInfoType } from "./Table.types";
4
- export type TableProps = StatefulTableProps;
5
- export type TableColumnType = ColumnType;
4
+ export type TableProps<ColumnMetadata> = StatefulTableProps<ColumnMetadata>;
5
+ export type TableColumnType<ColumnMetadata> = ColumnType<ColumnMetadata>;
6
6
  export type TableRowType = RowType;
7
- export type TableCellInfoType = CellInfoType;
8
- declare const Table: {
9
- ({ hasSelectableRows, rowsPerPage, hasExpandableRows, selectedRows, onRowSelectionChange, onRowExpansionChange, onPageChange, selectAllAriaLabel, deselectAllAriaLabel, paginationCss, paginationProps, ...props }: TableProps): React.JSX.Element;
10
- SortingHeader: {
7
+ export type TableCellInfoType<ColumnMetadata> = CellInfoType<ColumnMetadata>;
8
+ declare function Table<ColumnMetadata>({ hasSelectableRows, rowsPerPage, hasExpandableRows, selectedRows, onRowSelectionChange, onRowExpansionChange, onPageChange, selectAllAriaLabel, deselectAllAriaLabel, paginationCss, paginationProps, ...props }: TableProps<ColumnMetadata>): React.JSX.Element;
9
+ declare namespace Table {
10
+ var SortingHeader: {
11
11
  ({ onChange, label, ascending, active, ariaLabel }: {
12
12
  onChange: any;
13
13
  label: any;
@@ -29,5 +29,5 @@ declare const Table: {
29
29
  active: boolean;
30
30
  };
31
31
  };
32
- };
32
+ }
33
33
  export default Table;
@@ -1,26 +1,21 @@
1
1
  import type { Key } from "react";
2
2
  import PropTypes from "prop-types";
3
- export type RowType = unknown;
4
- export interface CellInfoType {
5
- cellData: unknown;
6
- column: ColumnType;
3
+ export type RowType = any;
4
+ export interface CellInfoType<ColumnMetadata> {
5
+ cellData: any;
6
+ column: ColumnType<ColumnMetadata>;
7
7
  row: RowType;
8
8
  }
9
- interface ColumnInfoType {
10
- align?: ColumnAlignment;
11
- label: string;
12
- dataKey?: Key;
13
- width?: string | number;
14
- }
15
9
  type ColumnAlignment = "left" | "right" | "center";
16
- export type ColumnType = {
10
+ export type ColumnType<ColumnMetadata> = {
17
11
  align?: ColumnAlignment;
18
12
  label?: string;
19
- cellFormatter?: (cell: CellInfoType) => React.ReactNode;
20
- cellRenderer?: (cell: CellInfoType) => React.ReactNode;
21
- headerRenderer?: (column: ColumnInfoType) => React.ReactNode;
22
- headerFormatter?: (column: ColumnInfoType) => React.ReactNode;
13
+ cellFormatter?: (cell: CellInfoType<ColumnMetadata>) => React.ReactNode;
14
+ cellRenderer?: (cell: CellInfoType<ColumnMetadata>) => React.ReactNode;
15
+ headerRenderer?: (column: ColumnType<ColumnMetadata>) => React.ReactNode;
16
+ headerFormatter?: (column: ColumnType<ColumnMetadata>) => React.ReactNode;
23
17
  width?: string | number;
18
+ metadata?: ColumnMetadata;
24
19
  } & ({
25
20
  key: Key;
26
21
  dataKey?: never | undefined;
@@ -28,7 +23,7 @@ export type ColumnType = {
28
23
  dataKey: Key;
29
24
  key?: never | undefined;
30
25
  });
31
- export type Columns = ColumnType[];
26
+ export type Columns<ColumnMetadata> = ColumnType<ColumnMetadata>[];
32
27
  export declare const columnPropType: PropTypes.Requireable<PropTypes.InferProps<{
33
28
  align: PropTypes.Requireable<string>;
34
29
  label: PropTypes.Requireable<string>;
@@ -1,15 +1,15 @@
1
1
  import React from "react";
2
2
  import PropTypes from "prop-types";
3
3
  import { RowType, Columns } from "./Table.types";
4
- declare const TableFoot: {
5
- ({ columns, rows, keyField, loading, compact, }: {
6
- columns: Columns;
7
- rows: RowType[];
8
- keyField?: string;
9
- loading?: boolean;
10
- compact?: boolean;
11
- }): React.JSX.Element;
12
- propTypes: {
4
+ declare function TableFoot<ColumnMetadata>({ columns, rows, keyField, loading, compact, }: {
5
+ columns: Columns<ColumnMetadata>;
6
+ rows: RowType[];
7
+ keyField?: string;
8
+ loading?: boolean;
9
+ compact?: boolean;
10
+ }): React.JSX.Element;
11
+ declare namespace TableFoot {
12
+ var propTypes: {
13
13
  columns: PropTypes.Validator<PropTypes.InferProps<{
14
14
  align: PropTypes.Requireable<string>;
15
15
  label: PropTypes.Requireable<string>;
@@ -27,10 +27,10 @@ declare const TableFoot: {
27
27
  loading: PropTypes.Requireable<boolean>;
28
28
  compact: PropTypes.Requireable<boolean>;
29
29
  };
30
- defaultProps: {
30
+ var defaultProps: {
31
31
  keyField: string;
32
32
  loading: boolean;
33
33
  compact: boolean;
34
34
  };
35
- };
35
+ }
36
36
  export default TableFoot;
@@ -1,9 +1,9 @@
1
1
  import React from "react";
2
2
  import type { Columns } from "./Table.types";
3
- interface TableHeadProps {
4
- columns: Columns;
3
+ interface TableHeadProps<ColumnMetadata> {
4
+ columns: Columns<ColumnMetadata>;
5
5
  compact?: boolean;
6
6
  sticky?: boolean;
7
7
  }
8
- declare const TableHead: ({ columns, compact, sticky }: TableHeadProps) => React.JSX.Element;
8
+ declare function TableHead<ColumnMetadata>({ columns, compact, sticky }: TableHeadProps<ColumnMetadata>): React.JSX.Element;
9
9
  export default TableHead;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nulogy/components",
3
- "version": "10.2.2",
3
+ "version": "10.2.4",
4
4
  "description": "Component library for the Nulogy Design System - http://nulogy.design",
5
5
  "private": false,
6
6
  "publishConfig": {