@sproutsocial/racine 7.1.0-beta-maurice.0 → 7.1.0

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.
@@ -310,7 +310,6 @@ const colors = {
310
310
  hubspot: NETWORKCOLORS.NETWORK_COLOR_HUBSPOT,
311
311
  microsoft_dynamics: NETWORKCOLORS.NETWORK_COLOR_MICROSOFT_DYNAMICS,
312
312
  yelp: NETWORKCOLORS.NETWORK_COLOR_YELP,
313
-
314
313
  },
315
314
  };
316
315
 
@@ -71,7 +71,9 @@ var Checkbox = /*#__PURE__*/function (_React$Component) {
71
71
  _this$props$qa = _this$props.qa,
72
72
  qa = _this$props$qa === void 0 ? {} : _this$props$qa,
73
73
  tabIndex = _this$props.tabIndex,
74
- rest = _objectWithoutPropertiesLoose(_this$props, ["id", "value", "name", "label", "checked", "disabled", "indeterminate", "onChange", "ariaLabel", "appearance", "qa", "tabIndex"]);
74
+ _this$props$inputProp = _this$props.inputProps,
75
+ inputProps = _this$props$inputProp === void 0 ? {} : _this$props$inputProp,
76
+ rest = _objectWithoutPropertiesLoose(_this$props, ["id", "value", "name", "label", "checked", "disabled", "indeterminate", "onChange", "ariaLabel", "appearance", "qa", "tabIndex", "inputProps"]);
75
77
 
76
78
  var isPill = appearance === "pill"; // TODO: Refactor pill checkboxes to use fewer elements for performance gains
77
79
 
@@ -98,7 +100,7 @@ var Checkbox = /*#__PURE__*/function (_React$Component) {
98
100
  "data-qa-checkbox-ischecked": indeterminate ? "indeterminate" : checked === true,
99
101
  "data-qa-checkbox-isdisabled": disabled === true,
100
102
  tabIndex: tabIndex
101
- }, qa)), label && /*#__PURE__*/React.createElement(_styles.LabelText, {
103
+ }, qa, inputProps)), label && /*#__PURE__*/React.createElement(_styles.LabelText, {
102
104
  disabled: disabled
103
105
  }, label));
104
106
  }
@@ -126,13 +128,11 @@ var Checkbox = /*#__PURE__*/function (_React$Component) {
126
128
  "data-qa-checkbox-ischecked": indeterminate ? "indeterminate" : checked === true,
127
129
  "data-qa-checkbox-isdisabled": disabled === true,
128
130
  tabIndex: tabIndex
129
- }, qa)), /*#__PURE__*/React.createElement(_styles.CheckboxBox, null, /*#__PURE__*/React.createElement(_styles.CheckIcon, {
131
+ }, qa, inputProps)), /*#__PURE__*/React.createElement(_styles.CheckboxBox, null, /*#__PURE__*/React.createElement(_styles.CheckIcon, {
130
132
  name: indeterminate ? "minus" : "check",
131
133
  size: "mini",
132
134
  fixedWidth: true
133
- }))), label && !isPill && /*#__PURE__*/React.createElement(_styles.LabelText, {
134
- disabled: disabled
135
- }, label))
135
+ }))))
136
136
  );
137
137
  };
138
138
 
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- exports.default = void 0;
4
+ exports.default = exports.TableRow = exports.TableBody = exports.TableHead = exports.Table = void 0;
5
5
 
6
6
  var React = _interopRequireWildcard(require("react"));
7
7
 
@@ -21,78 +21,87 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
21
21
 
22
22
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
23
23
 
24
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
25
-
26
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
27
-
24
+ var renderTableRow = function renderTableRow(row) {
25
+ return /*#__PURE__*/React.createElement("tbody", {
26
+ key: row.id,
27
+ "data-qa-table-row": ""
28
+ }, /*#__PURE__*/React.createElement("tr", null, row.cells.map(function (td) {
29
+ return /*#__PURE__*/React.createElement(_TableCell.default, _extends({}, td, {
30
+ key: td.id
31
+ }));
32
+ })));
33
+ };
28
34
  /**
29
35
  * The table component assist in rendering tablular data.
30
36
  */
31
- var Table = /*#__PURE__*/function (_React$Component) {
32
- _inheritsLoose(Table, _React$Component);
33
-
34
- function Table() {
35
- var _this;
36
-
37
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
38
- args[_key] = arguments[_key];
39
- }
40
-
41
- _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
42
-
43
- _this.renderTableRow = function (row) {
44
- return /*#__PURE__*/React.createElement("tbody", {
45
- key: row.id,
46
- "data-qa-table-row": ""
47
- }, /*#__PURE__*/React.createElement("tr", null, row.cells.map(function (td) {
48
- return /*#__PURE__*/React.createElement(_TableCell.default, _extends({
49
- key: td.id
50
- }, td));
51
- })));
52
- };
53
-
54
- return _this;
37
+
38
+
39
+ var Table = function Table(_ref) {
40
+ var _ref$head = _ref.head,
41
+ head = _ref$head === void 0 ? [] : _ref$head,
42
+ _ref$rows = _ref.rows,
43
+ rows = _ref$rows === void 0 ? [] : _ref$rows,
44
+ onSort = _ref.onSort,
45
+ sortId = _ref.sortId,
46
+ sortDirection = _ref.sortDirection,
47
+ rowRender = _ref.rowRender,
48
+ children = _ref.children,
49
+ rest = _objectWithoutPropertiesLoose(_ref, ["head", "rows", "onSort", "sortId", "sortDirection", "rowRender", "children"]);
50
+
51
+ if (children) {
52
+ return /*#__PURE__*/React.createElement(_styles.default, _extends({}, rest, {
53
+ "data-qa-table": ""
54
+ }), children);
55
55
  }
56
56
 
57
- var _proto = Table.prototype;
58
-
59
- _proto.render = function render() {
60
- var _this2 = this;
61
-
62
- var _this$props = this.props,
63
- head = _this$props.head,
64
- rows = _this$props.rows,
65
- onSort = _this$props.onSort,
66
- sortId = _this$props.sortId,
67
- sortDirection = _this$props.sortDirection,
68
- rowRender = _this$props.rowRender,
69
- rest = _objectWithoutPropertiesLoose(_this$props, ["head", "rows", "onSort", "sortId", "sortDirection", "rowRender"]);
70
-
71
- return (
72
- /*#__PURE__*/
73
- // $FlowIssue - upgrade v0.112.0
74
- React.createElement(_styles.default, _extends({
75
- "data-qa-table": ""
76
- }, rest), head.length > 0 && /*#__PURE__*/React.createElement("thead", {
77
- "data-qa-table-header": ""
78
- }, /*#__PURE__*/React.createElement("tr", null, head.map(function (th) {
79
- return /*#__PURE__*/React.createElement(_TableHeaderCell.default, _extends({}, th, {
80
- key: th.id,
81
- onSort: onSort,
82
- sortId: sortId,
83
- sortDirection: sortDirection
84
- }));
85
- }))), rows.map(function (row) {
86
- return rowRender ? rowRender(row) : _this2.renderTableRow(row);
87
- }))
88
- );
89
- };
90
-
91
- return Table;
92
- }(React.Component);
93
-
94
- exports.default = Table;
95
- Table.defaultProps = {
96
- head: [],
97
- rows: []
98
- };
57
+ return /*#__PURE__*/React.createElement(_styles.default, _extends({}, rest, {
58
+ "data-qa-table": ""
59
+ }), head.length > 0 && /*#__PURE__*/React.createElement("thead", {
60
+ "data-qa-table-header": ""
61
+ }, /*#__PURE__*/React.createElement("tr", null, head.map(function (th) {
62
+ return /*#__PURE__*/React.createElement(_TableHeaderCell.default, _extends({}, th, {
63
+ key: th.id,
64
+ onSort: onSort,
65
+ sortId: sortId,
66
+ sortDirection: sortDirection
67
+ }));
68
+ }))), rows.map(function (row) {
69
+ return rowRender ? rowRender(row) : renderTableRow(row);
70
+ }));
71
+ };
72
+
73
+ exports.Table = Table;
74
+
75
+ var TableHead = function TableHead(_ref2) {
76
+ var children = _ref2.children,
77
+ props = _objectWithoutPropertiesLoose(_ref2, ["children"]);
78
+
79
+ return /*#__PURE__*/React.createElement("thead", props, children);
80
+ };
81
+
82
+ exports.TableHead = TableHead;
83
+
84
+ var TableBody = function TableBody(_ref3) {
85
+ var children = _ref3.children,
86
+ props = _objectWithoutPropertiesLoose(_ref3, ["children"]);
87
+
88
+ return /*#__PURE__*/React.createElement("tbody", props, children);
89
+ };
90
+
91
+ exports.TableBody = TableBody;
92
+
93
+ var TableRow = function TableRow(_ref4) {
94
+ var children = _ref4.children,
95
+ props = _objectWithoutPropertiesLoose(_ref4, ["children"]);
96
+
97
+ return /*#__PURE__*/React.createElement("tr", props, children);
98
+ };
99
+
100
+ exports.TableRow = TableRow;
101
+ Table.TableHead = TableHead;
102
+ Table.TableBody = TableBody;
103
+ Table.TableRow = TableRow;
104
+ Table.HeaderCell = _TableHeaderCell.default;
105
+ Table.Cell = _TableCell.default;
106
+ var _default = Table;
107
+ exports.default = _default;
@@ -40,15 +40,16 @@ var TableCell = /*#__PURE__*/function (_React$Component) {
40
40
  colSpan = _this$props.colSpan,
41
41
  width = _this$props.width,
42
42
  align = _this$props.align,
43
- rest = _objectWithoutPropertiesLoose(_this$props, ["id", "content", "colSpan", "width", "align"]);
43
+ children = _this$props.children,
44
+ rest = _objectWithoutPropertiesLoose(_this$props, ["id", "content", "colSpan", "width", "align", "children"]);
44
45
 
45
- return /*#__PURE__*/React.createElement(_styles.default, _extends({
46
+ return /*#__PURE__*/React.createElement(_styles.default, _extends({}, rest, {
46
47
  alignment: align || "left",
47
48
  key: id,
48
49
  colSpan: colSpan,
49
50
  width: width,
50
51
  "data-qa-table-cell": ""
51
- }, rest), content);
52
+ }), children || content);
52
53
  };
53
54
 
54
55
  return TableCell;
@@ -60,39 +60,54 @@ var TableHeaderCell = /*#__PURE__*/function (_React$Component) {
60
60
  }));
61
61
  };
62
62
 
63
+ _this.handleClick = function (e) {
64
+ var _this$props = _this.props,
65
+ onClick = _this$props.onClick,
66
+ onSort = _this$props.onSort,
67
+ isSortable = _this$props.isSortable,
68
+ id = _this$props.id;
69
+
70
+ if (onClick) {
71
+ onClick(e);
72
+ return;
73
+ }
74
+
75
+ if (!isSortable || !onSort) return;
76
+ onSort(id);
77
+ };
78
+
63
79
  return _this;
64
80
  }
65
81
 
66
82
  var _proto = TableHeaderCell.prototype;
67
83
 
68
84
  _proto.render = function render() {
69
- var _this$props = this.props,
70
- id = _this$props.id,
71
- content = _this$props.content,
72
- colSpan = _this$props.colSpan,
73
- width = _this$props.width,
74
- align = _this$props.align,
75
- isSortable = _this$props.isSortable,
76
- shouldTruncate = _this$props.shouldTruncate,
77
- onSort = _this$props.onSort,
78
- sortId = _this$props.sortId,
79
- sortDirection = _this$props.sortDirection,
80
- rest = _objectWithoutPropertiesLoose(_this$props, ["id", "content", "colSpan", "width", "align", "isSortable", "shouldTruncate", "onSort", "sortId", "sortDirection"]);
81
-
82
- return /*#__PURE__*/React.createElement(_styles.default, _extends({
85
+ var _this$props2 = this.props,
86
+ id = _this$props2.id,
87
+ content = _this$props2.content,
88
+ colSpan = _this$props2.colSpan,
89
+ width = _this$props2.width,
90
+ align = _this$props2.align,
91
+ isSortable = _this$props2.isSortable,
92
+ shouldTruncate = _this$props2.shouldTruncate,
93
+ onSort = _this$props2.onSort,
94
+ sortId = _this$props2.sortId,
95
+ sortDirection = _this$props2.sortDirection,
96
+ children = _this$props2.children,
97
+ onClick = _this$props2.onClick,
98
+ rest = _objectWithoutPropertiesLoose(_this$props2, ["id", "content", "colSpan", "width", "align", "isSortable", "shouldTruncate", "onSort", "sortId", "sortDirection", "children", "onClick"]);
99
+
100
+ return /*#__PURE__*/React.createElement(_styles.default, _extends({}, rest, {
83
101
  key: id,
84
102
  alignment: align || "left",
85
103
  sortable: isSortable,
86
104
  colSpan: colSpan,
87
105
  width: width,
88
- onClick: isSortable && onSort ? function () {
89
- return onSort(id);
90
- } : undefined,
106
+ onClick: this.handleClick,
91
107
  "data-tableheadercell-sortable": isSortable,
92
108
  "data-qa-table-header-cell": "",
93
- "data-qa-table-header-cell-sortdirection": sortDirection // $FlowIssue - upgrade v0.112.0
94
-
95
- }, rest), content, isSortable && this.getSortIcon(id === sortId));
109
+ "data-qa-table-header-cell-sortdirection": sortDirection
110
+ }), children || content, isSortable && !children && this.getSortIcon(id === sortId));
96
111
  };
97
112
 
98
113
  return TableHeaderCell;
@@ -72,9 +72,9 @@ var TableRowAccordion = /*#__PURE__*/function (_React$Component) {
72
72
  "data-tablerowaccordion-summary": true,
73
73
  onClick: this.handleToggle
74
74
  }, cells.map(function (td) {
75
- return /*#__PURE__*/React.createElement(_TableCell.default, _extends({
75
+ return /*#__PURE__*/React.createElement(_TableCell.default, _extends({}, td, {
76
76
  key: td.id
77
- }, td));
77
+ }));
78
78
  }), /*#__PURE__*/React.createElement(_TableCell.default, {
79
79
  id: "tableRowAccordion_trigger",
80
80
  content: /*#__PURE__*/React.createElement(_styles.Trigger, {
@@ -61,7 +61,9 @@ var Checkbox = /*#__PURE__*/function (_React$Component) {
61
61
  _this$props$qa = _this$props.qa,
62
62
  qa = _this$props$qa === void 0 ? {} : _this$props$qa,
63
63
  tabIndex = _this$props.tabIndex,
64
- rest = _objectWithoutPropertiesLoose(_this$props, ["id", "value", "name", "label", "checked", "disabled", "indeterminate", "onChange", "ariaLabel", "appearance", "qa", "tabIndex"]);
64
+ _this$props$inputProp = _this$props.inputProps,
65
+ inputProps = _this$props$inputProp === void 0 ? {} : _this$props$inputProp,
66
+ rest = _objectWithoutPropertiesLoose(_this$props, ["id", "value", "name", "label", "checked", "disabled", "indeterminate", "onChange", "ariaLabel", "appearance", "qa", "tabIndex", "inputProps"]);
65
67
 
66
68
  var isPill = appearance === "pill"; // TODO: Refactor pill checkboxes to use fewer elements for performance gains
67
69
 
@@ -88,7 +90,7 @@ var Checkbox = /*#__PURE__*/function (_React$Component) {
88
90
  "data-qa-checkbox-ischecked": indeterminate ? "indeterminate" : checked === true,
89
91
  "data-qa-checkbox-isdisabled": disabled === true,
90
92
  tabIndex: tabIndex
91
- }, qa)), label && /*#__PURE__*/React.createElement(LabelText, {
93
+ }, qa, inputProps)), label && /*#__PURE__*/React.createElement(LabelText, {
92
94
  disabled: disabled
93
95
  }, label));
94
96
  }
@@ -116,13 +118,11 @@ var Checkbox = /*#__PURE__*/function (_React$Component) {
116
118
  "data-qa-checkbox-ischecked": indeterminate ? "indeterminate" : checked === true,
117
119
  "data-qa-checkbox-isdisabled": disabled === true,
118
120
  tabIndex: tabIndex
119
- }, qa)), /*#__PURE__*/React.createElement(CheckboxBox, null, /*#__PURE__*/React.createElement(CheckIcon, {
121
+ }, qa, inputProps)), /*#__PURE__*/React.createElement(CheckboxBox, null, /*#__PURE__*/React.createElement(CheckIcon, {
120
122
  name: indeterminate ? "minus" : "check",
121
123
  size: "mini",
122
124
  fixedWidth: true
123
- }))), label && !isPill && /*#__PURE__*/React.createElement(LabelText, {
124
- disabled: disabled
125
- }, label))
125
+ }))))
126
126
  );
127
127
  };
128
128
 
@@ -2,83 +2,80 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
2
2
 
3
3
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
 
5
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
6
-
7
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
8
-
9
5
  import * as React from "react";
10
6
  import TableCell from "../TableCell";
11
7
  import TableHeaderCell from "../TableHeaderCell";
12
8
  import Container from "./styles";
13
9
 
10
+ var renderTableRow = function renderTableRow(row) {
11
+ return /*#__PURE__*/React.createElement("tbody", {
12
+ key: row.id,
13
+ "data-qa-table-row": ""
14
+ }, /*#__PURE__*/React.createElement("tr", null, row.cells.map(function (td) {
15
+ return /*#__PURE__*/React.createElement(TableCell, _extends({}, td, {
16
+ key: td.id
17
+ }));
18
+ })));
19
+ };
14
20
  /**
15
21
  * The table component assist in rendering tablular data.
16
22
  */
17
- var Table = /*#__PURE__*/function (_React$Component) {
18
- _inheritsLoose(Table, _React$Component);
19
-
20
- function Table() {
21
- var _this;
22
-
23
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
24
- args[_key] = arguments[_key];
25
- }
26
-
27
- _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
28
23
 
29
- _this.renderTableRow = function (row) {
30
- return /*#__PURE__*/React.createElement("tbody", {
31
- key: row.id,
32
- "data-qa-table-row": ""
33
- }, /*#__PURE__*/React.createElement("tr", null, row.cells.map(function (td) {
34
- return /*#__PURE__*/React.createElement(TableCell, _extends({
35
- key: td.id
36
- }, td));
37
- })));
38
- };
39
24
 
40
- return _this;
25
+ export var Table = function Table(_ref) {
26
+ var _ref$head = _ref.head,
27
+ head = _ref$head === void 0 ? [] : _ref$head,
28
+ _ref$rows = _ref.rows,
29
+ rows = _ref$rows === void 0 ? [] : _ref$rows,
30
+ onSort = _ref.onSort,
31
+ sortId = _ref.sortId,
32
+ sortDirection = _ref.sortDirection,
33
+ rowRender = _ref.rowRender,
34
+ children = _ref.children,
35
+ rest = _objectWithoutPropertiesLoose(_ref, ["head", "rows", "onSort", "sortId", "sortDirection", "rowRender", "children"]);
36
+
37
+ if (children) {
38
+ return /*#__PURE__*/React.createElement(Container, _extends({}, rest, {
39
+ "data-qa-table": ""
40
+ }), children);
41
41
  }
42
42
 
43
- var _proto = Table.prototype;
44
-
45
- _proto.render = function render() {
46
- var _this2 = this;
47
-
48
- var _this$props = this.props,
49
- head = _this$props.head,
50
- rows = _this$props.rows,
51
- onSort = _this$props.onSort,
52
- sortId = _this$props.sortId,
53
- sortDirection = _this$props.sortDirection,
54
- rowRender = _this$props.rowRender,
55
- rest = _objectWithoutPropertiesLoose(_this$props, ["head", "rows", "onSort", "sortId", "sortDirection", "rowRender"]);
43
+ return /*#__PURE__*/React.createElement(Container, _extends({}, rest, {
44
+ "data-qa-table": ""
45
+ }), head.length > 0 && /*#__PURE__*/React.createElement("thead", {
46
+ "data-qa-table-header": ""
47
+ }, /*#__PURE__*/React.createElement("tr", null, head.map(function (th) {
48
+ return /*#__PURE__*/React.createElement(TableHeaderCell, _extends({}, th, {
49
+ key: th.id,
50
+ onSort: onSort,
51
+ sortId: sortId,
52
+ sortDirection: sortDirection
53
+ }));
54
+ }))), rows.map(function (row) {
55
+ return rowRender ? rowRender(row) : renderTableRow(row);
56
+ }));
57
+ };
58
+ export var TableHead = function TableHead(_ref2) {
59
+ var children = _ref2.children,
60
+ props = _objectWithoutPropertiesLoose(_ref2, ["children"]);
56
61
 
57
- return (
58
- /*#__PURE__*/
59
- // $FlowIssue - upgrade v0.112.0
60
- React.createElement(Container, _extends({
61
- "data-qa-table": ""
62
- }, rest), head.length > 0 && /*#__PURE__*/React.createElement("thead", {
63
- "data-qa-table-header": ""
64
- }, /*#__PURE__*/React.createElement("tr", null, head.map(function (th) {
65
- return /*#__PURE__*/React.createElement(TableHeaderCell, _extends({}, th, {
66
- key: th.id,
67
- onSort: onSort,
68
- sortId: sortId,
69
- sortDirection: sortDirection
70
- }));
71
- }))), rows.map(function (row) {
72
- return rowRender ? rowRender(row) : _this2.renderTableRow(row);
73
- }))
74
- );
75
- };
62
+ return /*#__PURE__*/React.createElement("thead", props, children);
63
+ };
64
+ export var TableBody = function TableBody(_ref3) {
65
+ var children = _ref3.children,
66
+ props = _objectWithoutPropertiesLoose(_ref3, ["children"]);
76
67
 
77
- return Table;
78
- }(React.Component);
68
+ return /*#__PURE__*/React.createElement("tbody", props, children);
69
+ };
70
+ export var TableRow = function TableRow(_ref4) {
71
+ var children = _ref4.children,
72
+ props = _objectWithoutPropertiesLoose(_ref4, ["children"]);
79
73
 
80
- Table.defaultProps = {
81
- head: [],
82
- rows: []
74
+ return /*#__PURE__*/React.createElement("tr", props, children);
83
75
  };
84
- export { Table as default };
76
+ Table.TableHead = TableHead;
77
+ Table.TableBody = TableBody;
78
+ Table.TableRow = TableRow;
79
+ Table.HeaderCell = TableHeaderCell;
80
+ Table.Cell = TableCell;
81
+ export default Table;
@@ -28,15 +28,16 @@ var TableCell = /*#__PURE__*/function (_React$Component) {
28
28
  colSpan = _this$props.colSpan,
29
29
  width = _this$props.width,
30
30
  align = _this$props.align,
31
- rest = _objectWithoutPropertiesLoose(_this$props, ["id", "content", "colSpan", "width", "align"]);
31
+ children = _this$props.children,
32
+ rest = _objectWithoutPropertiesLoose(_this$props, ["id", "content", "colSpan", "width", "align", "children"]);
32
33
 
33
- return /*#__PURE__*/React.createElement(Container, _extends({
34
+ return /*#__PURE__*/React.createElement(Container, _extends({}, rest, {
34
35
  alignment: align || "left",
35
36
  key: id,
36
37
  colSpan: colSpan,
37
38
  width: width,
38
39
  "data-qa-table-cell": ""
39
- }, rest), content);
40
+ }), children || content);
40
41
  };
41
42
 
42
43
  return TableCell;
@@ -45,39 +45,54 @@ var TableHeaderCell = /*#__PURE__*/function (_React$Component) {
45
45
  }));
46
46
  };
47
47
 
48
+ _this.handleClick = function (e) {
49
+ var _this$props = _this.props,
50
+ onClick = _this$props.onClick,
51
+ onSort = _this$props.onSort,
52
+ isSortable = _this$props.isSortable,
53
+ id = _this$props.id;
54
+
55
+ if (onClick) {
56
+ onClick(e);
57
+ return;
58
+ }
59
+
60
+ if (!isSortable || !onSort) return;
61
+ onSort(id);
62
+ };
63
+
48
64
  return _this;
49
65
  }
50
66
 
51
67
  var _proto = TableHeaderCell.prototype;
52
68
 
53
69
  _proto.render = function render() {
54
- var _this$props = this.props,
55
- id = _this$props.id,
56
- content = _this$props.content,
57
- colSpan = _this$props.colSpan,
58
- width = _this$props.width,
59
- align = _this$props.align,
60
- isSortable = _this$props.isSortable,
61
- shouldTruncate = _this$props.shouldTruncate,
62
- onSort = _this$props.onSort,
63
- sortId = _this$props.sortId,
64
- sortDirection = _this$props.sortDirection,
65
- rest = _objectWithoutPropertiesLoose(_this$props, ["id", "content", "colSpan", "width", "align", "isSortable", "shouldTruncate", "onSort", "sortId", "sortDirection"]);
66
-
67
- return /*#__PURE__*/React.createElement(Container, _extends({
70
+ var _this$props2 = this.props,
71
+ id = _this$props2.id,
72
+ content = _this$props2.content,
73
+ colSpan = _this$props2.colSpan,
74
+ width = _this$props2.width,
75
+ align = _this$props2.align,
76
+ isSortable = _this$props2.isSortable,
77
+ shouldTruncate = _this$props2.shouldTruncate,
78
+ onSort = _this$props2.onSort,
79
+ sortId = _this$props2.sortId,
80
+ sortDirection = _this$props2.sortDirection,
81
+ children = _this$props2.children,
82
+ onClick = _this$props2.onClick,
83
+ rest = _objectWithoutPropertiesLoose(_this$props2, ["id", "content", "colSpan", "width", "align", "isSortable", "shouldTruncate", "onSort", "sortId", "sortDirection", "children", "onClick"]);
84
+
85
+ return /*#__PURE__*/React.createElement(Container, _extends({}, rest, {
68
86
  key: id,
69
87
  alignment: align || "left",
70
88
  sortable: isSortable,
71
89
  colSpan: colSpan,
72
90
  width: width,
73
- onClick: isSortable && onSort ? function () {
74
- return onSort(id);
75
- } : undefined,
91
+ onClick: this.handleClick,
76
92
  "data-tableheadercell-sortable": isSortable,
77
93
  "data-qa-table-header-cell": "",
78
- "data-qa-table-header-cell-sortdirection": sortDirection // $FlowIssue - upgrade v0.112.0
79
-
80
- }, rest), content, isSortable && this.getSortIcon(id === sortId));
94
+ "data-qa-table-header-cell-sortdirection": sortDirection
95
+ }), children || content, isSortable && !children && this.getSortIcon(id === sortId));
81
96
  };
82
97
 
83
98
  return TableHeaderCell;
@@ -58,9 +58,9 @@ var TableRowAccordion = /*#__PURE__*/function (_React$Component) {
58
58
  "data-tablerowaccordion-summary": true,
59
59
  onClick: this.handleToggle
60
60
  }, cells.map(function (td) {
61
- return /*#__PURE__*/React.createElement(TableCell, _extends({
61
+ return /*#__PURE__*/React.createElement(TableCell, _extends({}, td, {
62
62
  key: td.id
63
- }, td));
63
+ }));
64
64
  }), /*#__PURE__*/React.createElement(TableCell, {
65
65
  id: "tableRowAccordion_trigger",
66
66
  content: /*#__PURE__*/React.createElement(Trigger, {