@bento-core/paginated-table 1.0.1-icdc.17 → 1.0.1-icdc.18

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.
@@ -16,8 +16,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
16
16
  const TableController = props => {
17
17
  const {
18
18
  tblRows,
19
- table,
20
- onSortByColumn
19
+ table
21
20
  } = props;
22
21
  if (!tblRows) {
23
22
  return /*#__PURE__*/_react.default.createElement(_core.Container, {
@@ -49,12 +48,13 @@ const TableController = props => {
49
48
  * sort base on table state
50
49
  */
51
50
  const sortRows = (a, b) => {
51
+ console.log("sort column ".concat(sortBy));
52
52
  if (sortOrder === 'asc') {
53
53
  return alphaNumericSort(a, b);
54
54
  }
55
55
  return alphaNumericSort(b, a);
56
56
  };
57
- const sortedRows = onSortByColumn ? onSortByColumn(updateRows) : [...updateRows].sort((a, b) => sortRows(a, b));
57
+ const sortedRows = [...updateRows].sort((a, b) => sortRows(a, b));
58
58
  const startIndex = page * rowsPerPage;
59
59
  const endIndex = startIndex + rowsPerPage;
60
60
  const displayRows = [...sortedRows].slice(startIndex, endIndex);
@@ -205,7 +205,7 @@ const PaginatedTable = _ref => {
205
205
  onPageChange: customizeChangePage || handleChangePage,
206
206
  onRowSelectChange: customizeOnRowSelect || onRowSelectHandler,
207
207
  onToggleSelectAll: customizeToggleSelectAll || handleToggleSelectAll,
208
- onSortByColumn: customizeSortByColumn,
208
+ onSortByColumn: customizeSortByColumn || handleSortByColumn,
209
209
  onColumnViewChange: customizeColumnViewChange || handleColumnViewChange,
210
210
  onDeleteRow: customizeDeleteRow || onDeleteRow,
211
211
  onDeleteAllFiles: customizeDeleteAllRows || onDeleteAllRows,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bento-core/paginated-table",
3
- "version": "1.0.1-icdc.17",
3
+ "version": "1.0.1-icdc.18",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -7,7 +7,7 @@ import { setSelectedRows } from './TableService';
7
7
  * Updates table row when table state is changed 1. (paginated action) and 2. filter action
8
8
  */
9
9
  const TableController = ((props) => {
10
- const { tblRows, table, onSortByColumn } = props;
10
+ const { tblRows, table } = props;
11
11
  if (!tblRows) {
12
12
  return (
13
13
  <Container maxWidth="xl">
@@ -47,8 +47,7 @@ const TableController = ((props) => {
47
47
  }
48
48
  return alphaNumericSort(b, a);
49
49
  };
50
- const sortedRows = onSortByColumn ? onSortByColumn(updateRows)
51
- : [...updateRows].sort((a, b) => sortRows(a, b));
50
+ const sortedRows = [...updateRows].sort((a, b) => sortRows(a, b));
52
51
  const startIndex = page * rowsPerPage;
53
52
  const endIndex = startIndex + rowsPerPage;
54
53
  const displayRows = [...sortedRows].slice(startIndex, endIndex);
@@ -196,7 +196,7 @@ const PaginatedTable = ({
196
196
  onPageChange={customizeChangePage || handleChangePage}
197
197
  onRowSelectChange={customizeOnRowSelect || onRowSelectHandler}
198
198
  onToggleSelectAll={customizeToggleSelectAll || handleToggleSelectAll}
199
- onSortByColumn={customizeSortByColumn}
199
+ onSortByColumn={customizeSortByColumn || handleSortByColumn}
200
200
  onColumnViewChange={customizeColumnViewChange || handleColumnViewChange}
201
201
  onDeleteRow={customizeDeleteRow || onDeleteRow}
202
202
  onDeleteAllFiles={customizeDeleteAllRows || onDeleteAllRows}