@carbon/ibm-products 1.60.0 → 1.61.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. package/css/index-full-carbon.css +57 -37
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +4 -4
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +9 -3
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +1 -1
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +47 -22
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +3 -3
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +47 -37
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +4 -4
  16. package/css/index.min.css.map +1 -1
  17. package/es/components/Datagrid/Datagrid/DatagridContent.js +3 -1
  18. package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +10 -54
  19. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +9 -8
  20. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +6 -12
  21. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +0 -5
  22. package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +17 -5
  23. package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +4 -3
  24. package/es/components/Datagrid/Datagrid/addons/stateReducer.js +37 -24
  25. package/es/components/Datagrid/useColumnCenterAlign.js +6 -6
  26. package/es/components/Datagrid/useColumnRightAlign.js +6 -6
  27. package/es/components/Datagrid/useInlineEdit.js +1 -6
  28. package/es/components/Datagrid/useNestedRowExpander.js +10 -1
  29. package/es/components/Datagrid/useRowExpander.js +11 -1
  30. package/es/components/Datagrid/useSortableColumns.js +6 -5
  31. package/es/components/FilterSummary/FilterSummary.js +6 -2
  32. package/es/components/Guidebanner/Guidebanner.js +3 -3
  33. package/es/components/Guidebanner/GuidebannerElement.js +9 -3
  34. package/es/components/Guidebanner/GuidebannerElementButton.js +9 -4
  35. package/es/components/Guidebanner/GuidebannerElementLink.js +9 -3
  36. package/es/components/InlineTip/InlineTipButton.js +7 -0
  37. package/es/components/InlineTip/InlineTipLink.js +7 -0
  38. package/es/components/TagSet/TagSet.js +11 -3
  39. package/es/components/TagSet/TagSetOverflow.js +16 -5
  40. package/es/components/index.js +2 -2
  41. package/es/global/js/package-settings.js +5 -0
  42. package/es/global/js/utils/getNodeTextContent.js +51 -0
  43. package/lib/components/Datagrid/Datagrid/DatagridContent.js +3 -1
  44. package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +9 -54
  45. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +9 -8
  46. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +6 -12
  47. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +0 -5
  48. package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +15 -3
  49. package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +7 -3
  50. package/lib/components/Datagrid/Datagrid/addons/stateReducer.js +38 -33
  51. package/lib/components/Datagrid/useInlineEdit.js +1 -6
  52. package/lib/components/Datagrid/useNestedRowExpander.js +10 -9
  53. package/lib/components/Datagrid/useRowExpander.js +11 -9
  54. package/lib/components/Datagrid/useSortableColumns.js +6 -5
  55. package/lib/components/FilterSummary/FilterSummary.js +6 -2
  56. package/lib/components/Guidebanner/Guidebanner.js +3 -3
  57. package/lib/components/Guidebanner/GuidebannerElement.js +8 -1
  58. package/lib/components/Guidebanner/GuidebannerElementButton.js +8 -1
  59. package/lib/components/Guidebanner/GuidebannerElementLink.js +8 -1
  60. package/lib/components/InlineTip/InlineTipButton.js +8 -1
  61. package/lib/components/InlineTip/InlineTipLink.js +8 -1
  62. package/lib/components/TagSet/TagSet.js +11 -3
  63. package/lib/components/TagSet/TagSetOverflow.js +16 -5
  64. package/lib/components/index.js +30 -0
  65. package/lib/global/js/package-settings.js +5 -0
  66. package/lib/global/js/utils/getNodeTextContent.js +59 -0
  67. package/package.json +4 -4
  68. package/scss/components/CoachmarkBeacon/_coachmark-beacon.scss +0 -15
  69. package/scss/components/Datagrid/_datagrid.scss +1 -0
  70. package/scss/components/Datagrid/_storybook-styles.scss +15 -0
  71. package/scss/components/Datagrid/styles/_useInlineEdit.scss +7 -11
  72. package/scss/components/Datagrid/styles/addons/_RowSizeDropdown.scss +42 -1
  73. package/scss/components/TagSet/_tag-set.scss +13 -3
  74. package/es/components/Datagrid/utils/getColTitle.js +0 -25
  75. package/lib/components/Datagrid/utils/getColTitle.js +0 -32
@@ -16,7 +16,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
16
16
  var _carbonComponentsReact = require("carbon-components-react");
17
17
  var _settings = require("../../settings");
18
18
  var _pconsole = require("../../global/js/utils/pconsole");
19
- var _excluded = ["allTagsModalSearchThreshold", "className", "onShowAllClick", "overflowAlign", "overflowDirection", "overflowTags", "showAllTagsLabel"];
19
+ var _excluded = ["allTagsModalSearchThreshold", "className", "onShowAllClick", "overflowAlign", "overflowDirection", "overflowTags", "overflowType", "showAllTagsLabel"];
20
20
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
21
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
22
22
  var componentName = 'TagSetOverflow';
@@ -38,6 +38,7 @@ var TagSetOverflow = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref)
38
38
  _ref$overflowDirectio = _ref.overflowDirection,
39
39
  overflowDirection = _ref$overflowDirectio === void 0 ? defaults.overflowDirection : _ref$overflowDirectio,
40
40
  overflowTags = _ref.overflowTags,
41
+ overflowType = _ref.overflowType,
41
42
  showAllTagsLabel = _ref.showAllTagsLabel,
42
43
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
43
44
  var _useState = (0, _react.useState)(false),
@@ -81,12 +82,18 @@ var TagSetOverflow = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref)
81
82
  }, overflowTags.filter(function (_, index) {
82
83
  return overflowTags.length > allTagsModalSearchThreshold ? index < allTagsModalSearchThreshold : index <= allTagsModalSearchThreshold;
83
84
  }).map(function (tag, index) {
85
+ var _cx2;
86
+ var tagProps = {};
87
+ if (overflowType === 'tag') {
88
+ tagProps.type = 'high-contrast';
89
+ }
90
+ if (overflowType === 'default') {
91
+ tagProps.filter = false;
92
+ }
84
93
  return /*#__PURE__*/_react.default.createElement("li", {
85
- className: "".concat(blockClass, "__tag-item"),
94
+ className: (0, _classnames.default)("".concat(blockClass, "__tag-item"), (_cx2 = {}, (0, _defineProperty2.default)(_cx2, "".concat(blockClass, "__tag-item--default"), overflowType === 'default'), (0, _defineProperty2.default)(_cx2, "".concat(blockClass, "__tag-item--tag"), overflowType === 'tag'), _cx2)),
86
95
  key: index
87
- }, /*#__PURE__*/_react.default.cloneElement(tag, {
88
- filter: false
89
- }));
96
+ }, /*#__PURE__*/_react.default.cloneElement(tag, tagProps));
90
97
  })), overflowTags.length > allTagsModalSearchThreshold && /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Link, {
91
98
  className: "".concat(blockClass, "__show-all-tags-link"),
92
99
  href: "",
@@ -121,6 +128,10 @@ TagSetOverflow.propTypes = {
121
128
  * tags shown in overflow
122
129
  */
123
130
  overflowTags: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
131
+ /**
132
+ * Type of rendering displayed inside of the tag overflow component
133
+ */
134
+ overflowType: _propTypes.default.oneOf(['default', 'tag']),
124
135
  /**
125
136
  * label for the overflow show all tags link
126
137
  */
@@ -207,6 +207,24 @@ Object.defineProperty(exports, "Guidebanner", {
207
207
  return _Guidebanner.Guidebanner;
208
208
  }
209
209
  });
210
+ Object.defineProperty(exports, "GuidebannerElement", {
211
+ enumerable: true,
212
+ get: function get() {
213
+ return _Guidebanner.GuidebannerElement;
214
+ }
215
+ });
216
+ Object.defineProperty(exports, "GuidebannerElementButton", {
217
+ enumerable: true,
218
+ get: function get() {
219
+ return _Guidebanner.GuidebannerElementButton;
220
+ }
221
+ });
222
+ Object.defineProperty(exports, "GuidebannerElementLink", {
223
+ enumerable: true,
224
+ get: function get() {
225
+ return _Guidebanner.GuidebannerElementLink;
226
+ }
227
+ });
210
228
  Object.defineProperty(exports, "HTTPError403", {
211
229
  enumerable: true,
212
230
  get: function get() {
@@ -243,6 +261,18 @@ Object.defineProperty(exports, "InlineTip", {
243
261
  return _InlineTip.InlineTip;
244
262
  }
245
263
  });
264
+ Object.defineProperty(exports, "InlineTipButton", {
265
+ enumerable: true,
266
+ get: function get() {
267
+ return _InlineTip.InlineTipButton;
268
+ }
269
+ });
270
+ Object.defineProperty(exports, "InlineTipLink", {
271
+ enumerable: true,
272
+ get: function get() {
273
+ return _InlineTip.InlineTipLink;
274
+ }
275
+ });
246
276
  Object.defineProperty(exports, "ModifiedTabs", {
247
277
  enumerable: true,
248
278
  get: function get() {
@@ -73,7 +73,12 @@ var defaults = {
73
73
  ButtonMenu: false,
74
74
  // Novice to pro components not yet reviewed and released:
75
75
  InlineTip: false,
76
+ InlineTipButton: false,
77
+ InlineTipLink: false,
76
78
  Guidebanner: false,
79
+ GuidebannerElement: false,
80
+ GuidebannerElementButton: false,
81
+ GuidebannerElementLink: false,
77
82
  NonLinearReading: false,
78
83
  Checklist: false,
79
84
  Coachmark: false,
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.getNodeTextContent = void 0;
8
+ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
9
+ /**
10
+ * Copyright IBM Corp. 2023, 2023
11
+ *
12
+ * This source code is licensed under the Apache-2.0 license found in the
13
+ * LICENSE file in the root directory of this source tree.
14
+ */
15
+
16
+ /**
17
+ * Returns a compiled string of all the text content of a React node and any of its child nodes.
18
+ * This is meant to be used in a limited fashion to convert a "styled" sentence into a single string:
19
+ * e.g. <p>Title <b>Page</b>.</p> --> "Title Page."
20
+ * This will likely not work for arrays of nodes due to the lack of word spacing:
21
+ * e.g. <ul>
22
+ * <li>Item 1</li>
23
+ * <li>Item 2</li>
24
+ * <li>Item 3</li>
25
+ * </ul>
26
+ * --> "Item 1Item 2Item 3"
27
+ * @param {Node} node A React node
28
+ * @returns {string}
29
+ */
30
+ var getNodeTextContent = function getNodeTextContent(node) {
31
+ if (node == null) {
32
+ return '';
33
+ }
34
+ switch ((0, _typeof2.default)(node)) {
35
+ case 'string':
36
+ case 'number':
37
+ return node.toString();
38
+ case 'object':
39
+ {
40
+ if (node instanceof Array) {
41
+ return node.map(getNodeTextContent).join('');
42
+ }
43
+ if ('props' in node) {
44
+ return getNodeTextContent(node.props.children);
45
+ }
46
+
47
+ // Ignore any other JavaScript 'object' types.
48
+ return '';
49
+ }
50
+ case 'function':
51
+ {
52
+ return getNodeTextContent(node());
53
+ }
54
+ default:
55
+ // Ignore all other JavaScript types.
56
+ return '';
57
+ }
58
+ };
59
+ exports.getNodeTextContent = getNodeTextContent;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/ibm-products",
3
3
  "description": "Carbon for IBM Products",
4
- "version": "1.60.0",
4
+ "version": "1.61.1",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -91,11 +91,11 @@
91
91
  "@carbon/motion": "^10.29.2",
92
92
  "@carbon/themes": "^10.55.3",
93
93
  "@carbon/type": "^10.45.3",
94
- "carbon-components": "^10.58.10",
95
- "carbon-components-react": "^7.59.14",
94
+ "carbon-components": "^10.58.12",
95
+ "carbon-components-react": "^7.59.16",
96
96
  "carbon-icons": "^7.0.7",
97
97
  "react": "^16.8.6 || ^17.0.1",
98
98
  "react-dom": "^16.8.6 || ^17.0.1"
99
99
  },
100
- "gitHead": "60db5711e16835785348a1fc148a7c346bad5bde"
100
+ "gitHead": "9c214f67bed9419967e0d865ab4fec31f923c64c"
101
101
  }
@@ -46,21 +46,6 @@
46
46
  }
47
47
  }
48
48
 
49
- &-ring {
50
- .#{$block-class}__center {
51
- -webkit-mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' version='1.1' width='80px' height='80px' viewBox='008080'><pathfill='white' stroke='none' d='M0,0m37-2a404001010Zm128a1212011-10Z'/></svg>");
52
- mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' version='1.1' width='80px' height='80px' viewBox='008080'><pathfill='white' stroke='none' d='M0,0m37-2a404001010Zm128a1212011-10Z'/></svg>");
53
-
54
- circle {
55
- /* stylelint-disable-next-line carbon/motion-easing-use */
56
- animation: ring-ripple $beaconAnimationTime infinite;
57
- @media (prefers-reduced-motion) {
58
- animation: none;
59
- }
60
- }
61
- }
62
- }
63
-
64
49
  .#{$block-class}__target {
65
50
  // the hit area
66
51
  position: absolute;
@@ -19,6 +19,7 @@
19
19
 
20
20
  // Datagrid uses the following Carbon for IBM Products components:
21
21
  // TODO: @import(s) of IBM Products component styles used by Datagrid
22
+ @import '../FilterSummary/filter-summary';
22
23
 
23
24
  // Define all component styles in a mixin which is then exported using
24
25
  // the Carbon import-once mechanism.
@@ -147,3 +147,18 @@ $block-class: #{$pkg-prefix}--datagrid;
147
147
  width: 100vw;
148
148
  }
149
149
  }
150
+
151
+ .#{$carbon-prefix}--tooltip__trigger:hover
152
+ .#{$pkg-prefix}--status-icon--light.#{$pkg-prefix}--status-icon--light-minor-warning {
153
+ fill: $support-03;
154
+ }
155
+
156
+ .#{$carbon-prefix}--tooltip__trigger:hover
157
+ .#{$pkg-prefix}--status-icon--light.#{$pkg-prefix}--status-icon--light-normal {
158
+ fill: $support-02;
159
+ }
160
+
161
+ .#{$carbon-prefix}--tooltip__trigger:hover
162
+ .#{$pkg-prefix}--status-icon--light.#{$pkg-prefix}--status-icon--light-critical {
163
+ fill: $support-01;
164
+ }
@@ -108,18 +108,14 @@ $row-heights: (
108
108
  justify-content: flex-start;
109
109
  }
110
110
  // Always show renderIcon if inline edit columns are less than half of total columns
111
- &:not(
112
- .#{$block-class}__inline-edit-button--edit-less-than-half-of-total-cols
113
- ) {
114
- .#{$block-class}__inline-edit-button-icon {
115
- display: none;
116
- }
111
+ .#{$block-class}__inline-edit-button-icon {
112
+ display: none;
113
+ }
117
114
 
118
- /* stylelint-disable-next-line */
119
- &:hover {
120
- .#{$block-class}__inline-edit-button-icon {
121
- display: block;
122
- }
115
+ &:hover,
116
+ &.#{$block-class}__inline-edit-button--active {
117
+ .#{$block-class}__inline-edit-button-icon {
118
+ display: block;
123
119
  }
124
120
  }
125
121
  }
@@ -22,7 +22,48 @@
22
22
  }
23
23
 
24
24
  .#{$carbon-prefix}--btn--ghost.#{$block-class}__row-size-button--open {
25
- background-color: $ui-background;
25
+ background-color: $ui-02;
26
26
 
27
27
  box-shadow: 1px 4px 8px -3px $overlay-01, -1px 6px 8px -5px $overlay-01;
28
28
  }
29
+
30
+ // Top align cell content for xl row size
31
+ .#{$block-class}
32
+ table.#{$carbon-prefix}--data-table--xl.#{$block-class}__vertical-align-center
33
+ td,
34
+ .#{$block-class}
35
+ table.#{$carbon-prefix}--data-table--xl.#{$block-class}__vertical-align-top
36
+ td {
37
+ align-items: flex-start;
38
+ padding-top: $spacing-05;
39
+ padding-bottom: $spacing-05;
40
+
41
+ &.#{$block-class}__actions-column-cell {
42
+ padding-left: $spacing-03;
43
+ }
44
+ }
45
+
46
+ // Top align header content for xl row size
47
+ .#{$block-class}
48
+ table.#{$carbon-prefix}--data-table--xl.#{$block-class}__vertical-align-center
49
+ th,
50
+ .#{$block-class}
51
+ table.#{$carbon-prefix}--data-table--xl.#{$block-class}__vertical-align-top
52
+ th {
53
+ .#{$carbon-prefix}--table-header-label {
54
+ align-items: flex-start;
55
+ }
56
+ }
57
+
58
+ // Top align checkbox row header for xl row size
59
+ .#{$block-class}
60
+ table.#{$carbon-prefix}--data-table--xl.#{$block-class}__vertical-align-center
61
+ .#{$block-class}__checkbox-cell
62
+ th.#{$carbon-prefix}--table-column-checkbox {
63
+ align-items: flex-start;
64
+ padding-top: $spacing-04;
65
+ }
66
+
67
+ .#{$block-class}__row-size__row-settings-trigger--open.#{$carbon-prefix}--btn--ghost {
68
+ background-color: $ui-02;
69
+ }
@@ -70,7 +70,7 @@ $block-class-modal: #{$block-class}-modal;
70
70
  }
71
71
 
72
72
  .#{$block-class-overflow}__tooltip
73
- .#{$block-class-overflow}__tag-item
73
+ .#{$block-class-overflow}__tag-item--default
74
74
  .#{$carbon-prefix}--tag {
75
75
  border-radius: 0;
76
76
  }
@@ -127,13 +127,23 @@ $block-class-modal: #{$block-class}-modal;
127
127
  text-align: left;
128
128
  }
129
129
 
130
+ &.#{$carbon-prefix}--tooltip button {
131
+ padding-right: 0;
132
+ }
133
+
130
134
  .#{$block-class-overflow}__show-all-tags-link {
131
135
  display: inline-block;
132
136
  margin: $spacing-03 0 $spacing-02; // to match the tags
133
137
  }
134
138
 
135
- .#{$block-class-overflow}__tag-item,
136
- .#{$block-class-overflow}__tag-item .#{$carbon-prefix}--tag {
139
+ .#{$block-class-overflow}__tag-item.#{$block-class-overflow}__tag-item--tag
140
+ .#{$carbon-prefix}--tag {
141
+ background-color: $inverse-hover-ui;
142
+ }
143
+
144
+ .#{$block-class-overflow}__tag-item.#{$block-class-overflow}__tag-item--default,
145
+ .#{$block-class-overflow}__tag-item.#{$block-class-overflow}__tag-item--default
146
+ .#{$carbon-prefix}--tag {
137
147
  @include carbon--type-style('body-short-01');
138
148
 
139
149
  display: block;
@@ -1,25 +0,0 @@
1
- // This function recursively looks for the nested header element until we can find the key which contains the title.
2
- // This can happen if multiple hooks are used together that manipulate the rendering of the column
3
- // header, such as `useColumnCenterAlign` and `useSortableColumns`.
4
- var getNestedTitle = function getNestedTitle(component) {
5
- if (component && !component.key) {
6
- return getNestedTitle(component.children);
7
- }
8
- if (component && component.key && typeof component.key === 'string') {
9
- return component.key;
10
- }
11
- };
12
- var getColTitle = function getColTitle(col) {
13
- var _col$Header, _col$Header$props;
14
- if (!col) {
15
- return;
16
- }
17
- var checkTitle = function checkTitle() {
18
- if (col.Header().props.children.props && col.Header().props.children.props.title) {
19
- return col.Header().props.children.props.title;
20
- }
21
- return getNestedTitle(col.Header().props.children.props);
22
- };
23
- return typeof (col === null || col === void 0 ? void 0 : col.Header) === 'function' ? checkTitle() : col === null || col === void 0 ? void 0 : (_col$Header = col.Header) === null || _col$Header === void 0 ? void 0 : (_col$Header$props = _col$Header.props) === null || _col$Header$props === void 0 ? void 0 : _col$Header$props.title;
24
- };
25
- export default getColTitle;
@@ -1,32 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- // This function recursively looks for the nested header element until we can find the key which contains the title.
8
- // This can happen if multiple hooks are used together that manipulate the rendering of the column
9
- // header, such as `useColumnCenterAlign` and `useSortableColumns`.
10
- var getNestedTitle = function getNestedTitle(component) {
11
- if (component && !component.key) {
12
- return getNestedTitle(component.children);
13
- }
14
- if (component && component.key && typeof component.key === 'string') {
15
- return component.key;
16
- }
17
- };
18
- var getColTitle = function getColTitle(col) {
19
- var _col$Header, _col$Header$props;
20
- if (!col) {
21
- return;
22
- }
23
- var checkTitle = function checkTitle() {
24
- if (col.Header().props.children.props && col.Header().props.children.props.title) {
25
- return col.Header().props.children.props.title;
26
- }
27
- return getNestedTitle(col.Header().props.children.props);
28
- };
29
- return typeof (col === null || col === void 0 ? void 0 : col.Header) === 'function' ? checkTitle() : col === null || col === void 0 ? void 0 : (_col$Header = col.Header) === null || _col$Header === void 0 ? void 0 : (_col$Header$props = _col$Header.props) === null || _col$Header$props === void 0 ? void 0 : _col$Header$props.title;
30
- };
31
- var _default = getColTitle;
32
- exports.default = _default;