@rhc-shared-components/packages-table 0.3.6 → 1.0.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.
package/dist/index.js CHANGED
@@ -1,14 +1,17 @@
1
1
  var React = require('react');
2
2
  var reactCore = require('@patternfly/react-core');
3
3
  var lodash = require('lodash');
4
- var Tooltip = require('@patternfly/react-core/dist/esm/components/Tooltip/Tooltip');
5
- var Button = require('@patternfly/react-core/dist/esm/components/Button/Button');
4
+ var helpers = require('@patternfly/react-core/dist/esm/helpers');
6
5
  var mergeWith = require('lodash/mergeWith');
6
+ var Tooltip = require('@patternfly/react-core/dist/esm/components/Tooltip');
7
+ var Button = require('@patternfly/react-core/dist/esm/components/Button');
8
+ var Popover = require('@patternfly/react-core/dist/esm/components/Popover');
9
+ var Tooltip$1 = require('@patternfly/react-core/dist/esm/components/Tooltip/Tooltip');
7
10
  var Dropdown = require('@patternfly/react-core/dist/esm/components/Dropdown');
8
- var KebabToggle = require('@patternfly/react-core/dist/esm/components/Dropdown/KebabToggle');
9
- var DropdownItem = require('@patternfly/react-core/dist/esm/components/Dropdown/DropdownItem');
10
- var DropdownSeparator = require('@patternfly/react-core/dist/esm/components/Dropdown/DropdownSeparator');
11
- var dropdownConstants = require('@patternfly/react-core/dist/esm/components/Dropdown/dropdownConstants');
11
+ var Divider = require('@patternfly/react-core/dist/esm/components/Divider');
12
+ var MenuToggle = require('@patternfly/react-core/dist/esm/components/MenuToggle');
13
+ var Checkbox = require('@patternfly/react-core/dist/esm/components/Checkbox');
14
+ var deprecated = require('@patternfly/react-core/deprecated');
12
15
  var dateFns = require('date-fns');
13
16
 
14
17
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -37,6 +40,38 @@ var mergeWith__default = /*#__PURE__*/_interopDefaultLegacy(mergeWith);
37
40
 
38
41
  var css_248z = ".vulnerabilities-table .impact-icon {\n font-size: 1.5rem;\n padding-right: 0.5rem;\n}\n.vulnerabilities-table .impact-icon.color-critical {\n color: #a30000;\n}\n.vulnerabilities-table .impact-icon.color-important {\n color: #ec7a08;\n}\n.vulnerabilities-table .impact-icon.color-moderate {\n color: #f5c12e;\n}\n.vulnerabilities-table .impact-icon.color-low {\n color: #777;\n}\n.vulnerabilities-table__affected-packages-cell {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n.vulnerabilities-table__impact-cell {\n display: flex;\n align-items: center;\n flex-wrap: nowrap;\n}\n\n.filterable-table {\n padding-bottom: var(--pf-global--spacer--lg);\n}\n.filterable-table__bottom-pagination[class] {\n margin-top: 1rem;\n}\n.filterable-table .pf-c-toolbar {\n padding-top: 0;\n}\n.filterable-table .pf-c-toolbar__content {\n --pf-c-toolbar__content--PaddingRight: 0;\n --pf-c-toolbar__content--PaddingLeft: 0;\n}\n.filterable-table .pf-c-input-group__text {\n --pf-c-input-group__text--PaddingRight: 0;\n}\n.filterable-table .pf-c-pagination.pf-m-bottom {\n --pf-c-pagination--m-bottom--md--PaddingRight: 0;\n}\n\n.packages-table .pf-c-tabs__item > button {\n padding: 1rem 1.5rem;\n}\n.packages-table__excluded-packages-disclaimer {\n margin: 1rem 0 0 0.5rem;\n}\n\n.filter-input {\n width: 18rem;\n margin: 1rem 0 1rem 0;\n}";
39
42
 
43
+ /******************************************************************************
44
+ Copyright (c) Microsoft Corporation.
45
+
46
+ Permission to use, copy, modify, and/or distribute this software for any
47
+ purpose with or without fee is hereby granted.
48
+
49
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
50
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
51
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
52
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
53
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
54
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
55
+ PERFORMANCE OF THIS SOFTWARE.
56
+ ***************************************************************************** */
57
+ function __rest$1(s, e) {
58
+ var t = {};
59
+
60
+ for (var p in s) {
61
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
62
+ }
63
+
64
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
65
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
66
+ }
67
+ return t;
68
+ }
69
+
70
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
71
+ var e = new Error(message);
72
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
73
+ };
74
+
40
75
  function _inheritsLoose(subClass, superClass) {
41
76
  subClass.prototype = Object.create(superClass.prototype);
42
77
  subClass.prototype.constructor = subClass;
@@ -80,29 +115,212 @@ function __rest(s, e) {
80
115
  return t;
81
116
  }
82
117
 
83
- Promise.resolve().then(function () { return require('./inline-edit-aba2c28a.js'); });
84
- var inlineStyles = {
85
- "button": "pf-c-button",
86
- "inlineEdit": "pf-c-inline-edit",
87
- "inlineEditAction": "pf-c-inline-edit__action",
88
- "inlineEditEditableText": "pf-c-inline-edit__editable-text",
89
- "inlineEditGroup": "pf-c-inline-edit__group",
90
- "inlineEditInput": "pf-c-inline-edit__input",
91
- "inlineEditLabel": "pf-c-inline-edit__label",
92
- "inlineEditValue": "pf-c-inline-edit__value",
93
- "modifiers": {
94
- "iconGroup": "pf-m-icon-group",
95
- "footer": "pf-m-footer",
96
- "column": "pf-m-column",
97
- "valid": "pf-m-valid",
98
- "plain": "pf-m-plain",
99
- "actionGroup": "pf-m-action-group",
100
- "enableEditable": "pf-m-enable-editable",
101
- "inlineEditable": "pf-m-inline-editable",
102
- "enable": "pf-m-enable",
103
- "bold": "pf-m-bold"
104
- }
118
+ var currentId = 0;
119
+ /**
120
+ * Factory to create Icon class components for consumers
121
+ */
122
+
123
+ function createIcon(_ref) {
124
+ var name = _ref.name,
125
+ _ref$xOffset = _ref.xOffset,
126
+ xOffset = _ref$xOffset === void 0 ? 0 : _ref$xOffset,
127
+ _ref$yOffset = _ref.yOffset,
128
+ yOffset = _ref$yOffset === void 0 ? 0 : _ref$yOffset,
129
+ width = _ref.width,
130
+ height = _ref.height,
131
+ svgPath = _ref.svgPath;
132
+
133
+ var _a;
134
+
135
+ return _a = /*#__PURE__*/function (_React$Component) {
136
+ _inheritsLoose(SVGIcon, _React$Component);
137
+
138
+ function SVGIcon() {
139
+ var _this;
140
+
141
+ _this = _React$Component.apply(this, arguments) || this;
142
+ _this.id = "icon-title-" + currentId++;
143
+ return _this;
144
+ }
145
+
146
+ var _proto = SVGIcon.prototype;
147
+
148
+ _proto.render = function render() {
149
+ var _a = this.props,
150
+ title = _a.title,
151
+ className = _a.className,
152
+ props = __rest(_a, ["title", "className"]);
153
+
154
+ var classes = className ? "pf-v5-svg " + className : 'pf-v5-svg';
155
+ var hasTitle = Boolean(title);
156
+ var viewBox = [xOffset, yOffset, width, height].join(' ');
157
+ return React__namespace.createElement("svg", Object.assign({
158
+ className: classes,
159
+ viewBox: viewBox,
160
+ fill: "currentColor",
161
+ "aria-labelledby": hasTitle ? this.id : null,
162
+ "aria-hidden": hasTitle ? null : true,
163
+ role: "img",
164
+ width: "1em",
165
+ height: "1em"
166
+ }, props), hasTitle && React__namespace.createElement("title", {
167
+ id: this.id
168
+ }, title), React__namespace.createElement("path", {
169
+ d: svgPath
170
+ }));
171
+ };
172
+
173
+ return SVGIcon;
174
+ }(React__namespace.Component), _a.displayName = name, _a;
175
+ }
176
+
177
+ var EllipsisVIconConfig = {
178
+ name: 'EllipsisVIcon',
179
+ height: 512,
180
+ width: 192,
181
+ svgPath: 'M96 184c39.8 0 72 32.2 72 72s-32.2 72-72 72-72-32.2-72-72 32.2-72 72-72zM24 80c0 39.8 32.2 72 72 72s72-32.2 72-72S135.8 8 96 8 24 40.2 24 80zm0 352c0 39.8 32.2 72 72 72s72-32.2 72-72-32.2-72-72-72-72 32.2-72 72z',
182
+ yOffset: 0,
183
+ xOffset: 0
184
+ };
185
+ var EllipsisVIcon = createIcon(EllipsisVIconConfig);
186
+ var EllipsisVIcon$1 = EllipsisVIcon;
187
+
188
+ var ActionsColumnBase = function ActionsColumnBase(_a) {
189
+ var items = _a.items,
190
+ isDisabled = _a.isDisabled,
191
+ rowData = _a.rowData,
192
+ extraData = _a.extraData,
193
+ actionsToggle = _a.actionsToggle,
194
+ _a$popperProps = _a.popperProps,
195
+ popperProps = _a$popperProps === void 0 ? {
196
+ position: 'end',
197
+ direction: 'down'
198
+ } : _a$popperProps,
199
+ innerRef = _a.innerRef,
200
+ firstActionItemRef = _a.firstActionItemRef,
201
+ _a$isOnOpenChangeDisa = _a.isOnOpenChangeDisabled,
202
+ isOnOpenChangeDisabled = _a$isOnOpenChangeDisa === void 0 ? false : _a$isOnOpenChangeDisa,
203
+ props = __rest$1(_a, ["items", "isDisabled", "rowData", "extraData", "actionsToggle", "popperProps", "innerRef", "firstActionItemRef", "isOnOpenChangeDisabled"]);
204
+
205
+ var _React$useState = React__namespace.useState(false),
206
+ isOpen = _React$useState[0],
207
+ setIsOpen = _React$useState[1];
208
+
209
+ var onToggle = function onToggle() {
210
+ setIsOpen(!isOpen);
211
+ };
212
+
213
+ var onActionClick = function onActionClick(event, onClick) {
214
+ // Only prevent default if onClick is provided. This allows href support.
215
+ if (onClick) {
216
+ event.preventDefault(); // tslint:disable-next-line:no-unused-expression
217
+
218
+ onClick(event, extraData && extraData.rowIndex, rowData, extraData);
219
+ }
220
+ };
221
+
222
+ return React__namespace.createElement(React__namespace.Fragment, null, items.filter(function (item) {
223
+ return item.isOutsideDropdown;
224
+ }) // eslint-disable-next-line @typescript-eslint/no-unused-vars
225
+ .map(function (_a, key) {
226
+ var title = _a.title,
227
+ itemKey = _a.itemKey,
228
+ _onClick = _a.onClick,
229
+ props = __rest$1(_a, ["title", "itemKey", "onClick", "isOutsideDropdown"]);
230
+
231
+ return typeof title === 'string' ? React__namespace.createElement(Button.Button, Object.assign({
232
+ onClick: function onClick(event) {
233
+ return onActionClick(event, _onClick);
234
+ }
235
+ }, props, {
236
+ isDisabled: isDisabled,
237
+ key: itemKey || "outside_dropdown_" + key,
238
+ "data-key": itemKey || "outside_dropdown_" + key
239
+ }), title) : React__namespace.cloneElement(title, Object.assign({
240
+ onClick: _onClick,
241
+ isDisabled: isDisabled
242
+ }, props));
243
+ }), React__namespace.createElement(Dropdown.Dropdown, Object.assign({
244
+ isOpen: isOpen,
245
+ onOpenChange: !isOnOpenChangeDisabled ? function (isOpen) {
246
+ return setIsOpen(isOpen);
247
+ } : undefined,
248
+ toggle: function toggle(toggleRef) {
249
+ return actionsToggle ? actionsToggle({
250
+ onToggle: onToggle,
251
+ isOpen: isOpen,
252
+ isDisabled: isDisabled,
253
+ toggleRef: toggleRef
254
+ }) : React__namespace.createElement(MenuToggle.MenuToggle, {
255
+ "aria-label": "Kebab toggle",
256
+ ref: toggleRef,
257
+ onClick: onToggle,
258
+ isExpanded: isOpen,
259
+ isDisabled: isDisabled,
260
+ variant: "plain"
261
+ }, React__namespace.createElement(EllipsisVIcon$1, null));
262
+ }
263
+ }, rowData && rowData.actionProps, {
264
+ ref: innerRef
265
+ }, props, {
266
+ popperProps: popperProps
267
+ }), React__namespace.createElement(Dropdown.DropdownList, null, items.filter(function (item) {
268
+ return !item.isOutsideDropdown;
269
+ }).map(function (_a, index) {
270
+ var title = _a.title,
271
+ itemKey = _a.itemKey,
272
+ _onClick2 = _a.onClick,
273
+ tooltipProps = _a.tooltipProps,
274
+ isSeparator = _a.isSeparator,
275
+ _a$shouldCloseOnClick = _a.shouldCloseOnClick,
276
+ shouldCloseOnClick = _a$shouldCloseOnClick === void 0 ? true : _a$shouldCloseOnClick,
277
+ props = __rest$1(_a, ["title", "itemKey", "onClick", "tooltipProps", "isSeparator", "shouldCloseOnClick"]);
278
+
279
+ if (isSeparator) {
280
+ return React__namespace.createElement(Divider.Divider, {
281
+ key: itemKey || index,
282
+ "data-key": itemKey || index
283
+ });
284
+ }
285
+
286
+ var item = React__namespace.createElement(Dropdown.DropdownItem, Object.assign({
287
+ onClick: function onClick(event) {
288
+ onActionClick(event, _onClick2);
289
+ shouldCloseOnClick && onToggle();
290
+ }
291
+ }, props, {
292
+ key: itemKey || index,
293
+ "data-key": itemKey || index,
294
+ ref: index === 0 ? firstActionItemRef : undefined
295
+ }), title);
296
+
297
+ if (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.content) {
298
+ return React__namespace.createElement(Tooltip.Tooltip, Object.assign({
299
+ key: itemKey || index
300
+ }, tooltipProps), item);
301
+ } else {
302
+ return item;
303
+ }
304
+ }))));
305
+ };
306
+
307
+ var ActionsColumn = React__namespace.forwardRef(function (props, ref) {
308
+ return React__namespace.createElement(ActionsColumnBase, Object.assign({}, props, {
309
+ innerRef: ref
310
+ }));
311
+ });
312
+ ActionsColumn.displayName = 'ActionsColumn';
313
+
314
+ var AngleDownIconConfig = {
315
+ name: 'AngleDownIcon',
316
+ height: 512,
317
+ width: 320,
318
+ svgPath: 'M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z',
319
+ yOffset: 0,
320
+ xOffset: 0
105
321
  };
322
+ var AngleDownIcon = createIcon(AngleDownIconConfig);
323
+ var AngleDownIcon$1 = AngleDownIcon;
106
324
 
107
325
  /** Joins args into a className string
108
326
  *
@@ -134,9 +352,11 @@ function css() {
134
352
  return classes.join(' ');
135
353
  }
136
354
 
137
- Promise.resolve().then(function () { return require('./table-ee2a086b.js'); });
138
355
  var styles$1 = {
139
- "button": "pf-c-button",
356
+ "button": "pf-v5-c-button",
357
+ "check": "pf-v5-c-check",
358
+ "checkInput": "pf-v5-c-check__input",
359
+ "dirRtl": "pf-v5-m-dir-rtl",
140
360
  "modifiers": {
141
361
  "hidden": "pf-m-hidden",
142
362
  "hiddenOnSm": "pf-m-hidden-on-sm",
@@ -151,6 +371,8 @@ var styles$1 = {
151
371
  "visibleOn_2xl": "pf-m-visible-on-2xl",
152
372
  "fixed": "pf-m-fixed",
153
373
  "stickyHeader": "pf-m-sticky-header",
374
+ "nestedColumnHeader": "pf-m-nested-column-header",
375
+ "borderRow": "pf-m-border-row",
154
376
  "striped": "pf-m-striped",
155
377
  "expandable": "pf-m-expandable",
156
378
  "stripedEven": "pf-m-striped-even",
@@ -160,18 +382,18 @@ var styles$1 = {
160
382
  "favorite": "pf-m-favorite",
161
383
  "borderRight": "pf-m-border-right",
162
384
  "borderLeft": "pf-m-border-left",
163
- "nestedColumnHeader": "pf-m-nested-column-header",
385
+ "expanded": "pf-m-expanded",
164
386
  "truncate": "pf-m-truncate",
165
387
  "wrap": "pf-m-wrap",
166
388
  "nowrap": "pf-m-nowrap",
167
389
  "fitContent": "pf-m-fit-content",
168
390
  "breakWord": "pf-m-break-word",
169
391
  "noBorderRows": "pf-m-no-border-rows",
170
- "expanded": "pf-m-expanded",
171
- "hoverable": "pf-m-hoverable",
392
+ "clickable": "pf-m-clickable",
172
393
  "selected": "pf-m-selected",
173
394
  "firstCellOffsetReset": "pf-m-first-cell-offset-reset",
174
395
  "dragOver": "pf-m-drag-over",
396
+ "standalone": "pf-m-standalone",
175
397
  "favorited": "pf-m-favorited",
176
398
  "noPadding": "pf-m-no-padding",
177
399
  "compact": "pf-m-compact",
@@ -190,684 +412,508 @@ var styles$1 = {
190
412
  "width_90": "pf-m-width-90",
191
413
  "width_100": "pf-m-width-100"
192
414
  },
193
- "table": "pf-c-table",
194
- "tableAction": "pf-c-table__action",
195
- "tableButton": "pf-c-table__button",
196
- "tableButtonContent": "pf-c-table__button-content",
197
- "tableCheck": "pf-c-table__check",
198
- "tableColumnHelp": "pf-c-table__column-help",
199
- "tableColumnHelpAction": "pf-c-table__column-help-action",
200
- "tableCompoundExpansionToggle": "pf-c-table__compound-expansion-toggle",
201
- "tableControlRow": "pf-c-table__control-row",
202
- "tableDraggable": "pf-c-table__draggable",
203
- "tableExpandableRow": "pf-c-table__expandable-row",
204
- "tableExpandableRowContent": "pf-c-table__expandable-row-content",
205
- "tableFavorite": "pf-c-table__favorite",
206
- "tableIcon": "pf-c-table__icon",
207
- "tableIconInline": "pf-c-table__icon-inline",
208
- "tableInlineEditAction": "pf-c-table__inline-edit-action",
209
- "tableSort": "pf-c-table__sort",
210
- "tableSortIndicator": "pf-c-table__sort-indicator",
211
- "tableSubhead": "pf-c-table__subhead",
212
- "tableText": "pf-c-table__text",
213
- "tableToggle": "pf-c-table__toggle",
214
- "tableToggleIcon": "pf-c-table__toggle-icon",
215
- "themeDark": "pf-theme-dark"
415
+ "table": "pf-v5-c-table",
416
+ "tableAction": "pf-v5-c-table__action",
417
+ "tableButton": "pf-v5-c-table__button",
418
+ "tableButtonContent": "pf-v5-c-table__button-content",
419
+ "tableCaption": "pf-v5-c-table__caption",
420
+ "tableCheck": "pf-v5-c-table__check",
421
+ "tableColumnHelp": "pf-v5-c-table__column-help",
422
+ "tableColumnHelpAction": "pf-v5-c-table__column-help-action",
423
+ "tableCompoundExpansionToggle": "pf-v5-c-table__compound-expansion-toggle",
424
+ "tableControlRow": "pf-v5-c-table__control-row",
425
+ "tableDraggable": "pf-v5-c-table__draggable",
426
+ "tableExpandableRow": "pf-v5-c-table__expandable-row",
427
+ "tableExpandableRowContent": "pf-v5-c-table__expandable-row-content",
428
+ "tableFavorite": "pf-v5-c-table__favorite",
429
+ "tableIcon": "pf-v5-c-table__icon",
430
+ "tableIconInline": "pf-v5-c-table__icon-inline",
431
+ "tableInlineEditAction": "pf-v5-c-table__inline-edit-action",
432
+ "tableSort": "pf-v5-c-table__sort",
433
+ "tableSortIndicator": "pf-v5-c-table__sort-indicator",
434
+ "tableSubhead": "pf-v5-c-table__subhead",
435
+ "tableTbody": "pf-v5-c-table__tbody",
436
+ "tableTd": "pf-v5-c-table__td",
437
+ "tableText": "pf-v5-c-table__text",
438
+ "tableTh": "pf-v5-c-table__th",
439
+ "tableThead": "pf-v5-c-table__thead",
440
+ "tableToggle": "pf-v5-c-table__toggle",
441
+ "tableToggleIcon": "pf-v5-c-table__toggle-icon",
442
+ "tableTr": "pf-v5-c-table__tr",
443
+ "themeDark": "pf-v5-theme-dark"
216
444
  };
217
445
 
218
- Promise.resolve().then(function () { return require('./table-grid-be1510e7.js'); });
219
- var stylesGrid = {
220
- "button": "pf-c-button",
221
- "modifiers": {
222
- "grid": "pf-m-grid",
223
- "compact": "pf-m-compact",
224
- "expanded": "pf-m-expanded",
225
- "selected": "pf-m-selected",
226
- "noPadding": "pf-m-no-padding",
227
- "hoverable": "pf-m-hoverable",
228
- "nowrap": "pf-m-nowrap",
229
- "fitContent": "pf-m-fit-content",
230
- "truncate": "pf-m-truncate",
231
- "gridMd": "pf-m-grid-md",
232
- "gridLg": "pf-m-grid-lg",
233
- "gridXl": "pf-m-grid-xl",
234
- "grid_2xl": "pf-m-grid-2xl"
235
- },
236
- "table": "pf-c-table",
237
- "tableAction": "pf-c-table__action",
238
- "tableButton": "pf-c-table__button",
239
- "tableCheck": "pf-c-table__check",
240
- "tableCompoundExpansionToggle": "pf-c-table__compound-expansion-toggle",
241
- "tableExpandableRow": "pf-c-table__expandable-row",
242
- "tableExpandableRowContent": "pf-c-table__expandable-row-content",
243
- "tableFavorite": "pf-c-table__favorite",
244
- "tableIcon": "pf-c-table__icon",
245
- "tableInlineEditAction": "pf-c-table__inline-edit-action",
246
- "tableText": "pf-c-table__text",
247
- "tableToggle": "pf-c-table__toggle",
248
- "tableToggleIcon": "pf-c-table__toggle-icon"
249
- };
446
+ var CollapseColumn = function CollapseColumn(_a) {
447
+ var _a$className = _a.className,
448
+ className = _a$className === void 0 ? '' : _a$className,
449
+ _a$children = _a.children,
450
+ children = _a$children === void 0 ? null : _a$children,
451
+ isOpen = _a.isOpen,
452
+ onToggle = _a.onToggle,
453
+ props = __rest$1(_a, ["className", "children", "isOpen", "onToggle"]);
250
454
 
251
- Promise.resolve().then(function () { return require('./table-tree-view-248a6705.js'); });
252
- var stylesTreeView = {
253
- "dropdown": "pf-c-dropdown",
254
- "modifiers": {
255
- "treeView": "pf-m-tree-view",
256
- "treeViewGrid": "pf-m-tree-view-grid",
257
- "treeViewDetailsExpanded": "pf-m-tree-view-details-expanded",
258
- "treeViewGridMd": "pf-m-tree-view-grid-md",
259
- "treeViewGridLg": "pf-m-tree-view-grid-lg",
260
- "treeViewGridXl": "pf-m-tree-view-grid-xl",
261
- "treeViewGrid_2xl": "pf-m-tree-view-grid-2xl"
262
- },
263
- "table": "pf-c-table",
264
- "tableAction": "pf-c-table__action",
265
- "tableCheck": "pf-c-table__check",
266
- "tableToggle": "pf-c-table__toggle",
267
- "tableToggleIcon": "pf-c-table__toggle-icon",
268
- "tableTreeViewDetailsToggle": "pf-c-table__tree-view-details-toggle",
269
- "tableTreeViewIcon": "pf-c-table__tree-view-icon",
270
- "tableTreeViewMain": "pf-c-table__tree-view-main",
271
- "tableTreeViewText": "pf-c-table__tree-view-text",
272
- "tableTreeViewTitleCell": "pf-c-table__tree-view-title-cell",
273
- "tableTreeViewTitleHeaderCell": "pf-c-table__tree-view-title-header-cell"
455
+ return React__namespace.createElement(React__namespace.Fragment, null, isOpen !== undefined && React__namespace.createElement(Button.Button, Object.assign({
456
+ className: css(className, isOpen && styles$1.modifiers.expanded)
457
+ }, props, {
458
+ variant: "plain",
459
+ "aria-label": props['aria-label'] || 'Details',
460
+ onClick: onToggle,
461
+ "aria-expanded": isOpen
462
+ }), React__namespace.createElement("div", {
463
+ className: css(styles$1.tableToggleIcon)
464
+ }, React__namespace.createElement(AngleDownIcon$1, null))), children);
274
465
  };
466
+ CollapseColumn.displayName = 'CollapseColumn';
275
467
 
276
- var camelize = function camelize(s) {
277
- return s.toUpperCase().replace('-', '').replace('_', '');
468
+ var GripVerticalIconConfig = {
469
+ name: 'GripVerticalIcon',
470
+ height: 512,
471
+ width: 320,
472
+ svgPath: 'M96 32H32C14.33 32 0 46.33 0 64v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32V64c0-17.67-14.33-32-32-32zm0 160H32c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32zm0 160H32c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32zM288 32h-64c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32V64c0-17.67-14.33-32-32-32zm0 160h-64c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32zm0 160h-64c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32z',
473
+ yOffset: 0,
474
+ xOffset: 0
278
475
  };
476
+ var GripVerticalIcon = createIcon(GripVerticalIconConfig);
477
+ var GripVerticalIcon$1 = GripVerticalIcon;
279
478
 
280
- var toCamel = function toCamel(s) {
281
- return s.replace(/([-_][a-z])/gi, camelize);
479
+ var DraggableCell = function DraggableCell(_a) {
480
+ var className = _a.className,
481
+ onClick = _a.onClick,
482
+ ariaLabel = _a['aria-label'],
483
+ id = _a.id,
484
+ props = __rest$1(_a, ["className", "onClick", 'aria-label', "id"]);
485
+
486
+ return React__namespace.createElement(Button.Button, Object.assign({
487
+ id: id,
488
+ variant: "plain",
489
+ className: className,
490
+ type: "button",
491
+ "aria-label": ariaLabel || "Draggable row draggable button",
492
+ onClick: onClick
493
+ }, props), React__namespace.createElement(GripVerticalIcon$1, {
494
+ "aria-hidden": true
495
+ }));
282
496
  };
283
- /**
284
- * @param {string} input - String to capitalize
285
- */
497
+ DraggableCell.displayName = 'DraggableCell';
286
498
 
287
- function capitalize(input) {
288
- return input[0].toUpperCase() + input.substring(1);
289
- }
499
+ var inlineStyles = {
500
+ "button": "pf-v5-c-button",
501
+ "inlineEdit": "pf-v5-c-inline-edit",
502
+ "inlineEditAction": "pf-v5-c-inline-edit__action",
503
+ "inlineEditEditableText": "pf-v5-c-inline-edit__editable-text",
504
+ "inlineEditGroup": "pf-v5-c-inline-edit__group",
505
+ "inlineEditInput": "pf-v5-c-inline-edit__input",
506
+ "inlineEditLabel": "pf-v5-c-inline-edit__label",
507
+ "inlineEditValue": "pf-v5-c-inline-edit__value",
508
+ "modifiers": {
509
+ "iconGroup": "pf-m-icon-group",
510
+ "footer": "pf-m-footer",
511
+ "column": "pf-m-column",
512
+ "valid": "pf-m-valid",
513
+ "plain": "pf-m-plain",
514
+ "actionGroup": "pf-m-action-group",
515
+ "enableEditable": "pf-m-enable-editable",
516
+ "inlineEditable": "pf-m-inline-editable",
517
+ "enable": "pf-m-enable",
518
+ "bold": "pf-m-bold"
519
+ }
520
+ };
290
521
 
291
- var TableGridBreakpoint;
522
+ var HelpIconConfig = {
523
+ name: 'HelpIcon',
524
+ height: 1024,
525
+ width: 1024,
526
+ svgPath: 'M521.3,576 C627.5,576 713.7,502 713.7,413.7 C713.7,325.4 627.6,253.6 521.3,253.6 C366,253.6 334.5,337.7 329.2,407.2 C329.2,414.3 335.2,416 343.5,416 L445,416 C450.5,416 458,415.5 460.8,406.5 C460.8,362.6 582.9,357.1 582.9,413.6 C582.9,441.9 556.2,470.9 521.3,473 C486.4,475.1 447.3,479.8 447.3,521.7 L447.3,553.8 C447.3,570.8 456.1,576 472,576 C487.9,576 521.3,576 521.3,576 M575.3,751.3 L575.3,655.3 C575.313862,651.055109 573.620137,646.982962 570.6,644 C567.638831,640.947672 563.552355,639.247987 559.3,639.29884 L463.3,639.29884 C459.055109,639.286138 454.982962,640.979863 452,644 C448.947672,646.961169 447.247987,651.047645 447.29884,655.3 L447.29884,751.3 C447.286138,755.544891 448.979863,759.617038 452,762.6 C454.961169,765.652328 459.047645,767.352013 463.3,767.30116 L559.3,767.30116 C563.544891,767.313862 567.617038,765.620137 570.6,762.6 C573.659349,759.643612 575.360354,755.553963 575.3,751.3 M512,896 C300.2,896 128,723.9 128,512 C128,300.3 300.2,128 512,128 C723.8,128 896,300.2 896,512 C896,723.8 723.7,896 512,896 M512.1,0 C229.7,0 0,229.8 0,512 C0,794.2 229.8,1024 512.1,1024 C794.4,1024 1024,794.3 1024,512 C1024,229.7 794.4,0 512.1,0',
527
+ yOffset: 0,
528
+ xOffset: 0
529
+ };
530
+ var HelpIcon = createIcon(HelpIconConfig);
531
+ var HelpIcon$1 = HelpIcon;
292
532
 
293
- (function (TableGridBreakpoint) {
294
- TableGridBreakpoint["none"] = "";
295
- TableGridBreakpoint["grid"] = "grid";
296
- TableGridBreakpoint["gridMd"] = "grid-md";
297
- TableGridBreakpoint["gridLg"] = "grid-lg";
298
- TableGridBreakpoint["gridXl"] = "grid-xl";
299
- TableGridBreakpoint["grid2xl"] = "grid-2xl";
300
- })(TableGridBreakpoint || (TableGridBreakpoint = {}));
533
+ var TableTextVariant;
301
534
 
302
- var TableVariant;
535
+ (function (TableTextVariant) {
536
+ TableTextVariant["div"] = "div";
537
+ TableTextVariant["nav"] = "nav";
538
+ })(TableTextVariant || (TableTextVariant = {}));
303
539
 
304
- (function (TableVariant) {
305
- TableVariant["compact"] = "compact";
306
- })(TableVariant || (TableVariant = {}));
540
+ var WrapModifier;
307
541
 
308
- var TableComposableContext = React__namespace.createContext({
309
- registerSelectableRow: function registerSelectableRow() {}
310
- });
311
-
312
- var TableComposableBase = function TableComposableBase(_a) {
313
- var _b, _c;
542
+ (function (WrapModifier) {
543
+ WrapModifier["wrap"] = "wrap";
544
+ WrapModifier["nowrap"] = "nowrap";
545
+ WrapModifier["truncate"] = "truncate";
546
+ WrapModifier["breakWord"] = "breakWord";
547
+ WrapModifier["fitContent"] = "fitContent";
548
+ })(WrapModifier || (WrapModifier = {}));
314
549
 
315
- var children = _a.children,
316
- className = _a.className,
317
- variant = _a.variant,
318
- _a$borders = _a.borders,
319
- borders = _a$borders === void 0 ? true : _a$borders,
320
- _a$isStickyHeader = _a.isStickyHeader,
321
- isStickyHeader = _a$isStickyHeader === void 0 ? false : _a$isStickyHeader,
322
- _a$gridBreakPoint = _a.gridBreakPoint,
323
- gridBreakPoint = _a$gridBreakPoint === void 0 ? TableGridBreakpoint.gridMd : _a$gridBreakPoint,
324
- ariaLabel = _a['aria-label'],
325
- _a$role = _a.role,
326
- role = _a$role === void 0 ? 'grid' : _a$role,
327
- innerRef = _a.innerRef,
328
- ouiaId = _a.ouiaId,
329
- _a$ouiaSafe = _a.ouiaSafe,
330
- ouiaSafe = _a$ouiaSafe === void 0 ? true : _a$ouiaSafe,
331
- _a$isTreeTable = _a.isTreeTable,
332
- isTreeTable = _a$isTreeTable === void 0 ? false : _a$isTreeTable,
333
- _a$isNested = _a.isNested,
334
- isNested = _a$isNested === void 0 ? false : _a$isNested,
335
- _a$isStriped = _a.isStriped,
336
- isStriped = _a$isStriped === void 0 ? false : _a$isStriped,
337
- _a$isExpandable = _a.isExpandable,
338
- isExpandable = _a$isExpandable === void 0 ? false : _a$isExpandable,
339
- hasSelectableRowCaption = _a.hasSelectableRowCaption,
340
- selectableRowCaptionText = _a.selectableRowCaptionText,
341
- props = __rest(_a, ["children", "className", "variant", "borders", "isStickyHeader", "gridBreakPoint", 'aria-label', "role", "innerRef", "ouiaId", "ouiaSafe", "isTreeTable", "isNested", "isStriped", "isExpandable", "nestedHeaderColumnSpans", "hasSelectableRowCaption", "selectableRowCaptionText"]);
550
+ var TableText = function TableText(_a) {
551
+ var _a$children = _a.children,
552
+ children = _a$children === void 0 ? null : _a$children,
553
+ _a$className = _a.className,
554
+ className = _a$className === void 0 ? '' : _a$className,
555
+ _a$variant = _a.variant,
556
+ variant = _a$variant === void 0 ? 'span' : _a$variant,
557
+ _a$wrapModifier = _a.wrapModifier,
558
+ wrapModifier = _a$wrapModifier === void 0 ? null : _a$wrapModifier,
559
+ _a$tooltip = _a.tooltip,
560
+ tooltipProp = _a$tooltip === void 0 ? '' : _a$tooltip,
561
+ _a$tooltipProps = _a.tooltipProps,
562
+ tooltipProps = _a$tooltipProps === void 0 ? {} : _a$tooltipProps,
563
+ _a$onMouseEnter = _a.onMouseEnter,
564
+ onMouseEnterProp = _a$onMouseEnter === void 0 ? function () {} : _a$onMouseEnter,
565
+ _a$focused = _a.focused,
566
+ focused = _a$focused === void 0 ? false : _a$focused,
567
+ _a$tooltipHasDefaultB = _a.tooltipHasDefaultBehavior,
568
+ tooltipHasDefaultBehavior = _a$tooltipHasDefaultB === void 0 ? false : _a$tooltipHasDefaultB,
569
+ props = __rest$1(_a, ["children", "className", "variant", "wrapModifier", "tooltip", "tooltipProps", "onMouseEnter", "focused", "tooltipHasDefaultBehavior"]);
342
570
 
343
- var tableRef = innerRef || React__namespace.useRef(null);
571
+ var Component = variant;
572
+ var textRef = React__namespace.createRef();
344
573
 
345
- var _React$useState = React__namespace.useState(false),
346
- hasSelectableRows = _React$useState[0],
347
- setHasSelectableRows = _React$useState[1];
574
+ var _React$useState = React__namespace.useState(tooltipProp),
575
+ tooltip = _React$useState[0],
576
+ setTooltip = _React$useState[1];
348
577
 
349
- var _React$useState2 = React__namespace.useState(),
350
- tableCaption = _React$useState2[0],
351
- setTableCaption = _React$useState2[1];
578
+ var onMouseEnter = function onMouseEnter(event) {
579
+ if (event.target.offsetWidth < event.target.scrollWidth) {
580
+ setTooltip(tooltipProp || event.target.innerText);
581
+ } else {
582
+ setTooltip('');
583
+ }
352
584
 
353
- React__namespace.useEffect(function () {
354
- document.addEventListener('keydown', handleKeys); // sets up roving tab-index to tree tables only
585
+ onMouseEnterProp(event);
586
+ };
355
587
 
356
- if (tableRef && tableRef.current && tableRef.current.classList.contains('pf-m-tree-view')) {
357
- var tbody = tableRef.current.querySelector('tbody');
358
- tbody && reactCore.setTabIndex(Array.from(tbody.querySelectorAll('button, a, input')));
588
+ var onFocus = function onFocus(element) {
589
+ if (element.offsetWidth < element.scrollWidth) {
590
+ setTooltip(tooltipProp || element.innerText);
591
+ } else {
592
+ setTooltip('');
359
593
  }
594
+ };
360
595
 
361
- return function cleanup() {
362
- document.removeEventListener('keydown', handleKeys);
363
- };
364
- }, [tableRef, tableRef.current]);
596
+ var text = React__namespace.createElement(Component, Object.assign({
597
+ ref: textRef,
598
+ onMouseEnter: !tooltipHasDefaultBehavior ? onMouseEnter : undefined,
599
+ className: css(className, wrapModifier && styles$1.modifiers[wrapModifier], styles$1.tableText)
600
+ }, props), children);
365
601
  React__namespace.useEffect(function () {
366
- if (selectableRowCaptionText) {
367
- setTableCaption(React__namespace.createElement("caption", null, selectableRowCaptionText, React__namespace.createElement("div", {
368
- className: "pf-screen-reader"
369
- }, "This table has selectable rows. It can be navigated by row using tab, and each row can be selected using space or enter.")));
370
- } else {
371
- setTableCaption(React__namespace.createElement("caption", {
372
- className: "pf-screen-reader"
373
- }, "This table has selectable rows. It can be navigated by row using tab, and each row can be selected using space or enter."));
602
+ if (!tooltipHasDefaultBehavior) {
603
+ if (focused) {
604
+ onFocus(textRef.current);
605
+ } else {
606
+ setTooltip('');
607
+ }
374
608
  }
375
- }, [selectableRowCaptionText]);
376
- var ouiaProps = reactCore.useOUIAProps('Table', ouiaId, ouiaSafe);
377
- var grid = (_b = stylesGrid.modifiers) === null || _b === void 0 ? void 0 : _b[toCamel(gridBreakPoint || '').replace(/-?2xl/, '_2xl')];
378
- var breakPointPrefix = "treeView" + (gridBreakPoint.charAt(0).toUpperCase() + gridBreakPoint.slice(1));
379
- var treeGrid = (_c = stylesTreeView.modifiers) === null || _c === void 0 ? void 0 : _c[toCamel(breakPointPrefix || '').replace(/-?2xl/, '_2xl')];
609
+ }, [focused, tooltipHasDefaultBehavior]);
610
+ return tooltip !== '' ? React__namespace.createElement(Tooltip.Tooltip, Object.assign({
611
+ triggerRef: textRef,
612
+ content: tooltip
613
+ }, !tooltipHasDefaultBehavior && {
614
+ isVisible: true
615
+ }, tooltipProps), text) : text;
616
+ };
617
+ TableText.displayName = 'TableText';
380
618
 
381
- var handleKeys = function handleKeys(event) {
382
- if (isNested || !(tableRef && tableRef.current && tableRef.current.classList.contains('pf-m-tree-view')) || // implements roving tab-index to tree tables only
383
- tableRef && tableRef.current !== event.target.closest('.pf-c-table:not(.pf-m-nested)')) {
384
- return;
385
- }
619
+ var HeaderCellInfoWrapper = function HeaderCellInfoWrapper(_ref) {
620
+ var children = _ref.children,
621
+ info = _ref.info,
622
+ className = _ref.className,
623
+ _ref$variant = _ref.variant,
624
+ variant = _ref$variant === void 0 ? 'tooltip' : _ref$variant,
625
+ popoverProps = _ref.popoverProps,
626
+ tooltipProps = _ref.tooltipProps,
627
+ ariaLabel = _ref.ariaLabel;
628
+ return React__namespace.createElement("div", {
629
+ className: css(styles$1.tableColumnHelp, className)
630
+ }, typeof children === 'string' ? React__namespace.createElement(TableText, null, children) : children, React__namespace.createElement("span", {
631
+ className: css(styles$1.tableColumnHelpAction)
632
+ }, variant === 'tooltip' ? React__namespace.createElement(Tooltip.Tooltip, Object.assign({
633
+ content: info
634
+ }, tooltipProps), React__namespace.createElement(Button.Button, {
635
+ variant: "plain",
636
+ "aria-label": ariaLabel || typeof info === 'string' && info || 'More info'
637
+ }, React__namespace.createElement(HelpIcon$1, null))) : React__namespace.createElement(Popover.Popover, Object.assign({
638
+ bodyContent: info
639
+ }, popoverProps), React__namespace.createElement(Button.Button, {
640
+ variant: "plain",
641
+ "aria-label": ariaLabel || typeof info === 'string' && info || 'More info'
642
+ }, React__namespace.createElement(HelpIcon$1, null)))));
643
+ };
644
+ HeaderCellInfoWrapper.displayName = 'HeaderCellInfoWrapper';
386
645
 
387
- var activeElement = document.activeElement;
388
- var key = event.key;
389
- var rows = Array.from(tableRef.current.querySelectorAll('tbody tr')).filter(function (el) {
390
- return !el.classList.contains('pf-m-disabled') && !el.hidden;
391
- });
646
+ var stylesGrid = {
647
+ "button": "pf-v5-c-button",
648
+ "modifiers": {
649
+ "grid": "pf-m-grid",
650
+ "compact": "pf-m-compact",
651
+ "expanded": "pf-m-expanded",
652
+ "selected": "pf-m-selected",
653
+ "noPadding": "pf-m-no-padding",
654
+ "hoverable": "pf-m-hoverable",
655
+ "nowrap": "pf-m-nowrap",
656
+ "fitContent": "pf-m-fit-content",
657
+ "truncate": "pf-m-truncate",
658
+ "gridMd": "pf-m-grid-md",
659
+ "gridLg": "pf-m-grid-lg",
660
+ "gridXl": "pf-m-grid-xl",
661
+ "grid_2xl": "pf-m-grid-2xl"
662
+ },
663
+ "table": "pf-v5-c-table",
664
+ "tableAction": "pf-v5-c-table__action",
665
+ "tableButton": "pf-v5-c-table__button",
666
+ "tableCheck": "pf-v5-c-table__check",
667
+ "tableCompoundExpansionToggle": "pf-v5-c-table__compound-expansion-toggle",
668
+ "tableExpandableRow": "pf-v5-c-table__expandable-row",
669
+ "tableExpandableRowContent": "pf-v5-c-table__expandable-row-content",
670
+ "tableFavorite": "pf-v5-c-table__favorite",
671
+ "tableIcon": "pf-v5-c-table__icon",
672
+ "tableInlineEditAction": "pf-v5-c-table__inline-edit-action",
673
+ "tableTbody": "pf-v5-c-table__tbody",
674
+ "tableTd": "pf-v5-c-table__td",
675
+ "tableText": "pf-v5-c-table__text",
676
+ "tableTh": "pf-v5-c-table__th",
677
+ "tableThead": "pf-v5-c-table__thead",
678
+ "tableToggle": "pf-v5-c-table__toggle",
679
+ "tableToggleIcon": "pf-v5-c-table__toggle-icon",
680
+ "tableTr": "pf-v5-c-table__tr"
681
+ };
392
682
 
393
- if (key === 'Space' || key === 'Enter') {
394
- activeElement.click();
395
- event.preventDefault();
396
- }
683
+ var treeViewStyles = {
684
+ "dirRtl": "pf-v5-m-dir-rtl",
685
+ "dropdown": "pf-v5-c-dropdown",
686
+ "modifiers": {
687
+ "treeView": "pf-m-tree-view",
688
+ "noInset": "pf-m-no-inset",
689
+ "treeViewGrid": "pf-m-tree-view-grid",
690
+ "treeViewDetailsExpanded": "pf-m-tree-view-details-expanded",
691
+ "treeViewGridMd": "pf-m-tree-view-grid-md",
692
+ "treeViewGridLg": "pf-m-tree-view-grid-lg",
693
+ "treeViewGridXl": "pf-m-tree-view-grid-xl",
694
+ "treeViewGrid_2xl": "pf-m-tree-view-grid-2xl"
695
+ },
696
+ "table": "pf-v5-c-table",
697
+ "tableAction": "pf-v5-c-table__action",
698
+ "tableCheck": "pf-v5-c-table__check",
699
+ "tableTbody": "pf-v5-c-table__tbody",
700
+ "tableTd": "pf-v5-c-table__td",
701
+ "tableTh": "pf-v5-c-table__th",
702
+ "tableThead": "pf-v5-c-table__thead",
703
+ "tableToggle": "pf-v5-c-table__toggle",
704
+ "tableToggleIcon": "pf-v5-c-table__toggle-icon",
705
+ "tableTr": "pf-v5-c-table__tr",
706
+ "tableTreeViewDetailsToggle": "pf-v5-c-table__tree-view-details-toggle",
707
+ "tableTreeViewIcon": "pf-v5-c-table__tree-view-icon",
708
+ "tableTreeViewMain": "pf-v5-c-table__tree-view-main",
709
+ "tableTreeViewText": "pf-v5-c-table__tree-view-text",
710
+ "tableTreeViewTitleCell": "pf-v5-c-table__tree-view-title-cell",
711
+ "tableTreeViewTitleHeaderCell": "pf-v5-c-table__tree-view-title-header-cell"
712
+ };
397
713
 
398
- var getFocusableElement = function getFocusableElement(element) {
399
- return element.querySelectorAll('button:not(:disabled), input:not(:disabled), a:not(:disabled)')[0];
400
- };
714
+ var RowSelectVariant;
401
715
 
402
- reactCore.handleArrows(event, rows, function (element) {
403
- return element === activeElement.closest('tr');
404
- }, getFocusableElement, ['button', 'input', 'a'], undefined, false, true, false);
405
- };
716
+ (function (RowSelectVariant) {
717
+ RowSelectVariant["radio"] = "radio";
718
+ RowSelectVariant["checkbox"] = "checkbox";
719
+ })(RowSelectVariant || (RowSelectVariant = {}));
406
720
 
407
- var registerSelectableRow = function registerSelectableRow() {
408
- !hasSelectableRows && setHasSelectableRows(true);
409
- };
721
+ var SelectColumn = function SelectColumn(_a) {
722
+ var _a$children = _a.children,
723
+ children = _a$children === void 0 ? null : _a$children,
724
+ _a$onSelect = _a.onSelect,
725
+ onSelect = _a$onSelect === void 0 ? null : _a$onSelect,
726
+ selectVariant = _a.selectVariant,
727
+ tooltip = _a.tooltip,
728
+ tooltipProps = _a.tooltipProps,
729
+ props = __rest$1(_a, ["children", "className", "onSelect", "selectVariant", "tooltip", "tooltipProps"]);
410
730
 
411
- return React__namespace.createElement(TableComposableContext.Provider, {
412
- value: {
413
- registerSelectableRow: registerSelectableRow
414
- }
415
- }, React__namespace.createElement("table", Object.assign({
416
- "aria-label": ariaLabel,
417
- role: role,
418
- className: css(className, styles$1.table, isTreeTable ? treeGrid : grid, styles$1.modifiers[variant], !borders && styles$1.modifiers.noBorderRows, isStickyHeader && styles$1.modifiers.stickyHeader, isTreeTable && stylesTreeView.modifiers.treeView, isStriped && styles$1.modifiers.striped, isExpandable && styles$1.modifiers.expandable, isNested && 'pf-m-nested'),
419
- ref: tableRef
420
- }, isTreeTable && {
421
- role: 'treegrid'
422
- }, ouiaProps, props), hasSelectableRowCaption && hasSelectableRows && tableCaption, children));
731
+ var inputRef = React__namespace.createRef();
732
+ var content = React__namespace.createElement(React__namespace.Fragment, null, React__namespace.createElement("label", null, React__namespace.createElement("input", Object.assign({}, props, {
733
+ ref: inputRef,
734
+ type: selectVariant,
735
+ onChange: onSelect
736
+ }))), children);
737
+ return tooltip ? React__namespace.createElement(Tooltip.Tooltip, Object.assign({
738
+ triggerRef: inputRef,
739
+ content: tooltip
740
+ }, tooltipProps), content) : content;
423
741
  };
742
+ SelectColumn.displayName = 'SelectColumn';
424
743
 
425
- var TableComposable = React__namespace.forwardRef(function (props, ref) {
426
- return React__namespace.createElement(TableComposableBase, Object.assign({}, props, {
427
- innerRef: ref
428
- }));
429
- });
430
- TableComposable.displayName = 'TableComposable';
744
+ var checkStyles = {
745
+ "check": "pf-v5-c-check",
746
+ "checkBody": "pf-v5-c-check__body",
747
+ "checkDescription": "pf-v5-c-check__description",
748
+ "checkInput": "pf-v5-c-check__input",
749
+ "checkLabel": "pf-v5-c-check__label",
750
+ "checkLabelRequired": "pf-v5-c-check__label-required",
751
+ "modifiers": {
752
+ "standalone": "pf-m-standalone",
753
+ "disabled": "pf-m-disabled"
754
+ }
755
+ };
431
756
 
432
- var TheadBase = function TheadBase(_a) {
433
- var children = _a.children,
434
- className = _a.className,
435
- _a$noWrap = _a.noWrap,
436
- noWrap = _a$noWrap === void 0 ? false : _a$noWrap,
437
- innerRef = _a.innerRef,
438
- hasNestedHeader = _a.hasNestedHeader,
439
- props = __rest(_a, ["children", "className", "noWrap", "innerRef", "hasNestedHeader"]);
757
+ var selectable = function selectable(label, _ref) {
758
+ var rowIndex = _ref.rowIndex,
759
+ columnIndex = _ref.columnIndex,
760
+ rowData = _ref.rowData,
761
+ column = _ref.column,
762
+ property = _ref.property,
763
+ tooltip = _ref.tooltip;
764
+ var _column$extraParams = column.extraParams,
765
+ onSelect = _column$extraParams.onSelect,
766
+ selectVariant = _column$extraParams.selectVariant,
767
+ allRowsSelected = _column$extraParams.allRowsSelected,
768
+ isHeaderSelectDisabled = _column$extraParams.isHeaderSelectDisabled;
769
+ var extraData = {
770
+ rowIndex: rowIndex,
771
+ columnIndex: columnIndex,
772
+ column: column,
773
+ property: property
774
+ };
440
775
 
441
- return React__namespace.createElement("thead", Object.assign({
442
- className: css(className, noWrap && styles$1.modifiers.nowrap, hasNestedHeader && styles$1.modifiers.nestedColumnHeader),
443
- ref: innerRef
444
- }, props), children);
445
- };
776
+ if (rowData && rowData.hasOwnProperty('parent') && !rowData.showSelect && !rowData.fullWidth) {
777
+ return {
778
+ component: 'td',
779
+ isVisible: true
780
+ };
781
+ }
446
782
 
447
- var Thead = React__namespace.forwardRef(function (props, ref) {
448
- return React__namespace.createElement(TheadBase, Object.assign({}, props, {
449
- innerRef: ref
450
- }));
451
- });
452
- Thead.displayName = 'Thead';
783
+ var rowId = rowIndex !== undefined ? rowIndex : -1;
784
+ /**
785
+ * @param {React.FormEvent} event - React form event
786
+ */
453
787
 
454
- var TbodyBase = function TbodyBase(_a) {
455
- var children = _a.children,
456
- className = _a.className,
457
- isExpanded = _a.isExpanded,
458
- innerRef = _a.innerRef,
459
- _a$isEvenStriped = _a.isEvenStriped,
460
- isEvenStriped = _a$isEvenStriped === void 0 ? false : _a$isEvenStriped,
461
- _a$isOddStriped = _a.isOddStriped,
462
- isOddStriped = _a$isOddStriped === void 0 ? false : _a$isOddStriped,
463
- props = __rest(_a, ["children", "className", "isExpanded", "innerRef", "isEvenStriped", "isOddStriped"]);
788
+ function selectClick(event) {
789
+ var selected = rowIndex === undefined ? event.currentTarget.checked : rowData && !rowData.selected; // tslint:disable-next-line:no-unused-expression
464
790
 
465
- return React__namespace.createElement("tbody", Object.assign({
466
- role: "rowgroup",
467
- className: css(className, isExpanded && styles$1.modifiers.expanded, isOddStriped && styles$1.modifiers.striped, isEvenStriped && styles$1.modifiers.stripedEven),
468
- ref: innerRef
469
- }, props), children);
470
- };
471
-
472
- var Tbody = React__namespace.forwardRef(function (props, ref) {
473
- return React__namespace.createElement(TbodyBase, Object.assign({}, props, {
474
- innerRef: ref
475
- }));
476
- });
477
- Tbody.displayName = 'Tbody';
478
-
479
- var TrBase = function TrBase(_a) {
480
- var children = _a.children,
481
- className = _a.className,
482
- isExpanded = _a.isExpanded,
483
- isEditable = _a.isEditable,
484
- _a$isHidden = _a.isHidden,
485
- isHidden = _a$isHidden === void 0 ? false : _a$isHidden,
486
- _a$isHoverable = _a.isHoverable,
487
- isHoverable = _a$isHoverable === void 0 ? false : _a$isHoverable,
488
- _a$isRowSelected = _a.isRowSelected,
489
- isRowSelected = _a$isRowSelected === void 0 ? false : _a$isRowSelected,
490
- _a$isStriped = _a.isStriped,
491
- isStriped = _a$isStriped === void 0 ? false : _a$isStriped,
492
- innerRef = _a.innerRef,
493
- ouiaId = _a.ouiaId,
494
- _a$ouiaSafe = _a.ouiaSafe,
495
- ouiaSafe = _a$ouiaSafe === void 0 ? true : _a$ouiaSafe,
496
- _a$resetOffset = _a.resetOffset,
497
- resetOffset = _a$resetOffset === void 0 ? false : _a$resetOffset,
498
- onRowClick = _a.onRowClick,
499
- isSelectable = _a.isSelectable,
500
- passedAriaLabel = _a['aria-label'],
501
- props = __rest(_a, ["children", "className", "isExpanded", "isEditable", "isHidden", "isHoverable", "isRowSelected", "isStriped", "innerRef", "ouiaId", "ouiaSafe", "resetOffset", "onRowClick", "isSelectable", 'aria-label']);
502
-
503
- var ouiaProps = reactCore.useOUIAProps('TableRow', ouiaId, ouiaSafe);
504
-
505
- var _React$useState = React__namespace.useState(''),
506
- computedAriaLabel = _React$useState[0],
507
- setComputedAriaLabel = _React$useState[1];
508
-
509
- var onKeyDown = null;
510
-
511
- if (onRowClick) {
512
- onKeyDown = function onKeyDown(e) {
513
- if (e.key === 'Enter' || e.key === ' ') {
514
- onRowClick(e);
515
- e.preventDefault();
516
- }
517
- };
791
+ onSelect && onSelect(event, selected, rowId, rowData, extraData);
518
792
  }
519
793
 
520
- var rowIsHidden = isHidden || isExpanded !== undefined && !isExpanded;
794
+ var customProps = Object.assign(Object.assign(Object.assign({}, rowId !== -1 ? {
795
+ checked: rowData && !!rowData.selected,
796
+ 'aria-label': "Select row " + rowIndex
797
+ } : {
798
+ checked: allRowsSelected,
799
+ 'aria-label': 'Select all rows'
800
+ }), rowData && (rowData.disableCheckbox || rowData.disableSelection) && {
801
+ disabled: true,
802
+ className: checkStyles.checkInput
803
+ }), !rowData && isHeaderSelectDisabled && {
804
+ disabled: true
805
+ });
806
+ var selectName = 'check-all';
521
807
 
522
- var _React$useContext = React__namespace.useContext(TableComposableContext),
523
- registerSelectableRow = _React$useContext.registerSelectableRow;
808
+ if (rowId !== -1 && selectVariant === RowSelectVariant.checkbox) {
809
+ selectName = "checkrow" + rowIndex;
810
+ } else if (rowId !== -1) {
811
+ selectName = 'radioGroup';
812
+ }
524
813
 
525
- React__namespace.useEffect(function () {
526
- if (isSelectable && !rowIsHidden) {
527
- setComputedAriaLabel((isRowSelected ? 'Selected' : 'Unselected') + ", selectable row.");
528
- registerSelectableRow();
529
- } else {
530
- setComputedAriaLabel(undefined);
531
- }
532
- }, [isRowSelected, isSelectable, registerSelectableRow, rowIsHidden]);
533
- var ariaLabel = passedAriaLabel || computedAriaLabel;
534
- return React__namespace.createElement(React__namespace.Fragment, null, isSelectable && React__namespace.createElement("output", {
535
- className: "pf-screen-reader"
536
- }, ariaLabel), React__namespace.createElement("tr", Object.assign({
537
- className: css(className, isExpanded !== undefined && styles$1.tableExpandableRow, isExpanded && styles$1.modifiers.expanded, isEditable && inlineStyles.modifiers.inlineEditable, isHoverable && styles$1.modifiers.hoverable, isRowSelected && styles$1.modifiers.selected, isStriped && styles$1.modifiers.striped, resetOffset && styles$1.modifiers.firstCellOffsetReset),
538
- hidden: rowIsHidden
539
- }, isHoverable && {
540
- tabIndex: 0
541
- }, {
542
- "aria-label": ariaLabel,
543
- ref: innerRef
544
- }, onRowClick && {
545
- onClick: onRowClick,
546
- onKeyDown: onKeyDown
547
- }, ouiaProps, props), children));
814
+ return {
815
+ className: css(styles$1.tableCheck),
816
+ component: rowId !== -1 ? 'td' : 'th',
817
+ isVisible: !rowData || !rowData.fullWidth,
818
+ children: React__namespace.createElement(SelectColumn, Object.assign({}, customProps, {
819
+ selectVariant: selectVariant,
820
+ onSelect: selectClick,
821
+ name: selectName,
822
+ tooltip: tooltip
823
+ }), label)
824
+ };
548
825
  };
549
826
 
550
- var Tr = React__namespace.forwardRef(function (props, ref) {
551
- return React__namespace.createElement(TrBase, Object.assign({}, props, {
552
- innerRef: ref
553
- }));
554
- });
555
- Tr.displayName = 'Tr';
556
-
557
- Promise.resolve().then(function () { return require('./table-scrollable-8d506d50.js'); });
558
- var styles = {
559
- "modifiers": {
560
- "borderRight": "pf-m-border-right",
561
- "borderLeft": "pf-m-border-left",
562
- "stickyHeader": "pf-m-sticky-header"
563
- },
564
- "scrollInnerWrapper": "pf-c-scroll-inner-wrapper",
565
- "scrollOuterWrapper": "pf-c-scroll-outer-wrapper",
566
- "table": "pf-c-table",
567
- "tableStickyColumn": "pf-c-table__sticky-column"
827
+ var LongArrowAltUpIconConfig = {
828
+ name: 'LongArrowAltUpIcon',
829
+ height: 512,
830
+ width: 256,
831
+ svgPath: 'M88 166.059V468c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12V166.059h46.059c21.382 0 32.09-25.851 16.971-40.971l-86.059-86.059c-9.373-9.373-24.569-9.373-33.941 0l-86.059 86.059c-15.119 15.119-4.411 40.971 16.971 40.971H88z',
832
+ yOffset: 0,
833
+ xOffset: 0
568
834
  };
835
+ var LongArrowAltUpIcon = createIcon(LongArrowAltUpIconConfig);
836
+ var LongArrowAltUpIcon$1 = LongArrowAltUpIcon;
569
837
 
570
- var IconSize;
571
-
572
- (function (IconSize) {
573
- IconSize["sm"] = "sm";
574
- IconSize["md"] = "md";
575
- IconSize["lg"] = "lg";
576
- IconSize["xl"] = "xl";
577
- })(IconSize || (IconSize = {}));
578
-
579
- var getSize = function getSize(size) {
580
- switch (size) {
581
- case IconSize.sm:
582
- return '1em';
583
-
584
- case IconSize.md:
585
- return '1.5em';
586
-
587
- case IconSize.lg:
588
- return '2em';
589
-
590
- case IconSize.xl:
591
- return '3em';
592
-
593
- default:
594
- return '1em';
595
- }
838
+ var LongArrowAltDownIconConfig = {
839
+ name: 'LongArrowAltDownIcon',
840
+ height: 512,
841
+ width: 256,
842
+ svgPath: 'M168 345.941V44c0-6.627-5.373-12-12-12h-56c-6.627 0-12 5.373-12 12v301.941H41.941c-21.382 0-32.09 25.851-16.971 40.971l86.059 86.059c9.373 9.373 24.569 9.373 33.941 0l86.059-86.059c15.119-15.119 4.411-40.971-16.971-40.971H168z',
843
+ yOffset: 0,
844
+ xOffset: 0
596
845
  };
597
- var currentId = 0;
598
- /**
599
- * Factory to create Icon class components for consumers
600
- */
601
-
602
- function createIcon(_ref) {
603
- var name = _ref.name,
604
- _ref$xOffset = _ref.xOffset,
605
- xOffset = _ref$xOffset === void 0 ? 0 : _ref$xOffset,
606
- _ref$yOffset = _ref.yOffset,
607
- yOffset = _ref$yOffset === void 0 ? 0 : _ref$yOffset,
608
- width = _ref.width,
609
- height = _ref.height,
610
- svgPath = _ref.svgPath;
611
-
612
- var _a;
613
-
614
- return _a = /*#__PURE__*/function (_React$Component) {
615
- _inheritsLoose(SVGIcon, _React$Component);
616
-
617
- function SVGIcon() {
618
- var _this;
619
-
620
- _this = _React$Component.apply(this, arguments) || this;
621
- _this.id = "icon-title-" + currentId++;
622
- return _this;
623
- }
624
-
625
- var _proto = SVGIcon.prototype;
626
-
627
- _proto.render = function render() {
628
- var _a = this.props,
629
- size = _a.size,
630
- color = _a.color,
631
- title = _a.title,
632
- noVerticalAlign = _a.noVerticalAlign,
633
- props = __rest(_a, ["size", "color", "title", "noVerticalAlign"]);
634
-
635
- var hasTitle = Boolean(title);
636
- var heightWidth = getSize(size);
637
- var baseAlign = -0.125 * Number.parseFloat(heightWidth);
638
- var style = noVerticalAlign ? null : {
639
- verticalAlign: baseAlign + "em"
640
- };
641
- var viewBox = [xOffset, yOffset, width, height].join(' ');
642
- return React__namespace.createElement("svg", Object.assign({
643
- style: style,
644
- fill: color,
645
- height: heightWidth,
646
- width: heightWidth,
647
- viewBox: viewBox,
648
- "aria-labelledby": hasTitle ? this.id : null,
649
- "aria-hidden": hasTitle ? null : true,
650
- role: "img"
651
- }, props), hasTitle && React__namespace.createElement("title", {
652
- id: this.id
653
- }, title), React__namespace.createElement("path", {
654
- d: svgPath
655
- }));
656
- };
657
-
658
- return SVGIcon;
659
- }(React__namespace.Component), _a.displayName = name, _a.defaultProps = {
660
- color: 'currentColor',
661
- size: IconSize.sm,
662
- noVerticalAlign: false
663
- }, _a;
664
- }
846
+ var LongArrowAltDownIcon = createIcon(LongArrowAltDownIconConfig);
847
+ var LongArrowAltDownIcon$1 = LongArrowAltDownIcon;
665
848
 
666
- var HelpIconConfig = {
667
- name: 'HelpIcon',
668
- height: 1024,
669
- width: 1024,
670
- svgPath: 'M521.3,576 C627.5,576 713.7,502 713.7,413.7 C713.7,325.4 627.6,253.6 521.3,253.6 C366,253.6 334.5,337.7 329.2,407.2 C329.2,414.3 335.2,416 343.5,416 L445,416 C450.5,416 458,415.5 460.8,406.5 C460.8,362.6 582.9,357.1 582.9,413.6 C582.9,441.9 556.2,470.9 521.3,473 C486.4,475.1 447.3,479.8 447.3,521.7 L447.3,553.8 C447.3,570.8 456.1,576 472,576 C487.9,576 521.3,576 521.3,576 M575.3,751.3 L575.3,655.3 C575.313862,651.055109 573.620137,646.982962 570.6,644 C567.638831,640.947672 563.552355,639.247987 559.3,639.29884 L463.3,639.29884 C459.055109,639.286138 454.982962,640.979863 452,644 C448.947672,646.961169 447.247987,651.047645 447.29884,655.3 L447.29884,751.3 C447.286138,755.544891 448.979863,759.617038 452,762.6 C454.961169,765.652328 459.047645,767.352013 463.3,767.30116 L559.3,767.30116 C563.544891,767.313862 567.617038,765.620137 570.6,762.6 C573.659349,759.643612 575.360354,755.553963 575.3,751.3 M512,896 C300.2,896 128,723.9 128,512 C128,300.3 300.2,128 512,128 C723.8,128 896,300.2 896,512 C896,723.8 723.7,896 512,896 M512.1,0 C229.7,0 0,229.8 0,512 C0,794.2 229.8,1024 512.1,1024 C794.4,1024 1024,794.3 1024,512 C1024,229.7 794.4,0 512.1,0',
849
+ var ArrowsAltVIconConfig = {
850
+ name: 'ArrowsAltVIcon',
851
+ height: 512,
852
+ width: 256,
853
+ svgPath: 'M214.059 377.941H168V134.059h46.059c21.382 0 32.09-25.851 16.971-40.971L144.971 7.029c-9.373-9.373-24.568-9.373-33.941 0L24.971 93.088c-15.119 15.119-4.411 40.971 16.971 40.971H88v243.882H41.941c-21.382 0-32.09 25.851-16.971 40.971l86.059 86.059c9.373 9.373 24.568 9.373 33.941 0l86.059-86.059c15.12-15.119 4.412-40.971-16.97-40.971z',
671
854
  yOffset: 0,
672
855
  xOffset: 0
673
856
  };
674
- var HelpIcon = createIcon(HelpIconConfig);
675
- var HelpIcon$1 = HelpIcon;
676
-
677
- var TableTextVariant;
678
-
679
- (function (TableTextVariant) {
680
- TableTextVariant["div"] = "div";
681
- TableTextVariant["nav"] = "nav";
682
- })(TableTextVariant || (TableTextVariant = {}));
857
+ var ArrowsAltVIcon = createIcon(ArrowsAltVIconConfig);
858
+ var ArrowsAltVIcon$1 = ArrowsAltVIcon;
683
859
 
684
- var WrapModifier;
860
+ var SortByDirection;
685
861
 
686
- (function (WrapModifier) {
687
- WrapModifier["wrap"] = "wrap";
688
- WrapModifier["nowrap"] = "nowrap";
689
- WrapModifier["truncate"] = "truncate";
690
- WrapModifier["breakWord"] = "breakWord";
691
- WrapModifier["fitContent"] = "fitContent";
692
- })(WrapModifier || (WrapModifier = {}));
862
+ (function (SortByDirection) {
863
+ SortByDirection["asc"] = "asc";
864
+ SortByDirection["desc"] = "desc";
865
+ })(SortByDirection || (SortByDirection = {}));
693
866
 
694
- var TableText = function TableText(_a) {
867
+ var SortColumn = function SortColumn(_a) {
695
868
  var _a$children = _a.children,
696
869
  children = _a$children === void 0 ? null : _a$children,
697
870
  _a$className = _a.className,
698
871
  className = _a$className === void 0 ? '' : _a$className,
699
- _a$variant = _a.variant,
700
- variant = _a$variant === void 0 ? 'span' : _a$variant,
701
- _a$wrapModifier = _a.wrapModifier,
702
- wrapModifier = _a$wrapModifier === void 0 ? null : _a$wrapModifier,
703
- _a$tooltip = _a.tooltip,
704
- tooltipProp = _a$tooltip === void 0 ? '' : _a$tooltip,
705
- _a$tooltipProps = _a.tooltipProps,
706
- tooltipProps = _a$tooltipProps === void 0 ? {} : _a$tooltipProps,
707
- _a$onMouseEnter = _a.onMouseEnter,
708
- onMouseEnterProp = _a$onMouseEnter === void 0 ? function () {} : _a$onMouseEnter,
709
- props = __rest(_a, ["children", "className", "variant", "wrapModifier", "tooltip", "tooltipProps", "onMouseEnter"]);
710
-
711
- var Component = variant;
872
+ _a$isSortedBy = _a.isSortedBy,
873
+ isSortedBy = _a$isSortedBy === void 0 ? false : _a$isSortedBy,
874
+ _a$onSort = _a.onSort,
875
+ onSort = _a$onSort === void 0 ? null : _a$onSort,
876
+ _a$sortDirection = _a.sortDirection,
877
+ sortDirection = _a$sortDirection === void 0 ? '' : _a$sortDirection,
878
+ _a$type = _a.type,
879
+ type = _a$type === void 0 ? 'button' : _a$type,
880
+ tooltip = _a.tooltip,
881
+ tooltipProps = _a.tooltipProps,
882
+ tooltipHasDefaultBehavior = _a.tooltipHasDefaultBehavior,
883
+ props = __rest$1(_a, ["children", "className", "isSortedBy", "onSort", "sortDirection", "type", "tooltip", "tooltipProps", "tooltipHasDefaultBehavior"]);
712
884
 
713
- var _React$useState = React__namespace.useState(''),
714
- tooltip = _React$useState[0],
715
- setTooltip = _React$useState[1];
885
+ var SortedByIcon;
716
886
 
717
- var onMouseEnter = function onMouseEnter(event) {
718
- if (event.target.offsetWidth < event.target.scrollWidth) {
719
- setTooltip(tooltipProp || event.target.innerText);
720
- } else {
721
- setTooltip('');
722
- }
887
+ var _React$useState = React__namespace.useState(false),
888
+ focused = _React$useState[0],
889
+ setFocused = _React$useState[1];
723
890
 
724
- onMouseEnterProp(event);
725
- };
726
-
727
- var text = React__namespace.createElement(Component, Object.assign({
728
- onMouseEnter: onMouseEnter,
729
- className: css(className, wrapModifier && styles$1.modifiers[wrapModifier], styles$1.tableText)
730
- }, props), children);
731
- return tooltip !== '' ? React__namespace.createElement(Tooltip.Tooltip, Object.assign({
732
- content: tooltip,
733
- isVisible: true
734
- }, tooltipProps), text) : text;
735
- };
736
- TableText.displayName = 'TableText';
737
-
738
- var HeaderCellInfoWrapper = function HeaderCellInfoWrapper(_ref) {
739
- var children = _ref.children,
740
- info = _ref.info,
741
- className = _ref.className,
742
- _ref$variant = _ref.variant,
743
- variant = _ref$variant === void 0 ? 'tooltip' : _ref$variant,
744
- popoverProps = _ref.popoverProps,
745
- tooltipProps = _ref.tooltipProps,
746
- ariaLabel = _ref.ariaLabel;
747
- return React__namespace.createElement("div", {
748
- className: css(styles$1.tableColumnHelp, className)
749
- }, typeof children === 'string' ? React__namespace.createElement(TableText, null, children) : children, React__namespace.createElement("span", {
750
- className: css(styles$1.tableColumnHelpAction)
751
- }, variant === 'tooltip' ? React__namespace.createElement(reactCore.Tooltip, Object.assign({
752
- content: info
753
- }, tooltipProps), React__namespace.createElement(reactCore.Button, {
754
- variant: "plain",
755
- "aria-label": ariaLabel || typeof info === 'string' && info || 'More info'
756
- }, React__namespace.createElement(HelpIcon$1, {
757
- noVerticalAlign: true
758
- }))) : React__namespace.createElement(reactCore.Popover, Object.assign({
759
- bodyContent: info
760
- }, popoverProps), React__namespace.createElement(reactCore.Button, {
761
- variant: "plain",
762
- "aria-label": ariaLabel || typeof info === 'string' && info || 'More info'
763
- }, React__namespace.createElement(HelpIcon$1, {
764
- noVerticalAlign: true
765
- })))));
766
- };
767
- HeaderCellInfoWrapper.displayName = 'HeaderCellInfoWrapper';
768
-
769
- var info = function info(_ref) {
770
- var tooltip = _ref.tooltip,
771
- tooltipProps = _ref.tooltipProps,
772
- popover = _ref.popover,
773
- popoverProps = _ref.popoverProps,
774
- className = _ref.className,
775
- ariaLabel = _ref.ariaLabel;
776
-
777
- var infoObj = function infoObj(value) {
778
- return {
779
- className: styles$1.modifiers.help,
780
- children: tooltip ? React__namespace.createElement(HeaderCellInfoWrapper, {
781
- variant: "tooltip",
782
- info: tooltip,
783
- tooltipProps: tooltipProps,
784
- ariaLabel: ariaLabel,
785
- className: className
786
- }, value) : React__namespace.createElement(HeaderCellInfoWrapper, {
787
- variant: "popover",
788
- info: popover,
789
- popoverProps: popoverProps,
790
- ariaLabel: ariaLabel,
791
- className: className
792
- }, value)
793
- };
794
- };
795
-
796
- return infoObj;
797
- };
798
-
799
- var LongArrowAltUpIconConfig = {
800
- name: 'LongArrowAltUpIcon',
801
- height: 512,
802
- width: 256,
803
- svgPath: 'M88 166.059V468c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12V166.059h46.059c21.382 0 32.09-25.851 16.971-40.971l-86.059-86.059c-9.373-9.373-24.569-9.373-33.941 0l-86.059 86.059c-15.119 15.119-4.411 40.971 16.971 40.971H88z',
804
- yOffset: 0,
805
- xOffset: 0
806
- };
807
- var LongArrowAltUpIcon = createIcon(LongArrowAltUpIconConfig);
808
- var LongArrowAltUpIcon$1 = LongArrowAltUpIcon;
809
-
810
- var LongArrowAltDownIconConfig = {
811
- name: 'LongArrowAltDownIcon',
812
- height: 512,
813
- width: 256,
814
- svgPath: 'M168 345.941V44c0-6.627-5.373-12-12-12h-56c-6.627 0-12 5.373-12 12v301.941H41.941c-21.382 0-32.09 25.851-16.971 40.971l86.059 86.059c9.373 9.373 24.569 9.373 33.941 0l86.059-86.059c15.119-15.119 4.411-40.971-16.971-40.971H168z',
815
- yOffset: 0,
816
- xOffset: 0
817
- };
818
- var LongArrowAltDownIcon = createIcon(LongArrowAltDownIconConfig);
819
- var LongArrowAltDownIcon$1 = LongArrowAltDownIcon;
820
-
821
- var ArrowsAltVIconConfig = {
822
- name: 'ArrowsAltVIcon',
823
- height: 512,
824
- width: 256,
825
- svgPath: 'M214.059 377.941H168V134.059h46.059c21.382 0 32.09-25.851 16.971-40.971L144.971 7.029c-9.373-9.373-24.568-9.373-33.941 0L24.971 93.088c-15.119 15.119-4.411 40.971 16.971 40.971H88v243.882H41.941c-21.382 0-32.09 25.851-16.971 40.971l86.059 86.059c9.373 9.373 24.568 9.373 33.941 0l86.059-86.059c15.12-15.119 4.412-40.971-16.97-40.971z',
826
- yOffset: 0,
827
- xOffset: 0
828
- };
829
- var ArrowsAltVIcon = createIcon(ArrowsAltVIconConfig);
830
- var ArrowsAltVIcon$1 = ArrowsAltVIcon;
831
-
832
- var SortByDirection;
833
-
834
- (function (SortByDirection) {
835
- SortByDirection["asc"] = "asc";
836
- SortByDirection["desc"] = "desc";
837
- })(SortByDirection || (SortByDirection = {}));
838
-
839
- var SortColumn = function SortColumn(_a) {
840
- var _a$children = _a.children,
841
- children = _a$children === void 0 ? null : _a$children,
842
- _a$className = _a.className,
843
- className = _a$className === void 0 ? '' : _a$className,
844
- _a$isSortedBy = _a.isSortedBy,
845
- isSortedBy = _a$isSortedBy === void 0 ? false : _a$isSortedBy,
846
- _a$onSort = _a.onSort,
847
- onSort = _a$onSort === void 0 ? null : _a$onSort,
848
- _a$sortDirection = _a.sortDirection,
849
- sortDirection = _a$sortDirection === void 0 ? '' : _a$sortDirection,
850
- _a$type = _a.type,
851
- type = _a$type === void 0 ? 'button' : _a$type,
852
- props = __rest(_a, ["children", "className", "isSortedBy", "onSort", "sortDirection", "type"]);
853
-
854
- var SortedByIcon;
855
-
856
- if (isSortedBy) {
857
- SortedByIcon = sortDirection === SortByDirection.asc ? LongArrowAltUpIcon$1 : LongArrowAltDownIcon$1;
858
- } else {
859
- SortedByIcon = ArrowsAltVIcon$1;
860
- }
891
+ if (isSortedBy) {
892
+ SortedByIcon = sortDirection === SortByDirection.asc ? LongArrowAltUpIcon$1 : LongArrowAltDownIcon$1;
893
+ } else {
894
+ SortedByIcon = ArrowsAltVIcon$1;
895
+ }
861
896
 
862
897
  return React__namespace.createElement("button", Object.assign({}, props, {
863
898
  type: type,
864
899
  className: css(className, styles$1.tableButton),
865
900
  onClick: function onClick(event) {
866
901
  return onSort && onSort(event);
902
+ },
903
+ onFocus: function onFocus() {
904
+ return setFocused(true);
905
+ },
906
+ onBlur: function onBlur() {
907
+ return setFocused(false);
867
908
  }
868
909
  }), React__namespace.createElement("div", {
869
910
  className: css(className, styles$1.tableButtonContent)
870
- }, React__namespace.createElement(TableText, null, children), React__namespace.createElement("span", {
911
+ }, React__namespace.createElement(TableText, {
912
+ tooltip: tooltip,
913
+ tooltipProps: tooltipProps,
914
+ tooltipHasDefaultBehavior: tooltipHasDefaultBehavior,
915
+ focused: focused
916
+ }, children), React__namespace.createElement("span", {
871
917
  className: css(styles$1.tableSortIndicator)
872
918
  }, React__namespace.createElement(SortedByIcon, null))));
873
919
  };
@@ -897,7 +943,10 @@ var sortableFavorites = function sortableFavorites(sort) {
897
943
  sortBy: sort.sortBy,
898
944
  onSort: sort === null || sort === void 0 ? void 0 : sort.onSort
899
945
  }
900
- }
946
+ },
947
+ tooltip: sort.tooltip,
948
+ tooltipProps: sort.tooltipProps,
949
+ tooltipHasDefaultBehavior: true
901
950
  });
902
951
  };
903
952
  };
@@ -906,7 +955,10 @@ var sortable = function sortable(label, _ref) {
906
955
  column = _ref.column,
907
956
  property = _ref.property,
908
957
  className = _ref.className,
909
- ariaLabel = _ref.ariaLabel;
958
+ ariaLabel = _ref.ariaLabel,
959
+ tooltip = _ref.tooltip,
960
+ tooltipProps = _ref.tooltipProps,
961
+ tooltipHasDefaultBehavior = _ref.tooltipHasDefaultBehavior;
910
962
  var _column$extraParams = column.extraParams,
911
963
  sortBy = _column$extraParams.sortBy,
912
964
  onSort = _column$extraParams.onSort;
@@ -940,219 +992,660 @@ var sortable = function sortable(label, _ref) {
940
992
  isSortedBy: isSortedBy,
941
993
  sortDirection: isSortedBy ? sortBy.direction : '',
942
994
  onSort: sortClicked,
943
- "aria-label": ariaLabel
995
+ "aria-label": ariaLabel,
996
+ tooltip: tooltip,
997
+ tooltipProps: tooltipProps,
998
+ tooltipHasDefaultBehavior: tooltipHasDefaultBehavior
944
999
  }, label)
945
1000
  };
946
1001
  };
947
1002
 
948
- var RowSelectVariant;
1003
+ var resolveOrDefault = function resolveOrDefault(resolver, defaultValue, rowData, extraData) {
1004
+ return typeof resolver === 'function' ? resolver(rowData, extraData) : defaultValue;
1005
+ };
949
1006
 
950
- (function (RowSelectVariant) {
951
- RowSelectVariant["radio"] = "radio";
952
- RowSelectVariant["checkbox"] = "checkbox";
953
- })(RowSelectVariant || (RowSelectVariant = {}));
1007
+ var cellActions = function cellActions(actions, actionResolver, areActionsDisabled) {
1008
+ return function (label, _ref) {
1009
+ var rowData = _ref.rowData,
1010
+ column = _ref.column,
1011
+ rowIndex = _ref.rowIndex,
1012
+ columnIndex = _ref.columnIndex,
1013
+ _ref$column$extraPara = _ref.column.extraParams,
1014
+ actionsToggle = _ref$column$extraPara.actionsToggle,
1015
+ actionsPopperProps = _ref$column$extraPara.actionsPopperProps,
1016
+ property = _ref.property;
1017
+ var extraData = {
1018
+ rowIndex: rowIndex,
1019
+ columnIndex: columnIndex,
1020
+ column: column,
1021
+ property: property
1022
+ };
1023
+ var resolvedActions = resolveOrDefault(actionResolver, actions, rowData, extraData);
1024
+ var resolvedIsDisabled = resolveOrDefault(areActionsDisabled, rowData && rowData.disableActions, rowData, extraData);
1025
+ var renderProps = resolvedActions && resolvedActions.length > 0 ? {
1026
+ children: React__namespace.createElement(ActionsColumn, {
1027
+ items: resolvedActions,
1028
+ isDisabled: resolvedIsDisabled,
1029
+ rowData: rowData,
1030
+ extraData: extraData,
1031
+ actionsToggle: actionsToggle,
1032
+ popperProps: actionsPopperProps
1033
+ }, label)
1034
+ } : {};
1035
+ return Object.assign({
1036
+ className: css(styles$1.tableAction),
1037
+ style: {
1038
+ paddingRight: 0
1039
+ },
1040
+ isVisible: true
1041
+ }, renderProps);
1042
+ };
1043
+ };
954
1044
 
955
- var SelectColumn = function SelectColumn(_a) {
956
- var _a$children = _a.children,
957
- children = _a$children === void 0 ? null : _a$children,
958
- _a$onSelect = _a.onSelect,
959
- onSelect = _a$onSelect === void 0 ? null : _a$onSelect,
960
- selectVariant = _a.selectVariant,
961
- props = __rest(_a, ["children", "className", "onSelect", "selectVariant"]);
1045
+ var camelize = function camelize(s) {
1046
+ return s.toUpperCase().replace('-', '').replace('_', '');
1047
+ };
962
1048
 
963
- return React__namespace.createElement(React__namespace.Fragment, null, React__namespace.createElement("label", null, React__namespace.createElement("input", Object.assign({}, props, {
964
- type: selectVariant,
965
- onChange: onSelect
966
- }))), children);
1049
+ var toCamel = function toCamel(s) {
1050
+ return s.replace(/([-_][a-z])/gi, camelize);
967
1051
  };
968
- SelectColumn.displayName = 'SelectColumn';
1052
+ /**
1053
+ * @param {string} input - String to capitalize
1054
+ */
969
1055
 
970
- Promise.resolve().then(function () { return require('./check-293a8689.js'); });
971
- var checkStyles = {
972
- "check": "pf-c-check",
973
- "checkBody": "pf-c-check__body",
974
- "checkDescription": "pf-c-check__description",
975
- "checkInput": "pf-c-check__input",
976
- "checkLabel": "pf-c-check__label",
977
- "modifiers": {
978
- "standalone": "pf-m-standalone",
979
- "disabled": "pf-m-disabled"
980
- }
1056
+ function capitalize(input) {
1057
+ return input[0].toUpperCase() + input.substring(1);
1058
+ }
1059
+
1060
+ var cellWidth = function cellWidth(width) {
1061
+ return function () {
1062
+ return {
1063
+ className: css(styles$1.modifiers[typeof width === 'number' ? "width_" + width : "width" + capitalize(width)])
1064
+ };
1065
+ };
981
1066
  };
982
1067
 
983
- var selectable = function selectable(label, _ref) {
1068
+ var collapsible = function collapsible(value, _ref) {
984
1069
  var rowIndex = _ref.rowIndex,
985
1070
  columnIndex = _ref.columnIndex,
986
1071
  rowData = _ref.rowData,
987
1072
  column = _ref.column,
988
1073
  property = _ref.property;
989
1074
  var _column$extraParams = column.extraParams,
990
- onSelect = _column$extraParams.onSelect,
991
- selectVariant = _column$extraParams.selectVariant,
992
- allRowsSelected = _column$extraParams.allRowsSelected,
993
- isHeaderSelectDisabled = _column$extraParams.isHeaderSelectDisabled;
1075
+ onCollapse = _column$extraParams.onCollapse,
1076
+ _column$extraParams$r = _column$extraParams.rowLabeledBy,
1077
+ rowLabeledBy = _column$extraParams$r === void 0 ? 'simple-node' : _column$extraParams$r,
1078
+ _column$extraParams$e = _column$extraParams.expandId,
1079
+ expandId = _column$extraParams$e === void 0 ? 'expand-toggle' : _column$extraParams$e,
1080
+ allRowsExpanded = _column$extraParams.allRowsExpanded,
1081
+ collapseAllAriaLabel = _column$extraParams.collapseAllAriaLabel;
994
1082
  var extraData = {
995
1083
  rowIndex: rowIndex,
996
1084
  columnIndex: columnIndex,
997
1085
  column: column,
998
1086
  property: property
999
1087
  };
1000
-
1001
- if (rowData && rowData.hasOwnProperty('parent') && !rowData.showSelect && !rowData.fullWidth) {
1002
- return {
1003
- component: 'td',
1004
- isVisible: true
1005
- };
1006
- }
1007
-
1008
1088
  var rowId = rowIndex !== undefined ? rowIndex : -1;
1089
+ var customProps = Object.assign({}, rowId !== -1 ? {
1090
+ isOpen: rowData === null || rowData === void 0 ? void 0 : rowData.isOpen,
1091
+ 'aria-labelledby': "" + rowLabeledBy + rowId + " " + expandId + rowId
1092
+ } : {
1093
+ isOpen: allRowsExpanded,
1094
+ 'aria-label': collapseAllAriaLabel || 'Expand all rows'
1095
+ });
1009
1096
  /**
1010
- * @param {React.FormEvent} event - React form event
1097
+ * @param {React.MouseEvent} event - Mouse event
1011
1098
  */
1012
1099
 
1013
- function selectClick(event) {
1014
- var selected = rowIndex === undefined ? event.currentTarget.checked : rowData && !rowData.selected; // tslint:disable-next-line:no-unused-expression
1100
+ function onToggle(event) {
1101
+ var open = rowData ? !rowData.isOpen : !allRowsExpanded; // tslint:disable-next-line:no-unused-expression
1015
1102
 
1016
- onSelect && onSelect(event, selected, rowId, rowData, extraData);
1103
+ onCollapse && onCollapse(event, rowIndex, open, rowData, extraData);
1017
1104
  }
1018
1105
 
1019
- var customProps = Object.assign(Object.assign(Object.assign({}, rowId !== -1 ? {
1020
- checked: rowData && !!rowData.selected,
1021
- 'aria-label': "Select row " + rowIndex
1022
- } : {
1023
- checked: allRowsSelected,
1024
- 'aria-label': 'Select all rows'
1025
- }), rowData && (rowData.disableCheckbox || rowData.disableSelection) && {
1026
- disabled: true,
1027
- className: checkStyles.checkInput
1028
- }), !rowData && isHeaderSelectDisabled && {
1029
- disabled: true
1030
- });
1031
- var selectName = 'check-all';
1032
-
1033
- if (rowId !== -1 && selectVariant === RowSelectVariant.checkbox) {
1034
- selectName = "checkrow" + rowIndex;
1035
- } else if (rowId !== -1) {
1036
- selectName = 'radioGroup';
1106
+ return {
1107
+ className: ((rowData === null || rowData === void 0 ? void 0 : rowData.isOpen) !== undefined || rowId === -1) && css(styles$1.tableToggle),
1108
+ isVisible: !(rowData === null || rowData === void 0 ? void 0 : rowData.fullWidth),
1109
+ children: React__namespace.createElement(CollapseColumn, Object.assign({
1110
+ "aria-labelledby": "" + rowLabeledBy + rowId + " " + expandId + rowId,
1111
+ onToggle: onToggle,
1112
+ id: expandId + rowId
1113
+ }, customProps), value)
1114
+ };
1115
+ };
1116
+
1117
+ var compoundExpand = function compoundExpand(value, _ref) {
1118
+ var rowIndex = _ref.rowIndex,
1119
+ columnIndex = _ref.columnIndex,
1120
+ rowData = _ref.rowData,
1121
+ column = _ref.column,
1122
+ property = _ref.property;
1123
+
1124
+ if (!value) {
1125
+ return null;
1126
+ }
1127
+
1128
+ var title = value.title,
1129
+ props = value.props;
1130
+ var _column$extraParams = column.extraParams,
1131
+ onExpand = _column$extraParams.onExpand,
1132
+ _column$extraParams$e = _column$extraParams.expandId,
1133
+ expandId = _column$extraParams$e === void 0 ? 'expand-toggle' : _column$extraParams$e;
1134
+ var extraData = {
1135
+ rowIndex: rowIndex,
1136
+ columnIndex: columnIndex,
1137
+ column: column,
1138
+ property: property
1139
+ };
1140
+ /**
1141
+ * @param {React.MouseEvent} event - Mouse event
1142
+ */
1143
+
1144
+ function onToggle(event) {
1145
+ // tslint:disable-next-line:no-unused-expression
1146
+ onExpand && onExpand(event, rowIndex, columnIndex, props.isOpen, rowData, extraData);
1037
1147
  }
1038
1148
 
1039
1149
  return {
1040
- className: css(styles$1.tableCheck),
1041
- component: 'td',
1042
- isVisible: !rowData || !rowData.fullWidth,
1043
- children: React__namespace.createElement(SelectColumn, Object.assign({}, customProps, {
1044
- selectVariant: selectVariant,
1045
- onSelect: selectClick,
1046
- name: selectName
1047
- }), label)
1150
+ className: css(styles$1.tableCompoundExpansionToggle, props.isOpen && styles$1.modifiers.expanded),
1151
+ children: props.isOpen !== undefined && React__namespace.createElement("button", {
1152
+ type: "button",
1153
+ className: css(styles$1.tableButton),
1154
+ onClick: onToggle,
1155
+ "aria-expanded": props.isOpen,
1156
+ "aria-controls": props.ariaControls,
1157
+ id: expandId + "-" + rowIndex + "-" + columnIndex
1158
+ }, React__namespace.createElement(TableText, null, title))
1048
1159
  };
1049
1160
  };
1050
1161
 
1051
- var AngleDownIconConfig = {
1052
- name: 'AngleDownIcon',
1053
- height: 512,
1054
- width: 320,
1055
- svgPath: 'M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z',
1056
- yOffset: 0,
1057
- xOffset: 0
1162
+ var visibilityModifiers = ['hidden', 'hiddenOnSm', 'hiddenOnMd', 'hiddenOnLg', 'hiddenOnXl', 'hiddenOn_2xl', 'visibleOnSm', 'visibleOnMd', 'visibleOnLg', 'visibleOnXl', 'visibleOn_2xl'];
1163
+ var Visibility = visibilityModifiers.filter(function (key) {
1164
+ return styles$1.modifiers[key];
1165
+ }).reduce(function (acc, curr) {
1166
+ var key2 = curr.replace('_2xl', '2Xl');
1167
+ acc[key2] = styles$1.modifiers[curr];
1168
+ return acc;
1169
+ }, {});
1170
+ var classNames = function classNames() {
1171
+ var _arguments = arguments;
1172
+ return function () {
1173
+ return {
1174
+ className: css.apply(void 0, [].slice.call(_arguments))
1175
+ };
1176
+ };
1058
1177
  };
1059
- var AngleDownIcon = createIcon(AngleDownIconConfig);
1060
- var AngleDownIcon$1 = AngleDownIcon;
1061
1178
 
1062
- var CollapseColumn = function CollapseColumn(_a) {
1179
+ var info = function info(_ref) {
1180
+ var tooltip = _ref.tooltip,
1181
+ tooltipProps = _ref.tooltipProps,
1182
+ popover = _ref.popover,
1183
+ popoverProps = _ref.popoverProps,
1184
+ className = _ref.className,
1185
+ ariaLabel = _ref.ariaLabel;
1186
+
1187
+ var infoObj = function infoObj(value) {
1188
+ return {
1189
+ className: styles$1.modifiers.help,
1190
+ children: tooltip ? React__namespace.createElement(HeaderCellInfoWrapper, {
1191
+ variant: "tooltip",
1192
+ info: tooltip,
1193
+ tooltipProps: tooltipProps,
1194
+ ariaLabel: ariaLabel,
1195
+ className: className
1196
+ }, value) : React__namespace.createElement(HeaderCellInfoWrapper, {
1197
+ variant: "popover",
1198
+ info: popover,
1199
+ popoverProps: popoverProps,
1200
+ ariaLabel: ariaLabel,
1201
+ className: className
1202
+ }, value)
1203
+ };
1204
+ };
1205
+
1206
+ return infoObj;
1207
+ };
1208
+
1209
+ var FavoritesCell = function FavoritesCell(_a) {
1063
1210
  var _a$className = _a.className,
1064
1211
  className = _a$className === void 0 ? '' : _a$className,
1065
- _a$children = _a.children,
1066
- children = _a$children === void 0 ? null : _a$children,
1067
- isOpen = _a.isOpen,
1068
- onToggle = _a.onToggle,
1069
- props = __rest(_a, ["className", "children", "isOpen", "onToggle"]);
1212
+ onFavorite = _a.onFavorite,
1213
+ isFavorited = _a.isFavorited,
1214
+ rowIndex = _a.rowIndex,
1215
+ props = __rest$1(_a, ["className", "onFavorite", "isFavorited", "rowIndex"]);
1070
1216
 
1071
- return React__namespace.createElement(React__namespace.Fragment, null, isOpen !== undefined && React__namespace.createElement(Button.Button, Object.assign({
1072
- className: css(className, isOpen && styles$1.modifiers.expanded)
1073
- }, props, {
1217
+ var ariaProps = rowIndex === undefined ? {} : {
1218
+ id: "favorites-button-" + rowIndex,
1219
+ 'aria-labelledby': "favorites-button-" + rowIndex
1220
+ };
1221
+ return React__namespace.createElement(Button.Button, Object.assign({
1074
1222
  variant: "plain",
1075
- "aria-label": props['aria-label'] || 'Details',
1076
- onClick: onToggle,
1077
- "aria-expanded": isOpen
1078
- }), React__namespace.createElement("div", {
1079
- className: css(styles$1.tableToggleIcon)
1080
- }, React__namespace.createElement(AngleDownIcon$1, null))), children);
1223
+ className: className,
1224
+ type: "button",
1225
+ "aria-label": isFavorited ? 'Starred' : 'Not starred',
1226
+ onClick: onFavorite
1227
+ }, ariaProps, props), React__namespace.createElement(StarIcon$1, {
1228
+ "aria-hidden": true
1229
+ }));
1081
1230
  };
1082
- CollapseColumn.displayName = 'CollapseColumn';
1231
+ FavoritesCell.displayName = 'FavoritesCell';
1083
1232
 
1084
- var collapsible = function collapsible(value, _ref) {
1233
+ var favoritable = function favoritable(value, _ref) {
1085
1234
  var rowIndex = _ref.rowIndex,
1086
1235
  columnIndex = _ref.columnIndex,
1087
1236
  rowData = _ref.rowData,
1088
1237
  column = _ref.column,
1089
1238
  property = _ref.property;
1090
- var _column$extraParams = column.extraParams,
1091
- onCollapse = _column$extraParams.onCollapse,
1092
- _column$extraParams$r = _column$extraParams.rowLabeledBy,
1093
- rowLabeledBy = _column$extraParams$r === void 0 ? 'simple-node' : _column$extraParams$r,
1094
- _column$extraParams$e = _column$extraParams.expandId,
1095
- expandId = _column$extraParams$e === void 0 ? 'expand-toggle' : _column$extraParams$e,
1096
- allRowsExpanded = _column$extraParams.allRowsExpanded,
1097
- collapseAllAriaLabel = _column$extraParams.collapseAllAriaLabel;
1239
+ var onFavorite = column.extraParams.onFavorite;
1098
1240
  var extraData = {
1099
1241
  rowIndex: rowIndex,
1100
1242
  columnIndex: columnIndex,
1101
1243
  column: column,
1102
1244
  property: property
1103
- };
1104
- var rowId = rowIndex !== undefined ? rowIndex : -1;
1105
- var customProps = Object.assign({}, rowId !== -1 ? {
1106
- isOpen: rowData === null || rowData === void 0 ? void 0 : rowData.isOpen,
1107
- 'aria-labelledby': "" + rowLabeledBy + rowId + " " + expandId + rowId
1108
- } : {
1109
- isOpen: allRowsExpanded,
1110
- 'aria-label': collapseAllAriaLabel || 'Expand all rows'
1111
- });
1245
+ }; // this is a child row which should not display the favorites icon
1246
+
1247
+ if (rowData && rowData.hasOwnProperty('parent') && !rowData.fullWidth) {
1248
+ return {
1249
+ component: 'td',
1250
+ isVisible: true
1251
+ };
1252
+ }
1112
1253
  /**
1113
1254
  * @param {React.MouseEvent} event - Mouse event
1114
1255
  */
1115
1256
 
1116
- function onToggle(event) {
1117
- var open = rowData ? !rowData.isOpen : !allRowsExpanded; // tslint:disable-next-line:no-unused-expression
1118
1257
 
1119
- onCollapse && onCollapse(event, rowIndex, open, rowData, extraData);
1258
+ function favoritesClick(event) {
1259
+ // tslint:disable-next-line:no-unused-expression
1260
+ onFavorite && onFavorite(event, rowData && !rowData.favorited, rowIndex, rowData, extraData);
1120
1261
  }
1121
1262
 
1263
+ var additionalProps = rowData.favoritesProps || {};
1122
1264
  return {
1123
- className: ((rowData === null || rowData === void 0 ? void 0 : rowData.isOpen) !== undefined || rowId === -1) && css(styles$1.tableToggle),
1124
- isVisible: !(rowData === null || rowData === void 0 ? void 0 : rowData.fullWidth),
1125
- children: React__namespace.createElement(CollapseColumn, Object.assign({
1126
- "aria-labelledby": "" + rowLabeledBy + rowId + " " + expandId + rowId,
1127
- onToggle: onToggle,
1128
- id: expandId + rowId
1129
- }, customProps), value)
1265
+ className: css(styles$1.tableFavorite, rowData && rowData.favorited && styles$1.modifiers.favorited),
1266
+ isVisible: !rowData || !rowData.fullWidth,
1267
+ children: React__namespace.createElement(FavoritesCell, Object.assign({
1268
+ rowIndex: rowIndex,
1269
+ onFavorite: favoritesClick,
1270
+ isFavorited: rowData && rowData.favorited
1271
+ }, additionalProps))
1130
1272
  };
1131
1273
  };
1132
1274
 
1133
- var cellWidth = function cellWidth(width) {
1134
- return function () {
1135
- return {
1136
- className: css(styles$1.modifiers[typeof width === 'number' ? "width_" + width : "width" + capitalize(width)])
1137
- };
1138
- };
1275
+ var EllipsisHIconConfig = {
1276
+ name: 'EllipsisHIcon',
1277
+ height: 512,
1278
+ width: 512,
1279
+ svgPath: 'M328 256c0 39.8-32.2 72-72 72s-72-32.2-72-72 32.2-72 72-72 72 32.2 72 72zm104-72c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72zm-352 0c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72z',
1280
+ yOffset: 0,
1281
+ xOffset: 0
1282
+ };
1283
+ var EllipsisHIcon = createIcon(EllipsisHIconConfig);
1284
+ var EllipsisHIcon$1 = EllipsisHIcon;
1285
+
1286
+ var treeRow = function treeRow(onCollapse, onCheckChange, onToggleRowDetails) {
1287
+ return function (value, _ref) {
1288
+ var rowIndex = _ref.rowIndex,
1289
+ rowData = _ref.rowData;
1290
+ var _rowData$props = rowData.props,
1291
+ isExpanded = _rowData$props.isExpanded,
1292
+ isDetailsExpanded = _rowData$props.isDetailsExpanded,
1293
+ level = _rowData$props['aria-level'],
1294
+ setsize = _rowData$props['aria-setsize'],
1295
+ toggleAriaLabel = _rowData$props.toggleAriaLabel,
1296
+ checkAriaLabel = _rowData$props.checkAriaLabel,
1297
+ showDetailsAriaLabel = _rowData$props.showDetailsAriaLabel,
1298
+ isChecked = _rowData$props.isChecked,
1299
+ checkboxId = _rowData$props.checkboxId,
1300
+ icon = _rowData$props.icon;
1301
+ var content = value.title || value;
1302
+ var text = React__namespace.createElement("div", {
1303
+ className: css(treeViewStyles.tableTreeViewText),
1304
+ key: "tree-view-text"
1305
+ }, icon && React__namespace.createElement("span", {
1306
+ className: css(treeViewStyles.tableTreeViewIcon),
1307
+ key: "tree-view-text-icon"
1308
+ }, icon), React__namespace.createElement("span", {
1309
+ className: styles$1.tableText,
1310
+ key: "table-text"
1311
+ }, content));
1312
+
1313
+ var _onChange = function onChange(isChecked, event) {
1314
+ onCheckChange(event, isChecked, rowIndex, content, rowData);
1315
+ };
1316
+
1317
+ return {
1318
+ component: 'th',
1319
+ className: treeViewStyles.tableTreeViewTitleCell,
1320
+ children: level !== undefined ? React__namespace.createElement("div", {
1321
+ className: css(treeViewStyles.tableTreeViewMain)
1322
+ }, setsize > 0 && React__namespace.createElement("span", {
1323
+ className: css(treeViewStyles.tableToggle),
1324
+ key: "table-toggle"
1325
+ }, React__namespace.createElement(Button.Button, {
1326
+ variant: "plain",
1327
+ onClick: function onClick(event) {
1328
+ return onCollapse && onCollapse(event, rowIndex, content, rowData);
1329
+ },
1330
+ className: css(isExpanded && styles$1.modifiers.expanded),
1331
+ "aria-expanded": isExpanded,
1332
+ "aria-label": toggleAriaLabel || (isExpanded ? 'Collapse' : 'Expand') + " row " + rowIndex
1333
+ }, React__namespace.createElement("div", {
1334
+ className: css(treeViewStyles.tableToggleIcon)
1335
+ }, React__namespace.createElement(AngleDownIcon$1, {
1336
+ "aria-hidden": "true"
1337
+ })))), !!onCheckChange && React__namespace.createElement("span", {
1338
+ className: css(treeViewStyles.tableCheck),
1339
+ key: "table-check"
1340
+ }, React__namespace.createElement("label", {
1341
+ htmlFor: checkboxId || "checkbox_" + rowIndex
1342
+ }, React__namespace.createElement(Checkbox.Checkbox, {
1343
+ id: checkboxId || "checkbox_" + rowIndex,
1344
+ "aria-label": checkAriaLabel || "Row " + rowIndex + " checkbox",
1345
+ isChecked: isChecked,
1346
+ onChange: function onChange(event, checked) {
1347
+ return _onChange(checked, event);
1348
+ }
1349
+ }))), text, !!onToggleRowDetails && React__namespace.createElement("span", {
1350
+ className: css(treeViewStyles.tableTreeViewDetailsToggle),
1351
+ key: "view-details-toggle"
1352
+ }, React__namespace.createElement(Button.Button, {
1353
+ variant: "plain",
1354
+ "aria-expanded": isDetailsExpanded,
1355
+ "aria-label": showDetailsAriaLabel || 'Show row details',
1356
+ onClick: function onClick(event) {
1357
+ return onToggleRowDetails && onToggleRowDetails(event, rowIndex, content, rowData);
1358
+ }
1359
+ }, React__namespace.createElement("span", {
1360
+ className: styles$1.table + "__details-toggle-icon"
1361
+ }, React__namespace.createElement(EllipsisHIcon$1, {
1362
+ "aria-hidden": true
1363
+ }))))) : text
1364
+ };
1365
+ };
1366
+ };
1367
+
1368
+ var TableGridBreakpoint;
1369
+
1370
+ (function (TableGridBreakpoint) {
1371
+ TableGridBreakpoint["none"] = "";
1372
+ TableGridBreakpoint["grid"] = "grid";
1373
+ TableGridBreakpoint["gridMd"] = "grid-md";
1374
+ TableGridBreakpoint["gridLg"] = "grid-lg";
1375
+ TableGridBreakpoint["gridXl"] = "grid-xl";
1376
+ TableGridBreakpoint["grid2xl"] = "grid-2xl";
1377
+ })(TableGridBreakpoint || (TableGridBreakpoint = {}));
1378
+
1379
+ var TableVariant;
1380
+
1381
+ (function (TableVariant) {
1382
+ TableVariant["compact"] = "compact";
1383
+ })(TableVariant || (TableVariant = {}));
1384
+
1385
+ var TableContext = React__namespace.createContext({
1386
+ registerSelectableRow: function registerSelectableRow() {}
1387
+ });
1388
+
1389
+ var TableBase = function TableBase(_a) {
1390
+ var _b, _c;
1391
+
1392
+ var children = _a.children,
1393
+ className = _a.className,
1394
+ variant = _a.variant,
1395
+ _a$borders = _a.borders,
1396
+ borders = _a$borders === void 0 ? true : _a$borders,
1397
+ _a$isStickyHeader = _a.isStickyHeader,
1398
+ isStickyHeader = _a$isStickyHeader === void 0 ? false : _a$isStickyHeader,
1399
+ _a$gridBreakPoint = _a.gridBreakPoint,
1400
+ gridBreakPoint = _a$gridBreakPoint === void 0 ? TableGridBreakpoint.gridMd : _a$gridBreakPoint,
1401
+ ariaLabel = _a['aria-label'],
1402
+ _a$role = _a.role,
1403
+ role = _a$role === void 0 ? 'grid' : _a$role,
1404
+ innerRef = _a.innerRef,
1405
+ ouiaId = _a.ouiaId,
1406
+ _a$ouiaSafe = _a.ouiaSafe,
1407
+ ouiaSafe = _a$ouiaSafe === void 0 ? true : _a$ouiaSafe,
1408
+ _a$isTreeTable = _a.isTreeTable,
1409
+ isTreeTable = _a$isTreeTable === void 0 ? false : _a$isTreeTable,
1410
+ _a$isNested = _a.isNested,
1411
+ isNested = _a$isNested === void 0 ? false : _a$isNested,
1412
+ _a$isStriped = _a.isStriped,
1413
+ isStriped = _a$isStriped === void 0 ? false : _a$isStriped,
1414
+ _a$isExpandable = _a.isExpandable,
1415
+ isExpandable = _a$isExpandable === void 0 ? false : _a$isExpandable,
1416
+ _a$hasNoInset = _a.hasNoInset,
1417
+ hasNoInset = _a$hasNoInset === void 0 ? false : _a$hasNoInset,
1418
+ selectableRowCaptionText = _a.selectableRowCaptionText,
1419
+ props = __rest$1(_a, ["children", "className", "variant", "borders", "isStickyHeader", "gridBreakPoint", 'aria-label', "role", "innerRef", "ouiaId", "ouiaSafe", "isTreeTable", "isNested", "isStriped", "isExpandable", "hasNoInset", "nestedHeaderColumnSpans", "selectableRowCaptionText"]);
1420
+
1421
+ var ref = React__namespace.useRef(null);
1422
+ var tableRef = innerRef || ref;
1423
+
1424
+ var _React$useState = React__namespace.useState(false),
1425
+ hasSelectableRows = _React$useState[0],
1426
+ setHasSelectableRows = _React$useState[1];
1427
+
1428
+ var _React$useState2 = React__namespace.useState(),
1429
+ tableCaption = _React$useState2[0],
1430
+ setTableCaption = _React$useState2[1];
1431
+
1432
+ React__namespace.useEffect(function () {
1433
+ document.addEventListener('keydown', handleKeys); // sets up roving tab-index to tree tables only
1434
+
1435
+ if (tableRef && tableRef.current && tableRef.current.classList.contains('pf-m-tree-view')) {
1436
+ var tbody = tableRef.current.querySelector('tbody');
1437
+ tbody && reactCore.setTabIndex(Array.from(tbody.querySelectorAll('button, a, input')));
1438
+ }
1439
+
1440
+ return function cleanup() {
1441
+ document.removeEventListener('keydown', handleKeys);
1442
+ };
1443
+ }, [tableRef, tableRef.current]);
1444
+ React__namespace.useEffect(function () {
1445
+ if (selectableRowCaptionText) {
1446
+ setTableCaption(React__namespace.createElement("caption", null, selectableRowCaptionText, React__namespace.createElement("div", {
1447
+ className: "pf-v5-screen-reader"
1448
+ }, "This table has selectable rows. It can be navigated by row using tab, and each row can be selected using space or enter.")));
1449
+ } else {
1450
+ setTableCaption(React__namespace.createElement("caption", {
1451
+ className: "pf-v5-screen-reader"
1452
+ }, "This table has selectable rows. It can be navigated by row using tab, and each row can be selected using space or enter."));
1453
+ }
1454
+ }, [selectableRowCaptionText]);
1455
+ var ouiaProps = reactCore.useOUIAProps('Table', ouiaId, ouiaSafe);
1456
+ var grid = (_b = stylesGrid.modifiers) === null || _b === void 0 ? void 0 : _b[toCamel(gridBreakPoint || '').replace(/-?2xl/, '_2xl')];
1457
+ var breakPointPrefix = "treeView" + (gridBreakPoint.charAt(0).toUpperCase() + gridBreakPoint.slice(1));
1458
+ var treeGrid = (_c = treeViewStyles.modifiers) === null || _c === void 0 ? void 0 : _c[toCamel(breakPointPrefix || '').replace(/-?2xl/, '_2xl')];
1459
+
1460
+ var handleKeys = function handleKeys(event) {
1461
+ if (isNested || !(tableRef && tableRef.current && tableRef.current.classList.contains(treeViewStyles.modifiers.treeView)) || // implements roving tab-index to tree tables only
1462
+ tableRef && tableRef.current !== event.target.closest("." + styles$1.table + ":not(.pf-m-nested)")) {
1463
+ return;
1464
+ }
1465
+
1466
+ var activeElement = document.activeElement;
1467
+ var key = event.key;
1468
+ var rows = Array.from(tableRef.current.querySelectorAll('tbody tr')).filter(function (el) {
1469
+ return !el.classList.contains('pf-m-disabled') && !el.hidden;
1470
+ });
1471
+
1472
+ if (key === 'Space' || key === 'Enter') {
1473
+ activeElement.click();
1474
+ event.preventDefault();
1475
+ }
1476
+
1477
+ var getFocusableElement = function getFocusableElement(element) {
1478
+ return element.querySelectorAll('button:not(:disabled), input:not(:disabled), a:not(:disabled)')[0];
1479
+ };
1480
+
1481
+ reactCore.handleArrows(event, rows, function (element) {
1482
+ return element === activeElement.closest('tr');
1483
+ }, getFocusableElement, ['button', 'input', 'a'], undefined, false, true, false);
1484
+ };
1485
+
1486
+ var registerSelectableRow = function registerSelectableRow() {
1487
+ !hasSelectableRows && setHasSelectableRows(true);
1488
+ };
1489
+
1490
+ return React__namespace.createElement(TableContext.Provider, {
1491
+ value: {
1492
+ registerSelectableRow: registerSelectableRow
1493
+ }
1494
+ }, React__namespace.createElement("table", Object.assign({
1495
+ "aria-label": ariaLabel,
1496
+ role: role,
1497
+ className: css(className, styles$1.table, isTreeTable ? treeGrid : grid, styles$1.modifiers[variant], !borders && styles$1.modifiers.noBorderRows, isStickyHeader && styles$1.modifiers.stickyHeader, isTreeTable && treeViewStyles.modifiers.treeView, isStriped && styles$1.modifiers.striped, isExpandable && styles$1.modifiers.expandable, hasNoInset && treeViewStyles.modifiers.noInset, isNested && 'pf-m-nested'),
1498
+ ref: tableRef
1499
+ }, isTreeTable && {
1500
+ role: 'treegrid'
1501
+ }, ouiaProps, props), hasSelectableRows && tableCaption, children));
1502
+ };
1503
+
1504
+ var Table = React__namespace.forwardRef(function (props, ref) {
1505
+ return React__namespace.createElement(TableBase, Object.assign({}, props, {
1506
+ innerRef: ref
1507
+ }));
1508
+ });
1509
+ Table.displayName = 'Table';
1510
+
1511
+ var TrBase = function TrBase(_a) {
1512
+ var children = _a.children,
1513
+ className = _a.className,
1514
+ isExpanded = _a.isExpanded,
1515
+ isEditable = _a.isEditable,
1516
+ _a$isHidden = _a.isHidden,
1517
+ isHidden = _a$isHidden === void 0 ? false : _a$isHidden,
1518
+ _a$isClickable = _a.isClickable,
1519
+ isClickable = _a$isClickable === void 0 ? false : _a$isClickable,
1520
+ _a$isRowSelected = _a.isRowSelected,
1521
+ isRowSelected = _a$isRowSelected === void 0 ? false : _a$isRowSelected,
1522
+ _a$isStriped = _a.isStriped,
1523
+ isStriped = _a$isStriped === void 0 ? false : _a$isStriped,
1524
+ _a$isBorderRow = _a.isBorderRow,
1525
+ isBorderRow = _a$isBorderRow === void 0 ? false : _a$isBorderRow,
1526
+ innerRef = _a.innerRef,
1527
+ ouiaId = _a.ouiaId,
1528
+ _a$ouiaSafe = _a.ouiaSafe,
1529
+ ouiaSafe = _a$ouiaSafe === void 0 ? true : _a$ouiaSafe,
1530
+ _a$resetOffset = _a.resetOffset,
1531
+ resetOffset = _a$resetOffset === void 0 ? false : _a$resetOffset,
1532
+ onRowClick = _a.onRowClick,
1533
+ isSelectable = _a.isSelectable,
1534
+ passedAriaLabel = _a['aria-label'],
1535
+ props = __rest$1(_a, ["children", "className", "isExpanded", "isEditable", "isHidden", "isClickable", "isRowSelected", "isStriped", "isBorderRow", "innerRef", "ouiaId", "ouiaSafe", "resetOffset", "onRowClick", "isSelectable", 'aria-label']);
1536
+
1537
+ var ouiaProps = helpers.useOUIAProps('TableRow', ouiaId, ouiaSafe);
1538
+
1539
+ var _React$useState = React__namespace.useState(''),
1540
+ computedAriaLabel = _React$useState[0],
1541
+ setComputedAriaLabel = _React$useState[1];
1542
+
1543
+ var onKeyDown = null;
1544
+
1545
+ if (onRowClick) {
1546
+ onKeyDown = function onKeyDown(e) {
1547
+ if (e.key === 'Enter' || e.key === ' ') {
1548
+ onRowClick(e);
1549
+ e.preventDefault();
1550
+ }
1551
+ };
1552
+ }
1553
+
1554
+ var rowIsHidden = isHidden || isExpanded !== undefined && !isExpanded;
1555
+
1556
+ var _React$useContext = React__namespace.useContext(TableContext),
1557
+ registerSelectableRow = _React$useContext.registerSelectableRow;
1558
+
1559
+ React__namespace.useEffect(function () {
1560
+ if (isSelectable && !rowIsHidden) {
1561
+ setComputedAriaLabel("" + (isRowSelected ? 'Row selected' : ''));
1562
+ registerSelectableRow();
1563
+ } else {
1564
+ setComputedAriaLabel(undefined);
1565
+ }
1566
+ }, [isRowSelected, isSelectable, registerSelectableRow, rowIsHidden]);
1567
+ var ariaLabel = passedAriaLabel || computedAriaLabel;
1568
+ return React__namespace.createElement(React__namespace.Fragment, null, React__namespace.createElement("tr", Object.assign({
1569
+ className: css(styles$1.tableTr, className, isExpanded !== undefined && styles$1.tableExpandableRow, isExpanded && styles$1.modifiers.expanded, isEditable && inlineStyles.modifiers.inlineEditable, isClickable && styles$1.modifiers.clickable, isRowSelected && styles$1.modifiers.selected, isStriped && styles$1.modifiers.striped, isBorderRow && styles$1.modifiers.borderRow, resetOffset && styles$1.modifiers.firstCellOffsetReset),
1570
+ hidden: rowIsHidden
1571
+ }, isClickable && {
1572
+ tabIndex: 0
1573
+ }, {
1574
+ "aria-label": ariaLabel,
1575
+ ref: innerRef
1576
+ }, onRowClick && {
1577
+ onClick: onRowClick,
1578
+ onKeyDown: onKeyDown
1579
+ }, ouiaProps, props), children));
1580
+ };
1581
+
1582
+ var Tr = React__namespace.forwardRef(function (props, ref) {
1583
+ return React__namespace.createElement(TrBase, Object.assign({}, props, {
1584
+ innerRef: ref
1585
+ }));
1586
+ });
1587
+ Tr.displayName = 'Tr';
1588
+
1589
+ var TheadBase = function TheadBase(_a) {
1590
+ var children = _a.children,
1591
+ className = _a.className,
1592
+ _a$noWrap = _a.noWrap,
1593
+ noWrap = _a$noWrap === void 0 ? false : _a$noWrap,
1594
+ innerRef = _a.innerRef,
1595
+ hasNestedHeader = _a.hasNestedHeader,
1596
+ props = __rest$1(_a, ["children", "className", "noWrap", "innerRef", "hasNestedHeader"]);
1597
+
1598
+ return React__namespace.createElement("thead", Object.assign({
1599
+ className: css(styles$1.tableThead, className, noWrap && styles$1.modifiers.nowrap, hasNestedHeader && styles$1.modifiers.nestedColumnHeader),
1600
+ ref: innerRef
1601
+ }, props), children);
1602
+ };
1603
+
1604
+ var Thead = React__namespace.forwardRef(function (props, ref) {
1605
+ return React__namespace.createElement(TheadBase, Object.assign({}, props, {
1606
+ innerRef: ref
1607
+ }));
1608
+ });
1609
+ Thead.displayName = 'Thead';
1610
+
1611
+ var TbodyBase = function TbodyBase(_a) {
1612
+ var children = _a.children,
1613
+ className = _a.className,
1614
+ isExpanded = _a.isExpanded,
1615
+ innerRef = _a.innerRef,
1616
+ _a$isEvenStriped = _a.isEvenStriped,
1617
+ isEvenStriped = _a$isEvenStriped === void 0 ? false : _a$isEvenStriped,
1618
+ _a$isOddStriped = _a.isOddStriped,
1619
+ isOddStriped = _a$isOddStriped === void 0 ? false : _a$isOddStriped,
1620
+ props = __rest$1(_a, ["children", "className", "isExpanded", "innerRef", "isEvenStriped", "isOddStriped"]);
1621
+
1622
+ return React__namespace.createElement("tbody", Object.assign({
1623
+ role: "rowgroup",
1624
+ className: css(styles$1.tableTbody, className, isExpanded && styles$1.modifiers.expanded, isOddStriped && styles$1.modifiers.striped, isEvenStriped && styles$1.modifiers.stripedEven),
1625
+ ref: innerRef
1626
+ }, props), children);
1139
1627
  };
1140
1628
 
1141
- var visibilityModifiers = ['hidden', 'hiddenOnSm', 'hiddenOnMd', 'hiddenOnLg', 'hiddenOnXl', 'hiddenOn_2xl', 'visibleOnSm', 'visibleOnMd', 'visibleOnLg', 'visibleOnXl', 'visibleOn_2xl'];
1142
- var Visibility = visibilityModifiers.filter(function (key) {
1143
- return styles$1.modifiers[key];
1144
- }).reduce(function (acc, curr) {
1145
- var key2 = curr.replace('_2xl', '2Xl');
1146
- acc[key2] = styles$1.modifiers[curr];
1147
- return acc;
1148
- }, {});
1149
- var classNames = function classNames() {
1150
- var _arguments = arguments;
1151
- return function () {
1152
- return {
1153
- className: css.apply(void 0, [].slice.call(_arguments))
1154
- };
1155
- };
1629
+ var Tbody = React__namespace.forwardRef(function (props, ref) {
1630
+ return React__namespace.createElement(TbodyBase, Object.assign({}, props, {
1631
+ innerRef: ref
1632
+ }));
1633
+ });
1634
+ Tbody.displayName = 'Tbody';
1635
+
1636
+ var styles = {
1637
+ "modifiers": {
1638
+ "borderRight": "pf-m-border-right",
1639
+ "borderLeft": "pf-m-border-left",
1640
+ "right": "pf-m-right",
1641
+ "inlineEnd": "pf-m-inline-end",
1642
+ "left": "pf-m-left",
1643
+ "inlineStart": "pf-m-inline-start"
1644
+ },
1645
+ "scrollInnerWrapper": "pf-v5-c-scroll-inner-wrapper",
1646
+ "scrollOuterWrapper": "pf-v5-c-scroll-outer-wrapper",
1647
+ "table": "pf-v5-c-table",
1648
+ "tableStickyCell": "pf-v5-c-table__sticky-cell"
1156
1649
  };
1157
1650
 
1158
1651
  /**
@@ -1199,7 +1692,30 @@ function mergeProps() {
1199
1692
  }]));
1200
1693
  }
1201
1694
 
1695
+ var c_table__sticky_cell_MinWidth = {
1696
+ "name": "--pf-v5-c-table__sticky-cell--MinWidth",
1697
+ "value": "12.5rem",
1698
+ "var": "var(--pf-v5-c-table__sticky-cell--MinWidth)"
1699
+ };
1700
+ var cssStickyCellMinWidth = c_table__sticky_cell_MinWidth;
1701
+
1702
+ var c_table__sticky_cell_Left = {
1703
+ "name": "--pf-v5-c-table__sticky-cell--Left",
1704
+ "value": "0",
1705
+ "var": "var(--pf-v5-c-table__sticky-cell--Left)"
1706
+ };
1707
+ var cssStickyCellLeft = c_table__sticky_cell_Left;
1708
+
1709
+ var c_table__sticky_cell_Right = {
1710
+ "name": "--pf-v5-c-table__sticky-cell--Right",
1711
+ "value": "0",
1712
+ "var": "var(--pf-v5-c-table__sticky-cell--Right)"
1713
+ };
1714
+ var cssStickyCellRight = c_table__sticky_cell_Right;
1715
+
1202
1716
  var ThBase = function ThBase(_a) {
1717
+ var _Object$assign;
1718
+
1203
1719
  var children = _a.children,
1204
1720
  className = _a.className,
1205
1721
  _a$component = _a.component,
@@ -1218,6 +1734,7 @@ var ThBase = function ThBase(_a) {
1218
1734
  collapse = _a$expand === void 0 ? null : _a$expand,
1219
1735
  _a$tooltip = _a.tooltip,
1220
1736
  tooltip = _a$tooltip === void 0 ? '' : _a$tooltip,
1737
+ tooltipProps = _a.tooltipProps,
1221
1738
  _a$onMouseEnter = _a.onMouseEnter,
1222
1739
  onMouseEnterProp = _a$onMouseEnter === void 0 ? function () {} : _a$onMouseEnter,
1223
1740
  width = _a.width,
@@ -1228,417 +1745,151 @@ var ThBase = function ThBase(_a) {
1228
1745
  isStickyColumn = _a$isStickyColumn === void 0 ? false : _a$isStickyColumn,
1229
1746
  _a$hasRightBorder = _a.hasRightBorder,
1230
1747
  hasRightBorder = _a$hasRightBorder === void 0 ? false : _a$hasRightBorder,
1748
+ _a$hasLeftBorder = _a.hasLeftBorder,
1749
+ hasLeftBorder = _a$hasLeftBorder === void 0 ? false : _a$hasLeftBorder,
1231
1750
  _a$stickyMinWidth = _a.stickyMinWidth,
1232
1751
  stickyMinWidth = _a$stickyMinWidth === void 0 ? '120px' : _a$stickyMinWidth,
1233
1752
  stickyLeftOffset = _a.stickyLeftOffset,
1753
+ stickyRightOffset = _a.stickyRightOffset,
1234
1754
  _a$isSubheader = _a.isSubheader,
1235
1755
  isSubheader = _a$isSubheader === void 0 ? false : _a$isSubheader,
1236
- props = __rest(_a, ["children", "className", "component", "dataLabel", "scope", "textCenter", "sort", "modifier", "select", "expand", "tooltip", "onMouseEnter", "width", "visibility", "innerRef", "info", "isStickyColumn", "hasRightBorder", "stickyMinWidth", "stickyLeftOffset", "isSubheader"]);
1756
+ screenReaderText = _a.screenReaderText,
1757
+ ariaLabel = _a['aria-label'],
1758
+ props = __rest$1(_a, ["children", "className", "component", "dataLabel", "scope", "textCenter", "sort", "modifier", "select", "expand", "tooltip", "tooltipProps", "onMouseEnter", "width", "visibility", "innerRef", "info", "isStickyColumn", "hasRightBorder", "hasLeftBorder", "stickyMinWidth", "stickyLeftOffset", "stickyRightOffset", "isSubheader", "screenReaderText", 'aria-label']);
1759
+
1760
+ if (!children && !screenReaderText && !ariaLabel) {
1761
+ // eslint-disable-next-line no-console
1762
+ console.warn('Th: Table headers must have an accessible name. If the Th is intended to be visually empty, pass in screenReaderText. If the Th contains only non-text, interactive content such as a checkbox or expand toggle, pass in an aria-label.');
1763
+ }
1237
1764
 
1238
1765
  var _React$useState = React__namespace.useState(false),
1239
1766
  showTooltip = _React$useState[0],
1240
1767
  setShowTooltip = _React$useState[1];
1241
1768
 
1242
- var onMouseEnter = function onMouseEnter(event) {
1243
- if (event.target.offsetWidth < event.target.scrollWidth) {
1244
- !showTooltip && setShowTooltip(true);
1245
- } else {
1246
- showTooltip && setShowTooltip(false);
1247
- }
1248
-
1249
- onMouseEnterProp(event);
1250
- };
1251
-
1252
- var sortParams = null;
1253
-
1254
- if (sort) {
1255
- if (sort.isFavorites) {
1256
- sortParams = sortableFavorites({
1257
- onSort: sort === null || sort === void 0 ? void 0 : sort.onSort,
1258
- columnIndex: sort.columnIndex,
1259
- sortBy: sort.sortBy
1260
- })();
1261
- } else {
1262
- sortParams = sortable(children, {
1263
- columnIndex: sort.columnIndex,
1264
- column: {
1265
- extraParams: {
1266
- sortBy: sort.sortBy,
1267
- onSort: sort === null || sort === void 0 ? void 0 : sort.onSort
1268
- }
1269
- }
1270
- });
1271
- }
1272
- }
1273
-
1274
- var selectParams = select ? selectable(children, {
1275
- column: {
1276
- extraParams: {
1277
- onSelect: select === null || select === void 0 ? void 0 : select.onSelect,
1278
- selectVariant: 'checkbox',
1279
- allRowsSelected: select.isSelected,
1280
- isHeaderSelectDisabled: !!select.isHeaderSelectDisabled
1281
- }
1282
- }
1283
- }) : null;
1284
- var collapseParams = collapse ? collapsible(children, {
1285
- column: {
1286
- extraParams: {
1287
- onCollapse: collapse === null || collapse === void 0 ? void 0 : collapse.onToggle,
1288
- allRowsExpanded: !collapse.areAllExpanded,
1289
- collapseAllAriaLabel: ''
1290
- }
1291
- }
1292
- }) : null;
1293
- var widthParams = width ? cellWidth(width)() : null;
1294
- var visibilityParams = visibility ? classNames.apply(void 0, visibility.map(function (vis) {
1295
- return Visibility[vis];
1296
- }))() : null;
1297
- var transformedChildren = (sortParams === null || sortParams === void 0 ? void 0 : sortParams.children) || (selectParams === null || selectParams === void 0 ? void 0 : selectParams.children) || (collapseParams === null || collapseParams === void 0 ? void 0 : collapseParams.children) || children; // info can wrap other transformedChildren
1298
-
1299
- var infoParams = null;
1300
-
1301
- if (infoProps) {
1302
- infoParams = info(infoProps)(transformedChildren);
1303
- transformedChildren = infoParams.children;
1304
- }
1305
-
1306
- var merged = mergeProps(sortParams, selectParams, collapseParams, widthParams, visibilityParams, infoParams);
1307
-
1308
- var _merged$className = merged.className,
1309
- mergedClassName = _merged$className === void 0 ? '' : _merged$className,
1310
- _merged$component = merged.component,
1311
- MergedComponent = _merged$component === void 0 ? component : _merged$component,
1312
- mergedProps = __rest(merged, ["children", "isVisible", "className", "component"]);
1313
-
1314
- var cell = React__namespace.createElement(MergedComponent, Object.assign({
1315
- "data-label": dataLabel,
1316
- onMouseEnter: tooltip !== null ? onMouseEnter : onMouseEnterProp,
1317
- scope: component === 'th' && children ? scope : null,
1318
- ref: innerRef,
1319
- className: css(className, textCenter && styles$1.modifiers.center, isSubheader && styles$1.tableSubhead, isStickyColumn && styles.tableStickyColumn, hasRightBorder && styles.modifiers.borderRight, modifier && styles$1.modifiers[modifier], mergedClassName)
1320
- }, mergedProps, props, isStickyColumn && {
1321
- style: Object.assign({
1322
- '--pf-c-table__sticky-column--MinWidth': stickyMinWidth ? stickyMinWidth : undefined,
1323
- '--pf-c-table__sticky-column--Left': stickyLeftOffset ? stickyLeftOffset : undefined
1324
- }, props.style)
1325
- }), transformedChildren);
1326
- var canDefault = tooltip === '' ? typeof children === 'string' : true;
1327
- return tooltip !== null && canDefault && showTooltip ? React__namespace.createElement(Tooltip.Tooltip, {
1328
- content: tooltip || tooltip === '' && children,
1329
- isVisible: true
1330
- }, cell) : cell;
1331
- };
1332
-
1333
- var Th = React__namespace.forwardRef(function (props, ref) {
1334
- return React__namespace.createElement(ThBase, Object.assign({}, props, {
1335
- innerRef: ref
1336
- }));
1337
- });
1338
- Th.displayName = 'Th';
1339
-
1340
- var ActionsColumn = /*#__PURE__*/function (_React$Component) {
1341
- _inheritsLoose(ActionsColumn, _React$Component);
1342
-
1343
- function ActionsColumn(props) {
1344
- var _this;
1345
-
1346
- _this = _React$Component.call(this, props) || this;
1347
- _this.toggleRef = React__namespace.createRef();
1348
-
1349
- _this.onToggle = function (isOpen) {
1350
- _this.setState({
1351
- isOpen: isOpen
1352
- });
1353
- };
1354
-
1355
- _this.onClick = function (event, onClick) {
1356
- var _this$props = _this.props,
1357
- rowData = _this$props.rowData,
1358
- extraData = _this$props.extraData; // Only prevent default if onClick is provided. This allows href support.
1359
-
1360
- if (onClick) {
1361
- event.preventDefault(); // tslint:disable-next-line:no-unused-expression
1362
-
1363
- onClick(event, extraData && extraData.rowIndex, rowData, extraData);
1364
- }
1365
- };
1366
-
1367
- _this.state = {
1368
- isOpen: false
1369
- };
1370
- return _this;
1371
- }
1372
-
1373
- var _proto = ActionsColumn.prototype;
1374
-
1375
- _proto.render = function render() {
1376
- var _this2 = this;
1377
-
1378
- var isOpen = this.state.isOpen;
1379
- var _this$props2 = this.props,
1380
- items = _this$props2.items,
1381
- children = _this$props2.children,
1382
- dropdownPosition = _this$props2.dropdownPosition,
1383
- dropdownDirection = _this$props2.dropdownDirection,
1384
- isDisabled = _this$props2.isDisabled,
1385
- rowData = _this$props2.rowData,
1386
- actionsToggle = _this$props2.actionsToggle;
1387
- var actionsToggleClone = actionsToggle ? actionsToggle({
1388
- onToggle: this.onToggle,
1389
- isOpen: isOpen,
1390
- isDisabled: isDisabled
1391
- }) : React__namespace.createElement(KebabToggle.KebabToggle, {
1392
- isDisabled: isDisabled,
1393
- onToggle: this.onToggle
1394
- });
1395
- return React__namespace.createElement(React__namespace.Fragment, null, items.filter(function (item) {
1396
- return item.isOutsideDropdown;
1397
- }) // eslint-disable-next-line @typescript-eslint/no-unused-vars
1398
- .map(function (_a, key) {
1399
- var title = _a.title,
1400
- itemKey = _a.itemKey,
1401
- _onClick = _a.onClick,
1402
- props = __rest(_a, ["title", "itemKey", "onClick", "isOutsideDropdown"]);
1403
-
1404
- return typeof title === 'string' ? React__namespace.createElement(Button.Button, Object.assign({
1405
- onClick: function onClick(event) {
1406
- return _this2.onClick(event, _onClick);
1407
- }
1408
- }, props, {
1409
- isDisabled: isDisabled,
1410
- key: itemKey || "outside_dropdown_" + key,
1411
- "data-key": itemKey || "outside_dropdown_" + key
1412
- }), title) : React__namespace.cloneElement(title, Object.assign({
1413
- onClick: _onClick,
1414
- isDisabled: isDisabled
1415
- }, props));
1416
- }), React__namespace.createElement(Dropdown.Dropdown, Object.assign({
1417
- toggle: actionsToggleClone,
1418
- position: dropdownPosition,
1419
- direction: dropdownDirection,
1420
- isOpen: isOpen,
1421
- dropdownItems: items.filter(function (item) {
1422
- return !item.isOutsideDropdown;
1423
- }).map(function (_a, key) {
1424
- var title = _a.title,
1425
- itemKey = _a.itemKey,
1426
- _onClick2 = _a.onClick,
1427
- isSeparator = _a.isSeparator,
1428
- props = __rest(_a, ["title", "itemKey", "onClick", "isSeparator"]);
1429
-
1430
- return isSeparator ? React__namespace.createElement(DropdownSeparator.DropdownSeparator, Object.assign({}, props, {
1431
- key: itemKey || key,
1432
- "data-key": itemKey || key
1433
- })) : React__namespace.createElement(DropdownItem.DropdownItem, Object.assign({
1434
- component: "button",
1435
- onClick: function onClick(event) {
1436
- _this2.onClick(event, _onClick2);
1437
-
1438
- _this2.onToggle(!isOpen);
1439
- }
1440
- }, props, {
1441
- key: itemKey || key,
1442
- "data-key": itemKey || key
1443
- }), title);
1444
- }),
1445
- isPlain: true
1446
- }, rowData && rowData.actionProps)), children);
1447
- };
1448
-
1449
- return ActionsColumn;
1450
- }(React__namespace.Component);
1451
- ActionsColumn.displayName = 'ActionsColumn';
1452
- ActionsColumn.defaultProps = {
1453
- children: null,
1454
- items: [],
1455
- dropdownPosition: dropdownConstants.DropdownPosition.right,
1456
- dropdownDirection: dropdownConstants.DropdownDirection.down,
1457
- rowData: {},
1458
- extraData: {}
1459
- };
1460
-
1461
- var resolveOrDefault = function resolveOrDefault(resolver, defaultValue, rowData, extraData) {
1462
- return typeof resolver === 'function' ? resolver(rowData, extraData) : defaultValue;
1463
- };
1464
-
1465
- var cellActions = function cellActions(actions, actionResolver, areActionsDisabled) {
1466
- return function (label, _ref) {
1467
- var rowData = _ref.rowData,
1468
- column = _ref.column,
1469
- rowIndex = _ref.rowIndex,
1470
- columnIndex = _ref.columnIndex,
1471
- _ref$column$extraPara = _ref.column.extraParams,
1472
- dropdownPosition = _ref$column$extraPara.dropdownPosition,
1473
- dropdownDirection = _ref$column$extraPara.dropdownDirection,
1474
- actionsToggle = _ref$column$extraPara.actionsToggle,
1475
- property = _ref.property;
1476
- var extraData = {
1477
- rowIndex: rowIndex,
1478
- columnIndex: columnIndex,
1479
- column: column,
1480
- property: property
1481
- };
1482
- var resolvedActions = resolveOrDefault(actionResolver, actions, rowData, extraData);
1483
- var resolvedIsDisabled = resolveOrDefault(areActionsDisabled, rowData && rowData.disableActions, rowData, extraData);
1484
- var renderProps = resolvedActions && resolvedActions.length > 0 ? {
1485
- children: React__namespace.createElement(ActionsColumn, {
1486
- items: resolvedActions,
1487
- dropdownPosition: dropdownPosition,
1488
- dropdownDirection: dropdownDirection,
1489
- isDisabled: resolvedIsDisabled,
1490
- rowData: rowData,
1491
- extraData: extraData,
1492
- actionsToggle: actionsToggle
1493
- }, label)
1494
- } : {};
1495
- return Object.assign({
1496
- className: css(styles$1.tableAction),
1497
- style: {
1498
- paddingRight: 0
1499
- },
1500
- isVisible: true
1501
- }, renderProps);
1502
- };
1503
- };
1504
-
1505
- var compoundExpand = function compoundExpand(value, _ref) {
1506
- var rowIndex = _ref.rowIndex,
1507
- columnIndex = _ref.columnIndex,
1508
- rowData = _ref.rowData,
1509
- column = _ref.column,
1510
- property = _ref.property;
1511
-
1512
- if (!value) {
1513
- return null;
1514
- }
1515
-
1516
- var title = value.title,
1517
- props = value.props;
1518
- var onExpand = column.extraParams.onExpand;
1519
- var extraData = {
1520
- rowIndex: rowIndex,
1521
- columnIndex: columnIndex,
1522
- column: column,
1523
- property: property
1524
- };
1525
- /**
1526
- * @param {React.MouseEvent} event - Mouse event
1527
- */
1528
-
1529
- function onToggle(event) {
1530
- // tslint:disable-next-line:no-unused-expression
1531
- onExpand && onExpand(event, rowIndex, columnIndex, props.isOpen, rowData, extraData);
1532
- }
1533
-
1534
- return {
1535
- className: css(styles$1.tableCompoundExpansionToggle, props.isOpen && styles$1.modifiers.expanded),
1536
- children: props.isOpen !== undefined && React__namespace.createElement("button", {
1537
- type: "button",
1538
- className: css(styles$1.tableButton),
1539
- onClick: onToggle,
1540
- "aria-expanded": props.isOpen,
1541
- "aria-controls": props.ariaControls
1542
- }, React__namespace.createElement(TableText, null, title))
1543
- };
1544
- };
1769
+ var _React$useState2 = React__namespace.useState(false),
1770
+ truncated = _React$useState2[0],
1771
+ setTruncated = _React$useState2[1];
1545
1772
 
1546
- var FavoritesCell = function FavoritesCell(_a) {
1547
- var _a$className = _a.className,
1548
- className = _a$className === void 0 ? '' : _a$className,
1549
- onFavorite = _a.onFavorite,
1550
- isFavorited = _a.isFavorited,
1551
- rowIndex = _a.rowIndex,
1552
- props = __rest(_a, ["className", "onFavorite", "isFavorited", "rowIndex"]);
1773
+ var cellRef = innerRef ? innerRef : React__namespace.createRef();
1553
1774
 
1554
- var ariaProps = rowIndex === undefined ? {} : {
1555
- id: "favorites-button-" + rowIndex,
1556
- 'aria-labelledby': "favorites-button-" + rowIndex
1557
- };
1558
- return React__namespace.createElement(Button.Button, Object.assign({
1559
- variant: "plain",
1560
- className: className,
1561
- type: "button",
1562
- "aria-label": isFavorited ? 'Starred' : 'Not starred',
1563
- onClick: onFavorite
1564
- }, ariaProps, props), React__namespace.createElement(StarIcon$1, {
1565
- "aria-hidden": true
1566
- }));
1567
- };
1568
- FavoritesCell.displayName = 'FavoritesCell';
1775
+ var onMouseEnter = function onMouseEnter(event) {
1776
+ if (event.target.offsetWidth < event.target.scrollWidth) {
1777
+ !showTooltip && setShowTooltip(true);
1778
+ } else {
1779
+ showTooltip && setShowTooltip(false);
1780
+ }
1569
1781
 
1570
- var favoritable = function favoritable(value, _ref) {
1571
- var rowIndex = _ref.rowIndex,
1572
- columnIndex = _ref.columnIndex,
1573
- rowData = _ref.rowData,
1574
- column = _ref.column,
1575
- property = _ref.property;
1576
- var onFavorite = column.extraParams.onFavorite;
1577
- var extraData = {
1578
- rowIndex: rowIndex,
1579
- columnIndex: columnIndex,
1580
- column: column,
1581
- property: property
1582
- }; // this is a child row which should not display the favorites icon
1782
+ onMouseEnterProp(event);
1783
+ };
1583
1784
 
1584
- if (rowData && rowData.hasOwnProperty('parent') && !rowData.fullWidth) {
1585
- return {
1586
- component: 'td',
1587
- isVisible: true
1588
- };
1785
+ var sortParams = null;
1786
+
1787
+ if (sort) {
1788
+ if (sort.isFavorites) {
1789
+ sortParams = sortableFavorites({
1790
+ onSort: sort === null || sort === void 0 ? void 0 : sort.onSort,
1791
+ columnIndex: sort.columnIndex,
1792
+ sortBy: sort.sortBy,
1793
+ tooltip: tooltip,
1794
+ tooltipProps: tooltipProps
1795
+ })();
1796
+ } else {
1797
+ sortParams = sortable(children, {
1798
+ columnIndex: sort.columnIndex,
1799
+ column: {
1800
+ extraParams: {
1801
+ sortBy: sort.sortBy,
1802
+ onSort: sort === null || sort === void 0 ? void 0 : sort.onSort
1803
+ }
1804
+ },
1805
+ tooltip: tooltip,
1806
+ tooltipProps: tooltipProps
1807
+ });
1808
+ }
1589
1809
  }
1590
- /**
1591
- * @param {React.MouseEvent} event - Mouse event
1592
- */
1593
1810
 
1811
+ var selectParams = select ? selectable(children, {
1812
+ rowData: {
1813
+ selected: select.isSelected,
1814
+ disableSelection: select === null || select === void 0 ? void 0 : select.isDisabled,
1815
+ props: select === null || select === void 0 ? void 0 : select.props
1816
+ },
1817
+ column: {
1818
+ extraParams: {
1819
+ onSelect: select === null || select === void 0 ? void 0 : select.onSelect,
1820
+ selectVariant: 'checkbox',
1821
+ allRowsSelected: select.isSelected,
1822
+ isHeaderSelectDisabled: !!select.isHeaderSelectDisabled
1823
+ }
1824
+ },
1825
+ tooltip: tooltip,
1826
+ tooltipProps: tooltipProps
1827
+ }) : null;
1828
+ var collapseParams = collapse ? collapsible(children, {
1829
+ column: {
1830
+ extraParams: {
1831
+ onCollapse: collapse === null || collapse === void 0 ? void 0 : collapse.onToggle,
1832
+ allRowsExpanded: !collapse.areAllExpanded,
1833
+ collapseAllAriaLabel: ''
1834
+ }
1835
+ }
1836
+ }) : null;
1837
+ var widthParams = width ? cellWidth(width)() : null;
1838
+ var visibilityParams = visibility ? classNames.apply(void 0, visibility.map(function (vis) {
1839
+ return Visibility[vis];
1840
+ }))() : null;
1841
+ var transformedChildren = (sortParams === null || sortParams === void 0 ? void 0 : sortParams.children) || (selectParams === null || selectParams === void 0 ? void 0 : selectParams.children) || (collapseParams === null || collapseParams === void 0 ? void 0 : collapseParams.children) || children; // info can wrap other transformedChildren
1842
+
1843
+ var infoParams = null;
1594
1844
 
1595
- function favoritesClick(event) {
1596
- // tslint:disable-next-line:no-unused-expression
1597
- onFavorite && onFavorite(event, rowData && !rowData.favorited, rowIndex, rowData, extraData);
1845
+ if (infoProps) {
1846
+ infoParams = info(infoProps)(transformedChildren);
1847
+ transformedChildren = infoParams.children;
1598
1848
  }
1599
1849
 
1600
- var additionalProps = rowData.favoritesProps || {};
1601
- return {
1602
- className: css(styles$1.tableFavorite, rowData && rowData.favorited && styles$1.modifiers.favorited),
1603
- isVisible: !rowData || !rowData.fullWidth,
1604
- children: React__namespace.createElement(FavoritesCell, Object.assign({
1605
- rowIndex: rowIndex,
1606
- onFavorite: favoritesClick,
1607
- isFavorited: rowData && rowData.favorited
1608
- }, additionalProps))
1609
- };
1610
- };
1850
+ var merged = mergeProps(sortParams, selectParams, collapseParams, widthParams, visibilityParams, infoParams);
1611
1851
 
1612
- var GripVerticalIconConfig = {
1613
- name: 'GripVerticalIcon',
1614
- height: 512,
1615
- width: 320,
1616
- svgPath: 'M96 32H32C14.33 32 0 46.33 0 64v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32V64c0-17.67-14.33-32-32-32zm0 160H32c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32zm0 160H32c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32zM288 32h-64c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32V64c0-17.67-14.33-32-32-32zm0 160h-64c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32zm0 160h-64c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32z',
1617
- yOffset: 0,
1618
- xOffset: 0
1619
- };
1620
- var GripVerticalIcon = createIcon(GripVerticalIconConfig);
1621
- var GripVerticalIcon$1 = GripVerticalIcon;
1852
+ var _merged$className = merged.className,
1853
+ mergedClassName = _merged$className === void 0 ? '' : _merged$className,
1854
+ _merged$component = merged.component,
1855
+ MergedComponent = _merged$component === void 0 ? component : _merged$component,
1856
+ mergedProps = __rest$1(merged, ["children", "isVisible", "className", "component"]);
1622
1857
 
1623
- var DraggableCell = function DraggableCell(_a) {
1624
- var className = _a.className,
1625
- onClick = _a.onClick,
1626
- ariaLabel = _a['aria-label'],
1627
- id = _a.id,
1628
- props = __rest(_a, ["className", "onClick", 'aria-label', "id"]);
1858
+ React__namespace.useEffect(function () {
1859
+ setTruncated(cellRef.current.offsetWidth < cellRef.current.scrollWidth);
1860
+ }, [cellRef]);
1861
+ var cell = React__namespace.createElement(MergedComponent, Object.assign({
1862
+ tabIndex: sort || select || !truncated ? -1 : 0,
1863
+ onFocus: tooltip !== null ? onMouseEnter : onMouseEnterProp,
1864
+ onBlur: function onBlur() {
1865
+ return setShowTooltip(false);
1866
+ },
1867
+ "data-label": dataLabel,
1868
+ onMouseEnter: tooltip !== null ? onMouseEnter : onMouseEnterProp,
1869
+ scope: component === 'th' ? scope : null,
1870
+ ref: cellRef,
1871
+ "aria-label": ariaLabel,
1872
+ className: css(styles$1.tableTh, className, textCenter && styles$1.modifiers.center, isSubheader && styles$1.tableSubhead, isStickyColumn && styles.tableStickyCell, hasRightBorder && styles.modifiers.borderRight, hasLeftBorder && styles.modifiers.borderLeft, modifier && styles$1.modifiers[modifier], mergedClassName)
1873
+ }, mergedProps, props, isStickyColumn && {
1874
+ style: Object.assign((_Object$assign = {}, _Object$assign[cssStickyCellMinWidth.name] = stickyMinWidth ? stickyMinWidth : undefined, _Object$assign[cssStickyCellLeft.name] = stickyLeftOffset ? stickyLeftOffset : 0, _Object$assign[cssStickyCellRight.name] = stickyRightOffset ? stickyRightOffset : 0, _Object$assign), props.style)
1875
+ }), transformedChildren || screenReaderText && React__namespace.createElement("span", {
1876
+ className: "pf-v5-screen-reader"
1877
+ }, screenReaderText));
1878
+ var canMakeDefaultTooltip = tooltip === '' ? typeof transformedChildren === 'string' : true;
1879
+ var childControlsTooltip = sortParams || selectParams;
1880
+ return tooltip !== null && canMakeDefaultTooltip && !childControlsTooltip && showTooltip ? React__namespace.createElement(React__namespace.Fragment, null, cell, React__namespace.createElement(Tooltip.Tooltip, Object.assign({
1881
+ triggerRef: cellRef,
1882
+ content: tooltip || tooltip === '' && children,
1883
+ isVisible: true
1884
+ }, tooltipProps))) : cell;
1885
+ };
1629
1886
 
1630
- return React__namespace.createElement(Button.Button, Object.assign({
1631
- id: id,
1632
- variant: "plain",
1633
- className: className,
1634
- type: "button",
1635
- "aria-label": ariaLabel || "Draggable row draggable button",
1636
- onClick: onClick
1637
- }, props), React__namespace.createElement(GripVerticalIcon$1, {
1638
- "aria-hidden": true
1887
+ var Th = React__namespace.forwardRef(function (props, ref) {
1888
+ return React__namespace.createElement(ThBase, Object.assign({}, props, {
1889
+ innerRef: ref
1639
1890
  }));
1640
- };
1641
- DraggableCell.displayName = 'DraggableCell';
1891
+ });
1892
+ Th.displayName = 'Th';
1642
1893
 
1643
1894
  var draggable = function draggable(value, _ref) {
1644
1895
  var rowData = _ref.rowData;
@@ -1651,98 +1902,9 @@ var draggable = function draggable(value, _ref) {
1651
1902
  };
1652
1903
  };
1653
1904
 
1654
- var EllipsisHIconConfig = {
1655
- name: 'EllipsisHIcon',
1656
- height: 512,
1657
- width: 512,
1658
- svgPath: 'M328 256c0 39.8-32.2 72-72 72s-72-32.2-72-72 32.2-72 72-72 72 32.2 72 72zm104-72c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72zm-352 0c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72z',
1659
- yOffset: 0,
1660
- xOffset: 0
1661
- };
1662
- var EllipsisHIcon = createIcon(EllipsisHIconConfig);
1663
- var EllipsisHIcon$1 = EllipsisHIcon;
1664
-
1665
- var treeRow = function treeRow(onCollapse, onCheckChange, onToggleRowDetails) {
1666
- return function (value, _ref) {
1667
- var rowIndex = _ref.rowIndex,
1668
- rowData = _ref.rowData;
1669
- var _rowData$props = rowData.props,
1670
- isExpanded = _rowData$props.isExpanded,
1671
- isDetailsExpanded = _rowData$props.isDetailsExpanded,
1672
- level = _rowData$props['aria-level'],
1673
- setsize = _rowData$props['aria-setsize'],
1674
- toggleAriaLabel = _rowData$props.toggleAriaLabel,
1675
- checkAriaLabel = _rowData$props.checkAriaLabel,
1676
- showDetailsAriaLabel = _rowData$props.showDetailsAriaLabel,
1677
- isChecked = _rowData$props.isChecked,
1678
- checkboxId = _rowData$props.checkboxId,
1679
- icon = _rowData$props.icon;
1680
- var content = value.title || value;
1681
- var text = React__namespace.createElement("div", {
1682
- className: css(stylesTreeView.tableTreeViewText),
1683
- key: "tree-view-text"
1684
- }, icon && React__namespace.createElement("span", {
1685
- className: css(stylesTreeView.tableTreeViewIcon),
1686
- key: "tree-view-text-icon"
1687
- }, icon), React__namespace.createElement("span", {
1688
- className: "pf-c-table__text",
1689
- key: "table-text"
1690
- }, content));
1691
-
1692
- var onChange = function onChange(isChecked, event) {
1693
- onCheckChange(event, isChecked, rowIndex, content, rowData);
1694
- };
1695
-
1696
- return {
1697
- component: 'th',
1698
- className: 'pf-c-table__tree-view-title-cell',
1699
- children: level !== undefined ? React__namespace.createElement("div", {
1700
- className: css(stylesTreeView.tableTreeViewMain)
1701
- }, setsize > 0 && React__namespace.createElement("span", {
1702
- className: css(stylesTreeView.tableToggle),
1703
- key: "table-toggle"
1704
- }, React__namespace.createElement(reactCore.Button, {
1705
- variant: "plain",
1706
- onClick: function onClick(event) {
1707
- return onCollapse && onCollapse(event, rowIndex, content, rowData);
1708
- },
1709
- className: css(isExpanded && styles$1.modifiers.expanded),
1710
- "aria-expanded": isExpanded,
1711
- "aria-label": toggleAriaLabel || (isExpanded ? 'Collapse' : 'Expand') + " row " + rowIndex
1712
- }, React__namespace.createElement("div", {
1713
- className: css(stylesTreeView.tableToggleIcon)
1714
- }, React__namespace.createElement(AngleDownIcon$1, {
1715
- "aria-hidden": "true"
1716
- })))), !!onCheckChange && React__namespace.createElement("span", {
1717
- className: css(stylesTreeView.tableCheck),
1718
- key: "table-check"
1719
- }, React__namespace.createElement("label", {
1720
- htmlFor: checkboxId || "checkbox_" + rowIndex
1721
- }, React__namespace.createElement(reactCore.Checkbox, {
1722
- id: checkboxId || "checkbox_" + rowIndex,
1723
- "aria-label": checkAriaLabel || "Row " + rowIndex + " checkbox",
1724
- isChecked: isChecked,
1725
- onChange: onChange
1726
- }))), text, !!onToggleRowDetails && React__namespace.createElement("span", {
1727
- className: css(stylesTreeView.tableTreeViewDetailsToggle),
1728
- key: "view-details-toggle"
1729
- }, React__namespace.createElement(reactCore.Button, {
1730
- variant: "plain",
1731
- "aria-expanded": isDetailsExpanded,
1732
- "aria-label": showDetailsAriaLabel || 'Show row details',
1733
- onClick: function onClick(event) {
1734
- return onToggleRowDetails && onToggleRowDetails(event, rowIndex, content, rowData);
1735
- }
1736
- }, React__namespace.createElement("span", {
1737
- className: "pf-c-table__details-toggle-icon"
1738
- }, React__namespace.createElement(EllipsisHIcon$1, {
1739
- "aria-hidden": true
1740
- }))))) : text
1741
- };
1742
- };
1743
- };
1744
-
1745
1905
  var TdBase = function TdBase(_a) {
1906
+ var _Object$assign;
1907
+
1746
1908
  var children = _a.children,
1747
1909
  className = _a.className,
1748
1910
  _a$isActionCell = _a.isActionCell,
@@ -1771,13 +1933,47 @@ var TdBase = function TdBase(_a) {
1771
1933
  favorites = _a$favorites === void 0 ? null : _a$favorites,
1772
1934
  _a$draggableRow = _a.draggableRow,
1773
1935
  draggableRowProp = _a$draggableRow === void 0 ? null : _a$draggableRow,
1774
- props = __rest(_a, ["children", "className", "isActionCell", "component", "dataLabel", "textCenter", "modifier", "select", "actions", "expand", "treeRow", "compoundExpand", "noPadding", "width", "visibility", "innerRef", "favorites", "draggableRow"]);
1936
+ _a$tooltip = _a.tooltip,
1937
+ tooltip = _a$tooltip === void 0 ? '' : _a$tooltip,
1938
+ _a$onMouseEnter = _a.onMouseEnter,
1939
+ onMouseEnterProp = _a$onMouseEnter === void 0 ? function () {} : _a$onMouseEnter,
1940
+ _a$isStickyColumn = _a.isStickyColumn,
1941
+ isStickyColumn = _a$isStickyColumn === void 0 ? false : _a$isStickyColumn,
1942
+ _a$hasRightBorder = _a.hasRightBorder,
1943
+ hasRightBorder = _a$hasRightBorder === void 0 ? false : _a$hasRightBorder,
1944
+ _a$hasLeftBorder = _a.hasLeftBorder,
1945
+ hasLeftBorder = _a$hasLeftBorder === void 0 ? false : _a$hasLeftBorder,
1946
+ _a$stickyMinWidth = _a.stickyMinWidth,
1947
+ stickyMinWidth = _a$stickyMinWidth === void 0 ? '120px' : _a$stickyMinWidth,
1948
+ stickyLeftOffset = _a.stickyLeftOffset,
1949
+ stickyRightOffset = _a.stickyRightOffset,
1950
+ props = __rest$1(_a, ["children", "className", "isActionCell", "component", "dataLabel", "textCenter", "modifier", "select", "actions", "expand", "treeRow", "compoundExpand", "noPadding", "width", "visibility", "innerRef", "favorites", "draggableRow", "tooltip", "onMouseEnter", "isStickyColumn", "hasRightBorder", "hasLeftBorder", "stickyMinWidth", "stickyLeftOffset", "stickyRightOffset"]);
1951
+
1952
+ var _React$useState = React__namespace.useState(false),
1953
+ showTooltip = _React$useState[0],
1954
+ setShowTooltip = _React$useState[1];
1955
+
1956
+ var _React$useState2 = React__namespace.useState(false),
1957
+ truncated = _React$useState2[0],
1958
+ setTruncated = _React$useState2[1];
1959
+
1960
+ var cellRef = innerRef ? innerRef : React__namespace.createRef();
1961
+
1962
+ var onMouseEnter = function onMouseEnter(event) {
1963
+ if (event.target.offsetWidth < event.target.scrollWidth) {
1964
+ !showTooltip && setShowTooltip(true);
1965
+ } else {
1966
+ showTooltip && setShowTooltip(false);
1967
+ }
1968
+
1969
+ onMouseEnterProp(event);
1970
+ };
1775
1971
 
1776
1972
  var selectParams = select ? selectable(children, {
1777
1973
  rowIndex: select.rowIndex,
1778
1974
  rowData: {
1779
1975
  selected: select.isSelected,
1780
- disableSelection: select === null || select === void 0 ? void 0 : select.disable,
1976
+ disableSelection: select === null || select === void 0 ? void 0 : select.isDisabled,
1781
1977
  props: select === null || select === void 0 ? void 0 : select.props
1782
1978
  },
1783
1979
  column: {
@@ -1808,12 +2004,13 @@ var TdBase = function TdBase(_a) {
1808
2004
  var actionParams = actionParamsFunc ? actionParamsFunc(null, {
1809
2005
  rowIndex: actions === null || actions === void 0 ? void 0 : actions.rowIndex,
1810
2006
  rowData: {
1811
- disableActions: actions === null || actions === void 0 ? void 0 : actions.disable
2007
+ disableActions: actions === null || actions === void 0 ? void 0 : actions.isDisabled
1812
2008
  },
1813
2009
  column: {
1814
2010
  extraParams: {
1815
2011
  dropdownPosition: actions === null || actions === void 0 ? void 0 : actions.dropdownPosition,
1816
2012
  dropdownDirection: actions === null || actions === void 0 ? void 0 : actions.dropdownDirection,
2013
+ menuAppendTo: actions === null || actions === void 0 ? void 0 : actions.menuAppendTo,
1817
2014
  actionsToggle: actions === null || actions === void 0 ? void 0 : actions.actionsToggle
1818
2015
  }
1819
2016
  }
@@ -1826,7 +2023,8 @@ var TdBase = function TdBase(_a) {
1826
2023
  },
1827
2024
  column: {
1828
2025
  extraParams: {
1829
- onCollapse: expand === null || expand === void 0 ? void 0 : expand.onToggle
2026
+ onCollapse: expand === null || expand === void 0 ? void 0 : expand.onToggle,
2027
+ expandId: expand === null || expand === void 0 ? void 0 : expand.expandId
1830
2028
  }
1831
2029
  }
1832
2030
  }) : null;
@@ -1836,9 +2034,12 @@ var TdBase = function TdBase(_a) {
1836
2034
  isOpen: compoundExpandProp.isExpanded
1837
2035
  }
1838
2036
  }, {
2037
+ rowIndex: compoundExpandProp === null || compoundExpandProp === void 0 ? void 0 : compoundExpandProp.rowIndex,
2038
+ columnIndex: compoundExpandProp === null || compoundExpandProp === void 0 ? void 0 : compoundExpandProp.columnIndex,
1839
2039
  column: {
1840
2040
  extraParams: {
1841
- onExpand: compoundExpandProp === null || compoundExpandProp === void 0 ? void 0 : compoundExpandProp.onToggle
2041
+ onExpand: compoundExpandProp === null || compoundExpandProp === void 0 ? void 0 : compoundExpandProp.onToggle,
2042
+ expandId: compoundExpandProp === null || compoundExpandProp === void 0 ? void 0 : compoundExpandProp.expandId
1842
2043
  }
1843
2044
  }
1844
2045
  }) : null;
@@ -1862,15 +2063,33 @@ var TdBase = function TdBase(_a) {
1862
2063
  mergedClassName = _merged$className === void 0 ? '' : _merged$className,
1863
2064
  _merged$component = merged.component,
1864
2065
  MergedComponent = _merged$component === void 0 ? component : _merged$component,
1865
- mergedProps = __rest(merged, ["isVisible", "children", "className", "component"]);
2066
+ mergedProps = __rest$1(merged, ["isVisible", "children", "className", "component"]);
1866
2067
 
1867
- var treeTableTitleCell = className && className.includes('pf-c-table__tree-view-title-cell') || mergedClassName && mergedClassName.includes('pf-c-table__tree-view-title-cell');
1868
- return React__namespace.createElement(MergedComponent, Object.assign({}, !treeTableTitleCell && {
2068
+ var treeTableTitleCell = className && className.includes(treeViewStyles.tableTreeViewTitleCell) || mergedClassName && mergedClassName.includes(treeViewStyles.tableTreeViewTitleCell);
2069
+ React__namespace.useEffect(function () {
2070
+ setTruncated(cellRef.current.offsetWidth < cellRef.current.scrollWidth);
2071
+ }, [cellRef]);
2072
+ var cell = React__namespace.createElement(MergedComponent, Object.assign({
2073
+ tabIndex: (select || !truncated) && modifier !== 'truncate' ? -1 : 0
2074
+ }, !treeTableTitleCell && {
1869
2075
  'data-label': dataLabel
1870
2076
  }, {
1871
- className: css(className, isActionCell && styles$1.tableAction, textCenter && styles$1.modifiers.center, noPadding && styles$1.modifiers.noPadding, styles$1.modifiers[modifier], draggableParams && styles$1.tableDraggable, mergedClassName),
1872
- ref: innerRef
1873
- }, mergedProps, props), mergedChildren || children);
2077
+ onFocus: tooltip !== null ? onMouseEnter : onMouseEnterProp,
2078
+ onBlur: function onBlur() {
2079
+ return setShowTooltip(false);
2080
+ },
2081
+ onMouseEnter: tooltip !== null ? onMouseEnter : onMouseEnterProp,
2082
+ className: css(styles$1.tableTd, className, isActionCell && styles$1.tableAction, textCenter && styles$1.modifiers.center, noPadding && styles$1.modifiers.noPadding, isStickyColumn && styles.tableStickyCell, hasRightBorder && styles.modifiers.borderRight, hasLeftBorder && styles.modifiers.borderLeft, styles$1.modifiers[modifier], draggableParams && styles$1.tableDraggable, mergedClassName),
2083
+ ref: cellRef
2084
+ }, mergedProps, props, isStickyColumn && {
2085
+ style: Object.assign((_Object$assign = {}, _Object$assign[cssStickyCellMinWidth.name] = stickyMinWidth ? stickyMinWidth : undefined, _Object$assign[cssStickyCellLeft.name] = stickyLeftOffset ? stickyLeftOffset : 0, _Object$assign[cssStickyCellRight.name] = stickyRightOffset ? stickyRightOffset : 0, _Object$assign), props.style)
2086
+ }), mergedChildren || children);
2087
+ var canMakeDefaultTooltip = tooltip === '' ? typeof children === 'string' : true;
2088
+ return tooltip !== null && canMakeDefaultTooltip && showTooltip ? React__namespace.createElement(React__namespace.Fragment, null, cell, React__namespace.createElement(Tooltip$1.Tooltip, {
2089
+ triggerRef: cellRef,
2090
+ content: tooltip || tooltip === '' && children,
2091
+ isVisible: true
2092
+ })) : cell;
1874
2093
  };
1875
2094
 
1876
2095
  var Td = React__namespace.forwardRef(function (props, ref) {
@@ -2064,7 +2283,7 @@ function FilterableTable(_ref) {
2064
2283
  headingLevel: 'h3'
2065
2284
  }, React__default["default"].createElement(reactCore.Spinner, {
2066
2285
  size: 'lg'
2067
- })))) : React__default["default"].createElement(React__default["default"].Fragment, null, header, React__default["default"].createElement(TableComposable, {
2286
+ })))) : React__default["default"].createElement(React__default["default"].Fragment, null, header, React__default["default"].createElement(Table, {
2068
2287
  "aria-label": 'Packages Table'
2069
2288
  }, React__default["default"].createElement(Thead, null, React__default["default"].createElement(Tr, null, columns.map(function (col, colIdx) {
2070
2289
  return React__default["default"].createElement(Th, Object.assign({
@@ -2088,12 +2307,13 @@ function FilterableTable(_ref) {
2088
2307
  }));
2089
2308
  }) : React__default["default"].createElement(Tr, null, React__default["default"].createElement(Td, {
2090
2309
  colSpan: columns.length
2091
- }, React__default["default"].createElement(reactCore.EmptyState, null, React__default["default"].createElement(reactCore.EmptyStateIcon, {
2092
- icon: SearchIcon
2093
- }), React__default["default"].createElement(reactCore.Title, {
2094
- headingLevel: 'h5',
2095
- size: 'lg'
2096
- }, "No results found"))))))), renderPagination('bottom'));
2310
+ }, React__default["default"].createElement(reactCore.EmptyState, null, React__default["default"].createElement(reactCore.EmptyStateHeader, {
2311
+ titleText: 'No results found',
2312
+ icon: React__default["default"].createElement(reactCore.EmptyStateIcon, {
2313
+ icon: SearchIcon
2314
+ }),
2315
+ headingLevel: 'h5'
2316
+ }))))))), renderPagination('bottom'));
2097
2317
  }
2098
2318
 
2099
2319
  var FilterInput = function FilterInput(_ref) {
@@ -2204,7 +2424,7 @@ function EcoSelect(_ref) {
2204
2424
  selected = _useState2[0],
2205
2425
  setSelected = _useState2[1];
2206
2426
 
2207
- var onToggle = function onToggle(isOpen) {
2427
+ var _onToggle = function onToggle(isOpen) {
2208
2428
  return setIsOpen(isOpen);
2209
2429
  };
2210
2430
 
@@ -2219,18 +2439,20 @@ function EcoSelect(_ref) {
2219
2439
  var id = lodash.uniqueId('select-');
2220
2440
  return React__default["default"].createElement("div", {
2221
2441
  className: 'select'
2222
- }, React__default["default"].createElement(reactCore.Select, {
2442
+ }, React__default["default"].createElement(deprecated.Select, {
2223
2443
  id: id,
2224
2444
  variant: variant,
2225
2445
  "aria-label": ariaLabel,
2226
- onToggle: onToggle,
2446
+ onToggle: function onToggle(_event, isOpen) {
2447
+ return _onToggle(isOpen);
2448
+ },
2227
2449
  onSelect: onSelect,
2228
2450
  selections: selected,
2229
2451
  isOpen: isOpen,
2230
2452
  placeholderText: placeholderText,
2231
- className: "pf-select-wrapper"
2453
+ className: 'pf-select-wrapper'
2232
2454
  }, options.map(function (option) {
2233
- return React__default["default"].createElement(reactCore.SelectOption, {
2455
+ return React__default["default"].createElement(deprecated.SelectOption, {
2234
2456
  key: option,
2235
2457
  value: option
2236
2458
  });
@@ -2258,7 +2480,9 @@ var ToggleGroup = function ToggleGroup(props) {
2258
2480
  key: index,
2259
2481
  buttonId: option.id,
2260
2482
  isSelected: selected === option.id,
2261
- onChange: onClick
2483
+ onChange: function onChange(event, _) {
2484
+ return onClick(_, event);
2485
+ }
2262
2486
  });
2263
2487
  }));
2264
2488
  };