@stokr/components-library 2.3.34 → 2.3.35
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.
|
@@ -30,34 +30,26 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
30
30
|
var ReactTableWrapper = function ReactTableWrapper(props) {
|
|
31
31
|
var makeNewColumns = function makeNewColumns(data) {
|
|
32
32
|
return data === null || data === void 0 ? void 0 : data.map(function (column) {
|
|
33
|
-
if (column.key === 'dropdown') {
|
|
33
|
+
if (column.key === 'dropdown' || column.accessor === 'dropdown') {
|
|
34
34
|
return {
|
|
35
35
|
Header: function Header() {
|
|
36
36
|
return null;
|
|
37
37
|
},
|
|
38
|
-
id: column.key,
|
|
38
|
+
id: column.key || column.accessor,
|
|
39
39
|
Cell: function Cell(_ref) {
|
|
40
40
|
var row = _ref.row;
|
|
41
|
-
return (
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
// We can use the getToggleRowExpandedProps prop-getter
|
|
45
|
-
// to build the expander. (moved to the whole row to make it easier to click)
|
|
46
|
-
_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_Table.TableDropdownIcon, {
|
|
47
|
-
isActive: row.isExpanded
|
|
48
|
-
}))
|
|
49
|
-
);
|
|
41
|
+
return /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_Table.TableDropdownIcon, {
|
|
42
|
+
isActive: row.isExpanded
|
|
43
|
+
}));
|
|
50
44
|
}
|
|
51
45
|
};
|
|
52
46
|
}
|
|
53
47
|
return {
|
|
54
|
-
Header: column.label,
|
|
55
|
-
accessor: column.key
|
|
56
|
-
//totalWidth: 50, // column.width,
|
|
48
|
+
Header: column.Header || column.label,
|
|
49
|
+
accessor: column.accessor || column.key
|
|
57
50
|
};
|
|
58
51
|
});
|
|
59
52
|
};
|
|
60
|
-
|
|
61
53
|
var memoizedColumns = _react.default.useMemo(function () {
|
|
62
54
|
return makeNewColumns(props.columns);
|
|
63
55
|
}, []);
|