sag_components 1.0.1011 → 1.0.1013

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.
@@ -35,6 +35,7 @@ const ReportTable = props => {
35
35
  useCheckBoxes,
36
36
  width,
37
37
  height,
38
+ sortKey,
38
39
  className
39
40
  } = props;
40
41
  const [FormattedTableData, setFormattedTableData] = (0, _react.useState)(tableData);
@@ -92,7 +93,6 @@ const ReportTable = props => {
92
93
  setFormattedTableData(newTableData);
93
94
  }, [tableData, useSelectButtons, useCheckBoxes]);
94
95
  const handleButtonClick = index => {
95
- // Toggle: If already active, unclick it; otherwise, click it
96
96
  setActiveSortColumn(prevState => prevState === index ? null : index);
97
97
  };
98
98
  const columnsNumber = tableData.columnsHeadings.length;
@@ -206,7 +206,7 @@ const ReportTable = props => {
206
206
  });
207
207
  }
208
208
  return /*#__PURE__*/_react.default.createElement(_ReportTable.Th, {
209
- key: index
209
+ key: headline.key
210
210
  }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("span", null, headline.label), headline.sortable && /*#__PURE__*/_react.default.createElement("button", {
211
211
  style: {
212
212
  border: "none",
@@ -214,7 +214,10 @@ const ReportTable = props => {
214
214
  boxShadow: "none",
215
215
  padding: "0"
216
216
  },
217
- onClick: () => handleButtonClick(index)
217
+ onClick: () => {
218
+ sortKey(headline.key);
219
+ handleButtonClick(index);
220
+ }
218
221
  }, /*#__PURE__*/_react.default.createElement(_SortIcon.SortIcon, {
219
222
  fill: activeSortColumn === index ? "#229E38" : "#D0D0D0"
220
223
  }))));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sag_components",
3
- "version": "1.0.1011",
3
+ "version": "1.0.1013",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {