@bento-core/table 1.0.0-c3dc.25 → 1.0.0-c3dc.27

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.
@@ -1,52 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _core = require("@material-ui/core");
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
- const ColumnGrouping = _ref => {
11
- let {
12
- columnGroups = [],
13
- columns = []
14
- } = _ref;
15
- if (columnGroups.length === 0) {
16
- return null;
17
- }
18
- const getColSpan = function getColSpan() {
19
- let indexes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [0, 0];
20
- const startIndex = indexes[0];
21
- const endIndex = indexes[1];
22
- const displayGroupCols = columns.map((col, index) => startIndex <= index && index <= endIndex && col.display).filter(item => item);
23
- return displayGroupCols.length;
24
- };
25
- return /*#__PURE__*/_react.default.createElement(_core.TableRow, {
26
- className: "column_grouping"
27
- }, columnGroups.map(group => {
28
- const {
29
- title,
30
- customViewRender,
31
- clsName,
32
- columnIndexes
33
- } = group;
34
- if (!columnIndexes) {
35
- return /*#__PURE__*/_react.default.createElement(_core.Typography, {
36
- variant: "subtitle1",
37
- color: "error",
38
- size: "sm"
39
- }, "Missing columnIndexes [startColIndex, endColIndex]");
40
- }
41
- const colSpan = getColSpan(columnIndexes);
42
- if (colSpan > 0) {
43
- return /*#__PURE__*/_react.default.createElement(_core.TableCell, {
44
- colSpan: colSpan,
45
- className: clsName
46
- }, customViewRender ? customViewRender() : title);
47
- }
48
- return null;
49
- }));
50
- };
51
- var _default = ColumnGrouping;
52
- exports.default = _default;