@rhc-shared-components/packages-table 0.3.2 → 0.3.4

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.
@@ -39,7 +39,7 @@ function __rest(s, e) {
39
39
  return t;
40
40
  }
41
41
 
42
- import('./inline-edit-5c45ab66.js');
42
+ import('./inline-edit-dea85160.js');
43
43
  var inlineStyles = {
44
44
  "button": "pf-c-button",
45
45
  "inlineEdit": "pf-c-inline-edit",
@@ -68,32 +68,32 @@ var inlineStyles = {
68
68
  * @param {any} args list of objects, string, or arrays to reduce
69
69
  */
70
70
  function css(...args) {
71
- // Adapted from https://github.com/JedWatson/classnames/blob/master/index.js
72
- const classes = [];
73
- const hasOwn = {}.hasOwnProperty;
74
- args.filter(Boolean).forEach((arg) => {
75
- const argType = typeof arg;
76
- if (argType === 'string' || argType === 'number') {
77
- classes.push(arg);
71
+ // Adapted from https://github.com/JedWatson/classnames/blob/master/index.js
72
+ const classes = [];
73
+ const hasOwn = {}.hasOwnProperty;
74
+ args.filter(Boolean).forEach(arg => {
75
+ const argType = typeof arg;
76
+
77
+ if (argType === 'string' || argType === 'number') {
78
+ classes.push(arg);
79
+ } else if (Array.isArray(arg) && arg.length) {
80
+ const inner = css(...arg);
81
+
82
+ if (inner) {
83
+ classes.push(inner);
84
+ }
85
+ } else if (argType === 'object') {
86
+ for (const key in arg) {
87
+ if (hasOwn.call(arg, key) && arg[key]) {
88
+ classes.push(key);
78
89
  }
79
- else if (Array.isArray(arg) && arg.length) {
80
- const inner = css(...arg);
81
- if (inner) {
82
- classes.push(inner);
83
- }
84
- }
85
- else if (argType === 'object') {
86
- for (const key in arg) {
87
- if (hasOwn.call(arg, key) && arg[key]) {
88
- classes.push(key);
89
- }
90
- }
91
- }
92
- });
93
- return classes.join(' ');
90
+ }
91
+ }
92
+ });
93
+ return classes.join(' ');
94
94
  }
95
95
 
96
- import('./table-76f2f3f9.js');
96
+ import('./table-68d022f9.js');
97
97
  var styles$1 = {
98
98
  "button": "pf-c-button",
99
99
  "modifiers": {
@@ -174,7 +174,7 @@ var styles$1 = {
174
174
  "themeDark": "pf-theme-dark"
175
175
  };
176
176
 
177
- import('./table-grid-06209f24.js');
177
+ import('./table-grid-5f08beb3.js');
178
178
  var stylesGrid = {
179
179
  "button": "pf-c-button",
180
180
  "modifiers": {
@@ -207,7 +207,7 @@ var stylesGrid = {
207
207
  "tableToggleIcon": "pf-c-table__toggle-icon"
208
208
  };
209
209
 
210
- import('./table-tree-view-121a2cdb.js');
210
+ import('./table-tree-view-c9374e2e.js');
211
211
  var stylesTreeView = {
212
212
  "dropdown": "pf-c-dropdown",
213
213
  "modifiers": {
@@ -232,142 +232,250 @@ var stylesTreeView = {
232
232
  "tableTreeViewTitleHeaderCell": "pf-c-table__tree-view-title-header-cell"
233
233
  };
234
234
 
235
- const camelize = (s) => s
236
- .toUpperCase()
237
- .replace('-', '')
238
- .replace('_', '');
239
- const toCamel = (s) => s.replace(/([-_][a-z])/gi, camelize);
235
+ const camelize = s => s.toUpperCase().replace('-', '').replace('_', '');
236
+
237
+ const toCamel = s => s.replace(/([-_][a-z])/gi, camelize);
240
238
  /**
241
239
  * @param {string} input - String to capitalize
242
240
  */
241
+
243
242
  function capitalize(input) {
244
- return input[0].toUpperCase() + input.substring(1);
243
+ return input[0].toUpperCase() + input.substring(1);
245
244
  }
246
245
 
247
246
  var TableGridBreakpoint;
247
+
248
248
  (function (TableGridBreakpoint) {
249
- TableGridBreakpoint["none"] = "";
250
- TableGridBreakpoint["grid"] = "grid";
251
- TableGridBreakpoint["gridMd"] = "grid-md";
252
- TableGridBreakpoint["gridLg"] = "grid-lg";
253
- TableGridBreakpoint["gridXl"] = "grid-xl";
254
- TableGridBreakpoint["grid2xl"] = "grid-2xl";
249
+ TableGridBreakpoint["none"] = "";
250
+ TableGridBreakpoint["grid"] = "grid";
251
+ TableGridBreakpoint["gridMd"] = "grid-md";
252
+ TableGridBreakpoint["gridLg"] = "grid-lg";
253
+ TableGridBreakpoint["gridXl"] = "grid-xl";
254
+ TableGridBreakpoint["grid2xl"] = "grid-2xl";
255
255
  })(TableGridBreakpoint || (TableGridBreakpoint = {}));
256
+
256
257
  var TableVariant;
258
+
257
259
  (function (TableVariant) {
258
- TableVariant["compact"] = "compact";
260
+ TableVariant["compact"] = "compact";
259
261
  })(TableVariant || (TableVariant = {}));
260
262
 
261
263
  const TableComposableContext = React.createContext({
262
- registerSelectableRow: () => { }
264
+ registerSelectableRow: () => {}
263
265
  });
264
- const TableComposableBase = (_a) => {
265
- var _b, _c;
266
- var { children, className, variant, borders = true, isStickyHeader = false, gridBreakPoint = TableGridBreakpoint.gridMd, 'aria-label': ariaLabel, role = 'grid', innerRef, ouiaId, ouiaSafe = true, isTreeTable = false, isNested = false, isStriped = false, isExpandable = false,
266
+
267
+ const TableComposableBase = _a => {
268
+ var _b, _c;
269
+
270
+ var {
271
+ children,
272
+ className,
273
+ variant,
274
+ borders = true,
275
+ isStickyHeader = false,
276
+ gridBreakPoint = TableGridBreakpoint.gridMd,
277
+ 'aria-label': ariaLabel,
278
+ role = 'grid',
279
+ innerRef,
280
+ ouiaId,
281
+ ouiaSafe = true,
282
+ isTreeTable = false,
283
+ isNested = false,
284
+ isStriped = false,
285
+ isExpandable = false,
267
286
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
268
- nestedHeaderColumnSpans, hasSelectableRowCaption, selectableRowCaptionText } = _a, props = __rest(_a, ["children", "className", "variant", "borders", "isStickyHeader", "gridBreakPoint", 'aria-label', "role", "innerRef", "ouiaId", "ouiaSafe", "isTreeTable", "isNested", "isStriped", "isExpandable", "nestedHeaderColumnSpans", "hasSelectableRowCaption", "selectableRowCaptionText"]);
269
- const tableRef = innerRef || React.useRef(null);
270
- const [hasSelectableRows, setHasSelectableRows] = React.useState(false);
271
- const [tableCaption, setTableCaption] = React.useState();
272
- React.useEffect(() => {
273
- document.addEventListener('keydown', handleKeys);
274
- // sets up roving tab-index to tree tables only
275
- if (tableRef && tableRef.current && tableRef.current.classList.contains('pf-m-tree-view')) {
276
- const tbody = tableRef.current.querySelector('tbody');
277
- tbody && setTabIndex(Array.from(tbody.querySelectorAll('button, a, input')));
278
- }
279
- return function cleanup() {
280
- document.removeEventListener('keydown', handleKeys);
281
- };
282
- }, [tableRef, tableRef.current]);
283
- React.useEffect(() => {
284
- if (selectableRowCaptionText) {
285
- setTableCaption(React.createElement("caption", null,
286
- selectableRowCaptionText,
287
- React.createElement("div", { className: "pf-screen-reader" }, "This table has selectable rows. It can be navigated by row using tab, and each row can be selected using space or enter.")));
288
- }
289
- else {
290
- setTableCaption(React.createElement("caption", { className: "pf-screen-reader" }, "This table has selectable rows. It can be navigated by row using tab, and each row can be selected using space or enter."));
291
- }
292
- }, [selectableRowCaptionText]);
293
- const ouiaProps = useOUIAProps('Table', ouiaId, ouiaSafe);
294
- const grid = (_b = stylesGrid.modifiers) === null || _b === void 0 ? void 0 : _b[toCamel(gridBreakPoint || '').replace(/-?2xl/, '_2xl')];
295
- const breakPointPrefix = `treeView${gridBreakPoint.charAt(0).toUpperCase() + gridBreakPoint.slice(1)}`;
296
- const treeGrid = (_c = stylesTreeView.modifiers) === null || _c === void 0 ? void 0 : _c[toCamel(breakPointPrefix || '').replace(/-?2xl/, '_2xl')];
297
- const handleKeys = (event) => {
298
- if (isNested ||
299
- !(tableRef && tableRef.current && tableRef.current.classList.contains('pf-m-tree-view')) || // implements roving tab-index to tree tables only
300
- (tableRef && tableRef.current !== event.target.closest('.pf-c-table:not(.pf-m-nested)'))) {
301
- return;
302
- }
303
- const activeElement = document.activeElement;
304
- const key = event.key;
305
- const rows = Array.from(tableRef.current.querySelectorAll('tbody tr')).filter(el => !el.classList.contains('pf-m-disabled') && !el.hidden);
306
- if (key === 'Space' || key === 'Enter') {
307
- activeElement.click();
308
- event.preventDefault();
309
- }
310
- const getFocusableElement = (element) => element.querySelectorAll('button:not(:disabled), input:not(:disabled), a:not(:disabled)')[0];
311
- handleArrows(event, rows, (element) => element === activeElement.closest('tr'), getFocusableElement, ['button', 'input', 'a'], undefined, false, true, false);
312
- };
313
- const registerSelectableRow = () => {
314
- !hasSelectableRows && setHasSelectableRows(true);
287
+ nestedHeaderColumnSpans,
288
+ hasSelectableRowCaption,
289
+ selectableRowCaptionText
290
+ } = _a,
291
+ props = __rest(_a, ["children", "className", "variant", "borders", "isStickyHeader", "gridBreakPoint", 'aria-label', "role", "innerRef", "ouiaId", "ouiaSafe", "isTreeTable", "isNested", "isStriped", "isExpandable", "nestedHeaderColumnSpans", "hasSelectableRowCaption", "selectableRowCaptionText"]);
292
+
293
+ const tableRef = innerRef || React.useRef(null);
294
+ const [hasSelectableRows, setHasSelectableRows] = React.useState(false);
295
+ const [tableCaption, setTableCaption] = React.useState();
296
+ React.useEffect(() => {
297
+ document.addEventListener('keydown', handleKeys); // sets up roving tab-index to tree tables only
298
+
299
+ if (tableRef && tableRef.current && tableRef.current.classList.contains('pf-m-tree-view')) {
300
+ const tbody = tableRef.current.querySelector('tbody');
301
+ tbody && setTabIndex(Array.from(tbody.querySelectorAll('button, a, input')));
302
+ }
303
+
304
+ return function cleanup() {
305
+ document.removeEventListener('keydown', handleKeys);
315
306
  };
316
- return (React.createElement(TableComposableContext.Provider, { value: { registerSelectableRow } },
317
- React.createElement("table", Object.assign({ "aria-label": ariaLabel, role: role, 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'), ref: tableRef }, (isTreeTable && { role: 'treegrid' }), ouiaProps, props),
318
- hasSelectableRowCaption && hasSelectableRows && tableCaption,
319
- children)));
307
+ }, [tableRef, tableRef.current]);
308
+ React.useEffect(() => {
309
+ if (selectableRowCaptionText) {
310
+ setTableCaption(React.createElement("caption", null, selectableRowCaptionText, React.createElement("div", {
311
+ className: "pf-screen-reader"
312
+ }, "This table has selectable rows. It can be navigated by row using tab, and each row can be selected using space or enter.")));
313
+ } else {
314
+ setTableCaption(React.createElement("caption", {
315
+ className: "pf-screen-reader"
316
+ }, "This table has selectable rows. It can be navigated by row using tab, and each row can be selected using space or enter."));
317
+ }
318
+ }, [selectableRowCaptionText]);
319
+ const ouiaProps = useOUIAProps('Table', ouiaId, ouiaSafe);
320
+ const grid = (_b = stylesGrid.modifiers) === null || _b === void 0 ? void 0 : _b[toCamel(gridBreakPoint || '').replace(/-?2xl/, '_2xl')];
321
+ const breakPointPrefix = `treeView${gridBreakPoint.charAt(0).toUpperCase() + gridBreakPoint.slice(1)}`;
322
+ const treeGrid = (_c = stylesTreeView.modifiers) === null || _c === void 0 ? void 0 : _c[toCamel(breakPointPrefix || '').replace(/-?2xl/, '_2xl')];
323
+
324
+ const handleKeys = event => {
325
+ if (isNested || !(tableRef && tableRef.current && tableRef.current.classList.contains('pf-m-tree-view')) || // implements roving tab-index to tree tables only
326
+ tableRef && tableRef.current !== event.target.closest('.pf-c-table:not(.pf-m-nested)')) {
327
+ return;
328
+ }
329
+
330
+ const activeElement = document.activeElement;
331
+ const key = event.key;
332
+ const rows = Array.from(tableRef.current.querySelectorAll('tbody tr')).filter(el => !el.classList.contains('pf-m-disabled') && !el.hidden);
333
+
334
+ if (key === 'Space' || key === 'Enter') {
335
+ activeElement.click();
336
+ event.preventDefault();
337
+ }
338
+
339
+ const getFocusableElement = element => element.querySelectorAll('button:not(:disabled), input:not(:disabled), a:not(:disabled)')[0];
340
+
341
+ handleArrows(event, rows, element => element === activeElement.closest('tr'), getFocusableElement, ['button', 'input', 'a'], undefined, false, true, false);
342
+ };
343
+
344
+ const registerSelectableRow = () => {
345
+ !hasSelectableRows && setHasSelectableRows(true);
346
+ };
347
+
348
+ return React.createElement(TableComposableContext.Provider, {
349
+ value: {
350
+ registerSelectableRow
351
+ }
352
+ }, React.createElement("table", Object.assign({
353
+ "aria-label": ariaLabel,
354
+ role: role,
355
+ 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'),
356
+ ref: tableRef
357
+ }, isTreeTable && {
358
+ role: 'treegrid'
359
+ }, ouiaProps, props), hasSelectableRowCaption && hasSelectableRows && tableCaption, children));
320
360
  };
321
- const TableComposable = React.forwardRef((props, ref) => (React.createElement(TableComposableBase, Object.assign({}, props, { innerRef: ref }))));
361
+
362
+ const TableComposable = React.forwardRef((props, ref) => React.createElement(TableComposableBase, Object.assign({}, props, {
363
+ innerRef: ref
364
+ })));
322
365
  TableComposable.displayName = 'TableComposable';
323
366
 
324
- const TheadBase = (_a) => {
325
- var { children, className, noWrap = false, innerRef, hasNestedHeader } = _a, props = __rest(_a, ["children", "className", "noWrap", "innerRef", "hasNestedHeader"]);
326
- return (React.createElement("thead", Object.assign({ className: css(className, noWrap && styles$1.modifiers.nowrap, hasNestedHeader && styles$1.modifiers.nestedColumnHeader), ref: innerRef }, props), children));
367
+ const TheadBase = _a => {
368
+ var {
369
+ children,
370
+ className,
371
+ noWrap = false,
372
+ innerRef,
373
+ hasNestedHeader
374
+ } = _a,
375
+ props = __rest(_a, ["children", "className", "noWrap", "innerRef", "hasNestedHeader"]);
376
+
377
+ return React.createElement("thead", Object.assign({
378
+ className: css(className, noWrap && styles$1.modifiers.nowrap, hasNestedHeader && styles$1.modifiers.nestedColumnHeader),
379
+ ref: innerRef
380
+ }, props), children);
327
381
  };
328
- const Thead = React.forwardRef((props, ref) => (React.createElement(TheadBase, Object.assign({}, props, { innerRef: ref }))));
382
+
383
+ const Thead = React.forwardRef((props, ref) => React.createElement(TheadBase, Object.assign({}, props, {
384
+ innerRef: ref
385
+ })));
329
386
  Thead.displayName = 'Thead';
330
387
 
331
- const TbodyBase = (_a) => {
332
- var { children, className, isExpanded, innerRef, isEvenStriped = false, isOddStriped = false } = _a, props = __rest(_a, ["children", "className", "isExpanded", "innerRef", "isEvenStriped", "isOddStriped"]);
333
- return (React.createElement("tbody", Object.assign({ role: "rowgroup", className: css(className, isExpanded && styles$1.modifiers.expanded, isOddStriped && styles$1.modifiers.striped, isEvenStriped && styles$1.modifiers.stripedEven), ref: innerRef }, props), children));
388
+ const TbodyBase = _a => {
389
+ var {
390
+ children,
391
+ className,
392
+ isExpanded,
393
+ innerRef,
394
+ isEvenStriped = false,
395
+ isOddStriped = false
396
+ } = _a,
397
+ props = __rest(_a, ["children", "className", "isExpanded", "innerRef", "isEvenStriped", "isOddStriped"]);
398
+
399
+ return React.createElement("tbody", Object.assign({
400
+ role: "rowgroup",
401
+ className: css(className, isExpanded && styles$1.modifiers.expanded, isOddStriped && styles$1.modifiers.striped, isEvenStriped && styles$1.modifiers.stripedEven),
402
+ ref: innerRef
403
+ }, props), children);
334
404
  };
335
- const Tbody = React.forwardRef((props, ref) => (React.createElement(TbodyBase, Object.assign({}, props, { innerRef: ref }))));
405
+
406
+ const Tbody = React.forwardRef((props, ref) => React.createElement(TbodyBase, Object.assign({}, props, {
407
+ innerRef: ref
408
+ })));
336
409
  Tbody.displayName = 'Tbody';
337
410
 
338
- const TrBase = (_a) => {
339
- var { children, className, isExpanded, isEditable, isHidden = false, isHoverable = false, isRowSelected = false, isStriped = false, innerRef, ouiaId, ouiaSafe = true, resetOffset = false, onRowClick, isSelectable, 'aria-label': passedAriaLabel } = _a, props = __rest(_a, ["children", "className", "isExpanded", "isEditable", "isHidden", "isHoverable", "isRowSelected", "isStriped", "innerRef", "ouiaId", "ouiaSafe", "resetOffset", "onRowClick", "isSelectable", 'aria-label']);
340
- const ouiaProps = useOUIAProps('TableRow', ouiaId, ouiaSafe);
341
- const [computedAriaLabel, setComputedAriaLabel] = React.useState('');
342
- let onKeyDown = null;
343
- if (onRowClick) {
344
- onKeyDown = (e) => {
345
- if (e.key === 'Enter' || e.key === ' ') {
346
- onRowClick(e);
347
- e.preventDefault();
348
- }
349
- };
411
+ const TrBase = _a => {
412
+ var {
413
+ children,
414
+ className,
415
+ isExpanded,
416
+ isEditable,
417
+ isHidden = false,
418
+ isHoverable = false,
419
+ isRowSelected = false,
420
+ isStriped = false,
421
+ innerRef,
422
+ ouiaId,
423
+ ouiaSafe = true,
424
+ resetOffset = false,
425
+ onRowClick,
426
+ isSelectable,
427
+ 'aria-label': passedAriaLabel
428
+ } = _a,
429
+ props = __rest(_a, ["children", "className", "isExpanded", "isEditable", "isHidden", "isHoverable", "isRowSelected", "isStriped", "innerRef", "ouiaId", "ouiaSafe", "resetOffset", "onRowClick", "isSelectable", 'aria-label']);
430
+
431
+ const ouiaProps = useOUIAProps('TableRow', ouiaId, ouiaSafe);
432
+ const [computedAriaLabel, setComputedAriaLabel] = React.useState('');
433
+ let onKeyDown = null;
434
+
435
+ if (onRowClick) {
436
+ onKeyDown = e => {
437
+ if (e.key === 'Enter' || e.key === ' ') {
438
+ onRowClick(e);
439
+ e.preventDefault();
440
+ }
441
+ };
442
+ }
443
+
444
+ const rowIsHidden = isHidden || isExpanded !== undefined && !isExpanded;
445
+ const {
446
+ registerSelectableRow
447
+ } = React.useContext(TableComposableContext);
448
+ React.useEffect(() => {
449
+ if (isSelectable && !rowIsHidden) {
450
+ setComputedAriaLabel(`${isRowSelected ? 'Selected' : 'Unselected'}, selectable row.`);
451
+ registerSelectableRow();
452
+ } else {
453
+ setComputedAriaLabel(undefined);
350
454
  }
351
- const rowIsHidden = isHidden || (isExpanded !== undefined && !isExpanded);
352
- const { registerSelectableRow } = React.useContext(TableComposableContext);
353
- React.useEffect(() => {
354
- if (isSelectable && !rowIsHidden) {
355
- setComputedAriaLabel(`${isRowSelected ? 'Selected' : 'Unselected'}, selectable row.`);
356
- registerSelectableRow();
357
- }
358
- else {
359
- setComputedAriaLabel(undefined);
360
- }
361
- }, [isRowSelected, isSelectable, registerSelectableRow, rowIsHidden]);
362
- const ariaLabel = passedAriaLabel || computedAriaLabel;
363
- return (React.createElement(React.Fragment, null,
364
- isSelectable && React.createElement("output", { className: "pf-screen-reader" }, ariaLabel),
365
- React.createElement("tr", Object.assign({ 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), hidden: rowIsHidden }, (isHoverable && { tabIndex: 0 }), { "aria-label": ariaLabel, ref: innerRef }, (onRowClick && { onClick: onRowClick, onKeyDown }), ouiaProps, props), children)));
455
+ }, [isRowSelected, isSelectable, registerSelectableRow, rowIsHidden]);
456
+ const ariaLabel = passedAriaLabel || computedAriaLabel;
457
+ return React.createElement(React.Fragment, null, isSelectable && React.createElement("output", {
458
+ className: "pf-screen-reader"
459
+ }, ariaLabel), React.createElement("tr", Object.assign({
460
+ 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),
461
+ hidden: rowIsHidden
462
+ }, isHoverable && {
463
+ tabIndex: 0
464
+ }, {
465
+ "aria-label": ariaLabel,
466
+ ref: innerRef
467
+ }, onRowClick && {
468
+ onClick: onRowClick,
469
+ onKeyDown
470
+ }, ouiaProps, props), children));
366
471
  };
367
- const Tr = React.forwardRef((props, ref) => (React.createElement(TrBase, Object.assign({}, props, { innerRef: ref }))));
472
+
473
+ const Tr = React.forwardRef((props, ref) => React.createElement(TrBase, Object.assign({}, props, {
474
+ innerRef: ref
475
+ })));
368
476
  Tr.displayName = 'Tr';
369
477
 
370
- import('./table-scrollable-5eeb1c66.js');
478
+ import('./table-scrollable-08a401e0.js');
371
479
  var styles = {
372
480
  "modifiers": {
373
481
  "borderRight": "pf-m-border-right",
@@ -380,57 +488,92 @@ var styles = {
380
488
  "tableStickyColumn": "pf-c-table__sticky-column"
381
489
  };
382
490
 
383
- var IconSize$1;
491
+ var IconSize;
492
+
384
493
  (function (IconSize) {
385
- IconSize["sm"] = "sm";
386
- IconSize["md"] = "md";
387
- IconSize["lg"] = "lg";
388
- IconSize["xl"] = "xl";
389
- })(IconSize$1 || (IconSize$1 = {}));
390
- const getSize$1 = (size) => {
391
- switch (size) {
392
- case IconSize$1.sm:
393
- return '1em';
394
- case IconSize$1.md:
395
- return '1.5em';
396
- case IconSize$1.lg:
397
- return '2em';
398
- case IconSize$1.xl:
399
- return '3em';
400
- default:
401
- return '1em';
402
- }
494
+ IconSize["sm"] = "sm";
495
+ IconSize["md"] = "md";
496
+ IconSize["lg"] = "lg";
497
+ IconSize["xl"] = "xl";
498
+ })(IconSize || (IconSize = {}));
499
+
500
+ const getSize = size => {
501
+ switch (size) {
502
+ case IconSize.sm:
503
+ return '1em';
504
+
505
+ case IconSize.md:
506
+ return '1.5em';
507
+
508
+ case IconSize.lg:
509
+ return '2em';
510
+
511
+ case IconSize.xl:
512
+ return '3em';
513
+
514
+ default:
515
+ return '1em';
516
+ }
403
517
  };
404
- let currentId$1 = 0;
518
+ let currentId = 0;
405
519
  /**
406
520
  * Factory to create Icon class components for consumers
407
521
  */
408
- function createIcon$1({ name, xOffset = 0, yOffset = 0, width, height, svgPath }) {
409
- var _a;
410
- return _a = class SVGIcon extends React.Component {
411
- constructor() {
412
- super(...arguments);
413
- this.id = `icon-title-${currentId$1++}`;
414
- }
415
- render() {
416
- const _a = this.props, { size, color, title, noVerticalAlign } = _a, props = __rest(_a, ["size", "color", "title", "noVerticalAlign"]);
417
- const hasTitle = Boolean(title);
418
- const heightWidth = getSize$1(size);
419
- const baseAlign = -0.125 * Number.parseFloat(heightWidth);
420
- const style = noVerticalAlign ? null : { verticalAlign: `${baseAlign}em` };
421
- const viewBox = [xOffset, yOffset, width, height].join(' ');
422
- return (React.createElement("svg", Object.assign({ style: style, fill: color, height: heightWidth, width: heightWidth, viewBox: viewBox, "aria-labelledby": hasTitle ? this.id : null, "aria-hidden": hasTitle ? null : true, role: "img" }, props),
423
- hasTitle && React.createElement("title", { id: this.id }, title),
424
- React.createElement("path", { d: svgPath })));
425
- }
426
- },
427
- _a.displayName = name,
428
- _a.defaultProps = {
429
- color: 'currentColor',
430
- size: IconSize$1.sm,
431
- noVerticalAlign: false
432
- },
433
- _a;
522
+
523
+ function createIcon({
524
+ name,
525
+ xOffset = 0,
526
+ yOffset = 0,
527
+ width,
528
+ height,
529
+ svgPath
530
+ }) {
531
+ var _a;
532
+
533
+ return _a = class SVGIcon extends React.Component {
534
+ constructor() {
535
+ super(...arguments);
536
+ this.id = `icon-title-${currentId++}`;
537
+ }
538
+
539
+ render() {
540
+ const _a = this.props,
541
+ {
542
+ size,
543
+ color,
544
+ title,
545
+ noVerticalAlign
546
+ } = _a,
547
+ props = __rest(_a, ["size", "color", "title", "noVerticalAlign"]);
548
+
549
+ const hasTitle = Boolean(title);
550
+ const heightWidth = getSize(size);
551
+ const baseAlign = -0.125 * Number.parseFloat(heightWidth);
552
+ const style = noVerticalAlign ? null : {
553
+ verticalAlign: `${baseAlign}em`
554
+ };
555
+ const viewBox = [xOffset, yOffset, width, height].join(' ');
556
+ return React.createElement("svg", Object.assign({
557
+ style: style,
558
+ fill: color,
559
+ height: heightWidth,
560
+ width: heightWidth,
561
+ viewBox: viewBox,
562
+ "aria-labelledby": hasTitle ? this.id : null,
563
+ "aria-hidden": hasTitle ? null : true,
564
+ role: "img"
565
+ }, props), hasTitle && React.createElement("title", {
566
+ id: this.id
567
+ }, title), React.createElement("path", {
568
+ d: svgPath
569
+ }));
570
+ }
571
+
572
+ }, _a.displayName = name, _a.defaultProps = {
573
+ color: 'currentColor',
574
+ size: IconSize.sm,
575
+ noVerticalAlign: false
576
+ }, _a;
434
577
  }
435
578
 
436
579
  const HelpIconConfig = {
@@ -439,59 +582,119 @@ const HelpIconConfig = {
439
582
  width: 1024,
440
583
  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',
441
584
  yOffset: 0,
442
- xOffset: 0,
585
+ xOffset: 0
443
586
  };
444
-
445
- const HelpIcon = createIcon$1(HelpIconConfig);
446
-
587
+ const HelpIcon = createIcon(HelpIconConfig);
447
588
  var HelpIcon$1 = HelpIcon;
448
589
 
449
590
  var TableTextVariant;
591
+
450
592
  (function (TableTextVariant) {
451
- TableTextVariant["div"] = "div";
452
- TableTextVariant["nav"] = "nav";
593
+ TableTextVariant["div"] = "div";
594
+ TableTextVariant["nav"] = "nav";
453
595
  })(TableTextVariant || (TableTextVariant = {}));
596
+
454
597
  var WrapModifier;
598
+
455
599
  (function (WrapModifier) {
456
- WrapModifier["wrap"] = "wrap";
457
- WrapModifier["nowrap"] = "nowrap";
458
- WrapModifier["truncate"] = "truncate";
459
- WrapModifier["breakWord"] = "breakWord";
460
- WrapModifier["fitContent"] = "fitContent";
600
+ WrapModifier["wrap"] = "wrap";
601
+ WrapModifier["nowrap"] = "nowrap";
602
+ WrapModifier["truncate"] = "truncate";
603
+ WrapModifier["breakWord"] = "breakWord";
604
+ WrapModifier["fitContent"] = "fitContent";
461
605
  })(WrapModifier || (WrapModifier = {}));
462
- const TableText = (_a) => {
463
- var { children = null, className = '', variant = 'span', wrapModifier = null, tooltip: tooltipProp = '', tooltipProps = {}, onMouseEnter: onMouseEnterProp = () => { } } = _a, props = __rest(_a, ["children", "className", "variant", "wrapModifier", "tooltip", "tooltipProps", "onMouseEnter"]);
464
- const Component = variant;
465
- const [tooltip, setTooltip] = React.useState('');
466
- const onMouseEnter = (event) => {
467
- if (event.target.offsetWidth < event.target.scrollWidth) {
468
- setTooltip(tooltipProp || event.target.innerText);
469
- }
470
- else {
471
- setTooltip('');
472
- }
473
- onMouseEnterProp(event);
474
- };
475
- const text = (React.createElement(Component, Object.assign({ onMouseEnter: onMouseEnter, className: css(className, wrapModifier && styles$1.modifiers[wrapModifier], styles$1.tableText) }, props), children));
476
- return tooltip !== '' ? (React.createElement(Tooltip, Object.assign({ content: tooltip, isVisible: true }, tooltipProps), text)) : (text);
606
+
607
+ const TableText = _a => {
608
+ var {
609
+ children = null,
610
+ className = '',
611
+ variant = 'span',
612
+ wrapModifier = null,
613
+ tooltip: tooltipProp = '',
614
+ tooltipProps = {},
615
+ onMouseEnter: onMouseEnterProp = () => {}
616
+ } = _a,
617
+ props = __rest(_a, ["children", "className", "variant", "wrapModifier", "tooltip", "tooltipProps", "onMouseEnter"]);
618
+
619
+ const Component = variant;
620
+ const [tooltip, setTooltip] = React.useState('');
621
+
622
+ const onMouseEnter = event => {
623
+ if (event.target.offsetWidth < event.target.scrollWidth) {
624
+ setTooltip(tooltipProp || event.target.innerText);
625
+ } else {
626
+ setTooltip('');
627
+ }
628
+
629
+ onMouseEnterProp(event);
630
+ };
631
+
632
+ const text = React.createElement(Component, Object.assign({
633
+ onMouseEnter: onMouseEnter,
634
+ className: css(className, wrapModifier && styles$1.modifiers[wrapModifier], styles$1.tableText)
635
+ }, props), children);
636
+ return tooltip !== '' ? React.createElement(Tooltip, Object.assign({
637
+ content: tooltip,
638
+ isVisible: true
639
+ }, tooltipProps), text) : text;
477
640
  };
478
641
  TableText.displayName = 'TableText';
479
642
 
480
- const HeaderCellInfoWrapper = ({ children, info, className, variant = 'tooltip', popoverProps, tooltipProps, ariaLabel }) => (React.createElement("div", { className: css(styles$1.tableColumnHelp, className) },
481
- typeof children === 'string' ? React.createElement(TableText, null, children) : children,
482
- React.createElement("span", { className: css(styles$1.tableColumnHelpAction) }, variant === 'tooltip' ? (React.createElement(Tooltip$1, Object.assign({ content: info }, tooltipProps),
483
- React.createElement(Button, { variant: "plain", "aria-label": ariaLabel || (typeof info === 'string' && info) || 'More info' },
484
- React.createElement(HelpIcon$1, { noVerticalAlign: true })))) : (React.createElement(Popover, Object.assign({ bodyContent: info }, popoverProps),
485
- React.createElement(Button, { variant: "plain", "aria-label": ariaLabel || (typeof info === 'string' && info) || 'More info' },
486
- React.createElement(HelpIcon$1, { noVerticalAlign: true })))))));
643
+ const HeaderCellInfoWrapper = ({
644
+ children,
645
+ info,
646
+ className,
647
+ variant: _variant = 'tooltip',
648
+ popoverProps,
649
+ tooltipProps,
650
+ ariaLabel
651
+ }) => React.createElement("div", {
652
+ className: css(styles$1.tableColumnHelp, className)
653
+ }, typeof children === 'string' ? React.createElement(TableText, null, children) : children, React.createElement("span", {
654
+ className: css(styles$1.tableColumnHelpAction)
655
+ }, _variant === 'tooltip' ? React.createElement(Tooltip$1, Object.assign({
656
+ content: info
657
+ }, tooltipProps), React.createElement(Button, {
658
+ variant: "plain",
659
+ "aria-label": ariaLabel || typeof info === 'string' && info || 'More info'
660
+ }, React.createElement(HelpIcon$1, {
661
+ noVerticalAlign: true
662
+ }))) : React.createElement(Popover, Object.assign({
663
+ bodyContent: info
664
+ }, popoverProps), React.createElement(Button, {
665
+ variant: "plain",
666
+ "aria-label": ariaLabel || typeof info === 'string' && info || 'More info'
667
+ }, React.createElement(HelpIcon$1, {
668
+ noVerticalAlign: true
669
+ })))));
487
670
  HeaderCellInfoWrapper.displayName = 'HeaderCellInfoWrapper';
488
671
 
489
- const info = ({ tooltip, tooltipProps, popover, popoverProps, className, ariaLabel }) => {
490
- const infoObj = (value) => ({
491
- className: styles$1.modifiers.help,
492
- children: tooltip ? (React.createElement(HeaderCellInfoWrapper, { variant: "tooltip", info: tooltip, tooltipProps: tooltipProps, ariaLabel: ariaLabel, className: className }, value)) : (React.createElement(HeaderCellInfoWrapper, { variant: "popover", info: popover, popoverProps: popoverProps, ariaLabel: ariaLabel, className: className }, value))
493
- });
494
- return infoObj;
672
+ const info = ({
673
+ tooltip,
674
+ tooltipProps,
675
+ popover,
676
+ popoverProps,
677
+ className,
678
+ ariaLabel
679
+ }) => {
680
+ const infoObj = value => ({
681
+ className: styles$1.modifiers.help,
682
+ children: tooltip ? React.createElement(HeaderCellInfoWrapper, {
683
+ variant: "tooltip",
684
+ info: tooltip,
685
+ tooltipProps: tooltipProps,
686
+ ariaLabel: ariaLabel,
687
+ className: className
688
+ }, value) : React.createElement(HeaderCellInfoWrapper, {
689
+ variant: "popover",
690
+ info: popover,
691
+ popoverProps: popoverProps,
692
+ ariaLabel: ariaLabel,
693
+ className: className
694
+ }, value)
695
+ });
696
+
697
+ return infoObj;
495
698
  };
496
699
 
497
700
  const LongArrowAltUpIconConfig = {
@@ -500,11 +703,9 @@ const LongArrowAltUpIconConfig = {
500
703
  width: 256,
501
704
  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',
502
705
  yOffset: 0,
503
- xOffset: 0,
706
+ xOffset: 0
504
707
  };
505
-
506
- const LongArrowAltUpIcon = createIcon$1(LongArrowAltUpIconConfig);
507
-
708
+ const LongArrowAltUpIcon = createIcon(LongArrowAltUpIconConfig);
508
709
  var LongArrowAltUpIcon$1 = LongArrowAltUpIcon;
509
710
 
510
711
  const LongArrowAltDownIconConfig = {
@@ -513,11 +714,9 @@ const LongArrowAltDownIconConfig = {
513
714
  width: 256,
514
715
  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',
515
716
  yOffset: 0,
516
- xOffset: 0,
717
+ xOffset: 0
517
718
  };
518
-
519
- const LongArrowAltDownIcon = createIcon$1(LongArrowAltDownIconConfig);
520
-
719
+ const LongArrowAltDownIcon = createIcon(LongArrowAltDownIconConfig);
521
720
  var LongArrowAltDownIcon$1 = LongArrowAltDownIcon;
522
721
 
523
722
  const ArrowsAltVIconConfig = {
@@ -526,32 +725,46 @@ const ArrowsAltVIconConfig = {
526
725
  width: 256,
527
726
  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',
528
727
  yOffset: 0,
529
- xOffset: 0,
728
+ xOffset: 0
530
729
  };
531
-
532
- const ArrowsAltVIcon = createIcon$1(ArrowsAltVIconConfig);
533
-
730
+ const ArrowsAltVIcon = createIcon(ArrowsAltVIconConfig);
534
731
  var ArrowsAltVIcon$1 = ArrowsAltVIcon;
535
732
 
536
733
  var SortByDirection;
734
+
537
735
  (function (SortByDirection) {
538
- SortByDirection["asc"] = "asc";
539
- SortByDirection["desc"] = "desc";
736
+ SortByDirection["asc"] = "asc";
737
+ SortByDirection["desc"] = "desc";
540
738
  })(SortByDirection || (SortByDirection = {}));
541
- const SortColumn = (_a) => {
542
- var { children = null, className = '', isSortedBy = false, onSort = null, sortDirection = '', type = 'button' } = _a, props = __rest(_a, ["children", "className", "isSortedBy", "onSort", "sortDirection", "type"]);
543
- let SortedByIcon;
544
- if (isSortedBy) {
545
- SortedByIcon = sortDirection === SortByDirection.asc ? LongArrowAltUpIcon$1 : LongArrowAltDownIcon$1;
546
- }
547
- else {
548
- SortedByIcon = ArrowsAltVIcon$1;
549
- }
550
- return (React.createElement("button", Object.assign({}, props, { type: type, className: css(className, styles$1.tableButton), onClick: event => onSort && onSort(event) }),
551
- React.createElement("div", { className: css(className, styles$1.tableButtonContent) },
552
- React.createElement(TableText, null, children),
553
- React.createElement("span", { className: css(styles$1.tableSortIndicator) },
554
- React.createElement(SortedByIcon, null)))));
739
+
740
+ const SortColumn = _a => {
741
+ var {
742
+ children = null,
743
+ className = '',
744
+ isSortedBy = false,
745
+ onSort = null,
746
+ sortDirection = '',
747
+ type = 'button'
748
+ } = _a,
749
+ props = __rest(_a, ["children", "className", "isSortedBy", "onSort", "sortDirection", "type"]);
750
+
751
+ let SortedByIcon;
752
+
753
+ if (isSortedBy) {
754
+ SortedByIcon = sortDirection === SortByDirection.asc ? LongArrowAltUpIcon$1 : LongArrowAltDownIcon$1;
755
+ } else {
756
+ SortedByIcon = ArrowsAltVIcon$1;
757
+ }
758
+
759
+ return React.createElement("button", Object.assign({}, props, {
760
+ type: type,
761
+ className: css(className, styles$1.tableButton),
762
+ onClick: event => onSort && onSort(event)
763
+ }), React.createElement("div", {
764
+ className: css(className, styles$1.tableButtonContent)
765
+ }, React.createElement(TableText, null, children), React.createElement("span", {
766
+ className: css(styles$1.tableSortIndicator)
767
+ }, React.createElement(SortedByIcon, null))));
555
768
  };
556
769
  SortColumn.displayName = 'SortColumn';
557
770
 
@@ -561,70 +774,97 @@ const StarIconConfig = {
561
774
  width: 576,
562
775
  svgPath: 'M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z',
563
776
  yOffset: 0,
564
- xOffset: 0,
777
+ xOffset: 0
565
778
  };
566
-
567
- const StarIcon = createIcon$1(StarIconConfig);
568
-
779
+ const StarIcon = createIcon(StarIconConfig);
569
780
  var StarIcon$1 = StarIcon;
570
781
 
571
- const sortableFavorites = (sort) => () => sortable(React.createElement(StarIcon$1, { "aria-hidden": true }), {
572
- columnIndex: sort.columnIndex,
573
- className: styles$1.modifiers.favorite,
574
- ariaLabel: 'Sort favorites',
575
- column: {
576
- extraParams: {
577
- sortBy: sort.sortBy,
578
- onSort: sort === null || sort === void 0 ? void 0 : sort.onSort
579
- }
782
+ const sortableFavorites = sort => () => sortable(React.createElement(StarIcon$1, {
783
+ "aria-hidden": true
784
+ }), {
785
+ columnIndex: sort.columnIndex,
786
+ className: styles$1.modifiers.favorite,
787
+ ariaLabel: 'Sort favorites',
788
+ column: {
789
+ extraParams: {
790
+ sortBy: sort.sortBy,
791
+ onSort: sort === null || sort === void 0 ? void 0 : sort.onSort
580
792
  }
793
+ }
581
794
  });
582
- const sortable = (label, { columnIndex, column, property, className, ariaLabel }) => {
583
- const { extraParams: { sortBy, onSort } } = column;
584
- const extraData = {
585
- columnIndex,
586
- column,
587
- property
588
- };
589
- const isSortedBy = sortBy && columnIndex === sortBy.index;
590
- /**
591
- * @param {React.MouseEvent} event - React mouse event
592
- */
593
- function sortClicked(event) {
594
- let reversedDirection;
595
- if (!isSortedBy) {
596
- reversedDirection = sortBy.defaultDirection ? sortBy.defaultDirection : SortByDirection.asc;
597
- }
598
- else {
599
- reversedDirection = sortBy.direction === SortByDirection.asc ? SortByDirection.desc : SortByDirection.asc;
600
- }
601
- // tslint:disable-next-line:no-unused-expression
602
- onSort && onSort(event, columnIndex, reversedDirection, extraData);
795
+ const sortable = (label, {
796
+ columnIndex,
797
+ column,
798
+ property,
799
+ className,
800
+ ariaLabel
801
+ }) => {
802
+ const {
803
+ extraParams: {
804
+ sortBy,
805
+ onSort
603
806
  }
604
- return {
605
- className: css(styles$1.tableSort, isSortedBy && styles$1.modifiers.selected, className),
606
- 'aria-sort': isSortedBy ? `${sortBy.direction}ending` : 'none',
607
- children: (React.createElement(SortColumn, { isSortedBy: isSortedBy, sortDirection: isSortedBy ? sortBy.direction : '', onSort: sortClicked, "aria-label": ariaLabel }, label))
608
- };
807
+ } = column;
808
+ const extraData = {
809
+ columnIndex,
810
+ column,
811
+ property
812
+ };
813
+ const isSortedBy = sortBy && columnIndex === sortBy.index;
814
+ /**
815
+ * @param {React.MouseEvent} event - React mouse event
816
+ */
817
+
818
+ function sortClicked(event) {
819
+ let reversedDirection;
820
+
821
+ if (!isSortedBy) {
822
+ reversedDirection = sortBy.defaultDirection ? sortBy.defaultDirection : SortByDirection.asc;
823
+ } else {
824
+ reversedDirection = sortBy.direction === SortByDirection.asc ? SortByDirection.desc : SortByDirection.asc;
825
+ } // tslint:disable-next-line:no-unused-expression
826
+
827
+
828
+ onSort && onSort(event, columnIndex, reversedDirection, extraData);
829
+ }
830
+
831
+ return {
832
+ className: css(styles$1.tableSort, isSortedBy && styles$1.modifiers.selected, className),
833
+ 'aria-sort': isSortedBy ? `${sortBy.direction}ending` : 'none',
834
+ children: React.createElement(SortColumn, {
835
+ isSortedBy: isSortedBy,
836
+ sortDirection: isSortedBy ? sortBy.direction : '',
837
+ onSort: sortClicked,
838
+ "aria-label": ariaLabel
839
+ }, label)
840
+ };
609
841
  };
610
842
 
611
843
  var RowSelectVariant;
844
+
612
845
  (function (RowSelectVariant) {
613
- RowSelectVariant["radio"] = "radio";
614
- RowSelectVariant["checkbox"] = "checkbox";
846
+ RowSelectVariant["radio"] = "radio";
847
+ RowSelectVariant["checkbox"] = "checkbox";
615
848
  })(RowSelectVariant || (RowSelectVariant = {}));
616
- const SelectColumn = (_a) => {
617
- var { children = null,
849
+
850
+ const SelectColumn = _a => {
851
+ var {
852
+ children = null,
618
853
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
619
- className, onSelect = null, selectVariant } = _a, props = __rest(_a, ["children", "className", "onSelect", "selectVariant"]);
620
- return (React.createElement(React.Fragment, null,
621
- React.createElement("label", null,
622
- React.createElement("input", Object.assign({}, props, { type: selectVariant, onChange: onSelect }))),
623
- children));
854
+ className,
855
+ onSelect = null,
856
+ selectVariant
857
+ } = _a,
858
+ props = __rest(_a, ["children", "className", "onSelect", "selectVariant"]);
859
+
860
+ return React.createElement(React.Fragment, null, React.createElement("label", null, React.createElement("input", Object.assign({}, props, {
861
+ type: selectVariant,
862
+ onChange: onSelect
863
+ }))), children);
624
864
  };
625
865
  SelectColumn.displayName = 'SelectColumn';
626
866
 
627
- import('./check-120c4f98.js');
867
+ import('./check-8277bc89.js');
628
868
  var checkStyles = {
629
869
  "check": "pf-c-check",
630
870
  "checkBody": "pf-c-check__body",
@@ -637,55 +877,76 @@ var checkStyles = {
637
877
  }
638
878
  };
639
879
 
640
- const selectable = (label, { rowIndex, columnIndex, rowData, column, property }) => {
641
- const { extraParams: { onSelect, selectVariant, allRowsSelected, isHeaderSelectDisabled } } = column;
642
- const extraData = {
643
- rowIndex,
644
- columnIndex,
645
- column,
646
- property
647
- };
648
- if (rowData && rowData.hasOwnProperty('parent') && !rowData.showSelect && !rowData.fullWidth) {
649
- return {
650
- component: 'td',
651
- isVisible: true
652
- };
653
- }
654
- const rowId = rowIndex !== undefined ? rowIndex : -1;
655
- /**
656
- * @param {React.FormEvent} event - React form event
657
- */
658
- function selectClick(event) {
659
- const selected = rowIndex === undefined ? event.currentTarget.checked : rowData && !rowData.selected;
660
- // tslint:disable-next-line:no-unused-expression
661
- onSelect && onSelect(event, selected, rowId, rowData, extraData);
662
- }
663
- const customProps = Object.assign(Object.assign(Object.assign({}, (rowId !== -1
664
- ? {
665
- checked: rowData && !!rowData.selected,
666
- 'aria-label': `Select row ${rowIndex}`
667
- }
668
- : {
669
- checked: allRowsSelected,
670
- 'aria-label': 'Select all rows'
671
- })), (rowData &&
672
- (rowData.disableCheckbox || rowData.disableSelection) && {
673
- disabled: true,
674
- className: checkStyles.checkInput
675
- })), (!rowData && isHeaderSelectDisabled && { disabled: true }));
676
- let selectName = 'check-all';
677
- if (rowId !== -1 && selectVariant === RowSelectVariant.checkbox) {
678
- selectName = `checkrow${rowIndex}`;
679
- }
680
- else if (rowId !== -1) {
681
- selectName = 'radioGroup';
880
+ const selectable = (label, {
881
+ rowIndex,
882
+ columnIndex,
883
+ rowData,
884
+ column,
885
+ property
886
+ }) => {
887
+ const {
888
+ extraParams: {
889
+ onSelect,
890
+ selectVariant,
891
+ allRowsSelected,
892
+ isHeaderSelectDisabled
682
893
  }
894
+ } = column;
895
+ const extraData = {
896
+ rowIndex,
897
+ columnIndex,
898
+ column,
899
+ property
900
+ };
901
+
902
+ if (rowData && rowData.hasOwnProperty('parent') && !rowData.showSelect && !rowData.fullWidth) {
683
903
  return {
684
- className: css(styles$1.tableCheck),
685
- component: 'td',
686
- isVisible: !rowData || !rowData.fullWidth,
687
- children: (React.createElement(SelectColumn, Object.assign({}, customProps, { selectVariant: selectVariant, onSelect: selectClick, name: selectName }), label))
904
+ component: 'td',
905
+ isVisible: true
688
906
  };
907
+ }
908
+
909
+ const rowId = rowIndex !== undefined ? rowIndex : -1;
910
+ /**
911
+ * @param {React.FormEvent} event - React form event
912
+ */
913
+
914
+ function selectClick(event) {
915
+ const selected = rowIndex === undefined ? event.currentTarget.checked : rowData && !rowData.selected; // tslint:disable-next-line:no-unused-expression
916
+
917
+ onSelect && onSelect(event, selected, rowId, rowData, extraData);
918
+ }
919
+
920
+ const customProps = Object.assign(Object.assign(Object.assign({}, rowId !== -1 ? {
921
+ checked: rowData && !!rowData.selected,
922
+ 'aria-label': `Select row ${rowIndex}`
923
+ } : {
924
+ checked: allRowsSelected,
925
+ 'aria-label': 'Select all rows'
926
+ }), rowData && (rowData.disableCheckbox || rowData.disableSelection) && {
927
+ disabled: true,
928
+ className: checkStyles.checkInput
929
+ }), !rowData && isHeaderSelectDisabled && {
930
+ disabled: true
931
+ });
932
+ let selectName = 'check-all';
933
+
934
+ if (rowId !== -1 && selectVariant === RowSelectVariant.checkbox) {
935
+ selectName = `checkrow${rowIndex}`;
936
+ } else if (rowId !== -1) {
937
+ selectName = 'radioGroup';
938
+ }
939
+
940
+ return {
941
+ className: css(styles$1.tableCheck),
942
+ component: 'td',
943
+ isVisible: !rowData || !rowData.fullWidth,
944
+ children: React.createElement(SelectColumn, Object.assign({}, customProps, {
945
+ selectVariant: selectVariant,
946
+ onSelect: selectClick,
947
+ name: selectName
948
+ }), label)
949
+ };
689
950
  };
690
951
 
691
952
  const AngleDownIconConfig = {
@@ -694,82 +955,96 @@ const AngleDownIconConfig = {
694
955
  width: 320,
695
956
  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',
696
957
  yOffset: 0,
697
- xOffset: 0,
958
+ xOffset: 0
698
959
  };
699
-
700
- const AngleDownIcon = createIcon$1(AngleDownIconConfig);
701
-
960
+ const AngleDownIcon = createIcon(AngleDownIconConfig);
702
961
  var AngleDownIcon$1 = AngleDownIcon;
703
962
 
704
- const CollapseColumn = (_a) => {
705
- var { className = '', children = null, isOpen, onToggle } = _a, props = __rest(_a, ["className", "children", "isOpen", "onToggle"]);
706
- return (React.createElement(React.Fragment, null,
707
- isOpen !== undefined && (React.createElement(Button$1, Object.assign({ className: css(className, isOpen && styles$1.modifiers.expanded) }, props, { variant: "plain", "aria-label": props['aria-label'] || 'Details', onClick: onToggle, "aria-expanded": isOpen }),
708
- React.createElement("div", { className: css(styles$1.tableToggleIcon) },
709
- React.createElement(AngleDownIcon$1, null)))),
710
- children));
963
+ const CollapseColumn = _a => {
964
+ var {
965
+ className = '',
966
+ children = null,
967
+ isOpen,
968
+ onToggle
969
+ } = _a,
970
+ props = __rest(_a, ["className", "children", "isOpen", "onToggle"]);
971
+
972
+ return React.createElement(React.Fragment, null, isOpen !== undefined && React.createElement(Button$1, Object.assign({
973
+ className: css(className, isOpen && styles$1.modifiers.expanded)
974
+ }, props, {
975
+ variant: "plain",
976
+ "aria-label": props['aria-label'] || 'Details',
977
+ onClick: onToggle,
978
+ "aria-expanded": isOpen
979
+ }), React.createElement("div", {
980
+ className: css(styles$1.tableToggleIcon)
981
+ }, React.createElement(AngleDownIcon$1, null))), children);
711
982
  };
712
983
  CollapseColumn.displayName = 'CollapseColumn';
713
984
 
714
- const collapsible = (value, { rowIndex, columnIndex, rowData, column, property }) => {
715
- const { extraParams: { onCollapse, rowLabeledBy = 'simple-node', expandId = 'expand-toggle', allRowsExpanded, collapseAllAriaLabel } } = column;
716
- const extraData = {
717
- rowIndex,
718
- columnIndex,
719
- column,
720
- property
721
- };
722
- const rowId = rowIndex !== undefined ? rowIndex : -1;
723
- const customProps = Object.assign({}, (rowId !== -1
724
- ? {
725
- isOpen: rowData === null || rowData === void 0 ? void 0 : rowData.isOpen,
726
- 'aria-labelledby': `${rowLabeledBy}${rowId} ${expandId}${rowId}`
727
- }
728
- : {
729
- isOpen: allRowsExpanded,
730
- 'aria-label': collapseAllAriaLabel || 'Expand all rows'
731
- }));
732
- /**
733
- * @param {React.MouseEvent} event - Mouse event
734
- */
735
- function onToggle(event) {
736
- const open = rowData ? !rowData.isOpen : !allRowsExpanded;
737
- // tslint:disable-next-line:no-unused-expression
738
- onCollapse && onCollapse(event, rowIndex, open, rowData, extraData);
985
+ const collapsible = (value, {
986
+ rowIndex,
987
+ columnIndex,
988
+ rowData,
989
+ column,
990
+ property
991
+ }) => {
992
+ const {
993
+ extraParams: {
994
+ onCollapse,
995
+ rowLabeledBy = 'simple-node',
996
+ expandId = 'expand-toggle',
997
+ allRowsExpanded,
998
+ collapseAllAriaLabel
739
999
  }
740
- return {
741
- className: ((rowData === null || rowData === void 0 ? void 0 : rowData.isOpen) !== undefined || rowId === -1) && css(styles$1.tableToggle),
742
- isVisible: !(rowData === null || rowData === void 0 ? void 0 : rowData.fullWidth),
743
- children: (React.createElement(CollapseColumn, Object.assign({ "aria-labelledby": `${rowLabeledBy}${rowId} ${expandId}${rowId}`, onToggle: onToggle, id: expandId + rowId }, customProps), value))
744
- };
1000
+ } = column;
1001
+ const extraData = {
1002
+ rowIndex,
1003
+ columnIndex,
1004
+ column,
1005
+ property
1006
+ };
1007
+ const rowId = rowIndex !== undefined ? rowIndex : -1;
1008
+ const customProps = Object.assign({}, rowId !== -1 ? {
1009
+ isOpen: rowData === null || rowData === void 0 ? void 0 : rowData.isOpen,
1010
+ 'aria-labelledby': `${rowLabeledBy}${rowId} ${expandId}${rowId}`
1011
+ } : {
1012
+ isOpen: allRowsExpanded,
1013
+ 'aria-label': collapseAllAriaLabel || 'Expand all rows'
1014
+ });
1015
+ /**
1016
+ * @param {React.MouseEvent} event - Mouse event
1017
+ */
1018
+
1019
+ function onToggle(event) {
1020
+ const open = rowData ? !rowData.isOpen : !allRowsExpanded; // tslint:disable-next-line:no-unused-expression
1021
+
1022
+ onCollapse && onCollapse(event, rowIndex, open, rowData, extraData);
1023
+ }
1024
+
1025
+ return {
1026
+ className: ((rowData === null || rowData === void 0 ? void 0 : rowData.isOpen) !== undefined || rowId === -1) && css(styles$1.tableToggle),
1027
+ isVisible: !(rowData === null || rowData === void 0 ? void 0 : rowData.fullWidth),
1028
+ children: React.createElement(CollapseColumn, Object.assign({
1029
+ "aria-labelledby": `${rowLabeledBy}${rowId} ${expandId}${rowId}`,
1030
+ onToggle: onToggle,
1031
+ id: expandId + rowId
1032
+ }, customProps), value)
1033
+ };
745
1034
  };
746
1035
 
747
- const cellWidth = (width) => () => ({
748
- className: css(styles$1.modifiers[typeof width === 'number' ? `width_${width}` : `width${capitalize(width)}`])
1036
+ const cellWidth = width => () => ({
1037
+ className: css(styles$1.modifiers[typeof width === 'number' ? `width_${width}` : `width${capitalize(width)}`])
749
1038
  });
750
1039
 
751
- const visibilityModifiers = [
752
- 'hidden',
753
- 'hiddenOnSm',
754
- 'hiddenOnMd',
755
- 'hiddenOnLg',
756
- 'hiddenOnXl',
757
- 'hiddenOn_2xl',
758
- 'visibleOnSm',
759
- 'visibleOnMd',
760
- 'visibleOnLg',
761
- 'visibleOnXl',
762
- 'visibleOn_2xl'
763
- ];
764
- const Visibility = visibilityModifiers
765
- .filter(key => styles$1.modifiers[key])
766
- .reduce((acc, curr) => {
767
- const key2 = curr.replace('_2xl', '2Xl');
768
- acc[key2] = styles$1.modifiers[curr];
769
- return acc;
1040
+ const visibilityModifiers = ['hidden', 'hiddenOnSm', 'hiddenOnMd', 'hiddenOnLg', 'hiddenOnXl', 'hiddenOn_2xl', 'visibleOnSm', 'visibleOnMd', 'visibleOnLg', 'visibleOnXl', 'visibleOn_2xl'];
1041
+ const Visibility = visibilityModifiers.filter(key => styles$1.modifiers[key]).reduce((acc, curr) => {
1042
+ const key2 = curr.replace('_2xl', '2Xl');
1043
+ acc[key2] = styles$1.modifiers[curr];
1044
+ return acc;
770
1045
  }, {});
771
1046
  const classNames = (...classes) => () => ({
772
- className: css(...classes)
1047
+ className: css(...classes)
773
1048
  });
774
1049
 
775
1050
  /**
@@ -781,259 +1056,442 @@ const classNames = (...classes) => () => ({
781
1056
  /**
782
1057
  * @param {any} props - Props
783
1058
  */
1059
+
784
1060
  function mergeProps(...props) {
785
- const firstProps = props[0];
786
- const restProps = props.slice(1);
787
- if (!restProps.length) {
788
- return mergeWith({}, firstProps);
1061
+ const firstProps = props[0];
1062
+ const restProps = props.slice(1);
1063
+
1064
+ if (!restProps.length) {
1065
+ return mergeWith({}, firstProps);
1066
+ } // Avoid mutating the first prop collection
1067
+
1068
+
1069
+ return mergeWith(mergeWith({}, firstProps), ...restProps, (a, b, key) => {
1070
+ if (key === 'children') {
1071
+ if (a && b) {
1072
+ // compose the two
1073
+ return React.cloneElement(a, {
1074
+ children: b
1075
+ });
1076
+ } // Children have to be merged in reverse order for Reactabular
1077
+ // logic to work.
1078
+
1079
+
1080
+ return Object.assign(Object.assign({}, b), a);
789
1081
  }
790
- // Avoid mutating the first prop collection
791
- return mergeWith(mergeWith({}, firstProps), ...restProps, (a, b, key) => {
792
- if (key === 'children') {
793
- if (a && b) {
794
- // compose the two
795
- return React.cloneElement(a, {
796
- children: b
797
- });
798
- }
799
- // Children have to be merged in reverse order for Reactabular
800
- // logic to work.
801
- return Object.assign(Object.assign({}, b), a);
802
- }
803
- if (key === 'className') {
804
- // Process class names through classNames to merge properly
805
- // as a string.
806
- return css(a, b);
807
- }
808
- return undefined;
809
- });
1082
+
1083
+ if (key === 'className') {
1084
+ // Process class names through classNames to merge properly
1085
+ // as a string.
1086
+ return css(a, b);
1087
+ }
1088
+
1089
+ return undefined;
1090
+ });
810
1091
  }
811
1092
 
812
- const ThBase = (_a) => {
813
- var { children, className, component = 'th', dataLabel, scope = 'col', textCenter = false, sort = null, modifier, select = null, expand: collapse = null, tooltip = '', onMouseEnter: onMouseEnterProp = () => { }, width, visibility, innerRef, info: infoProps, isStickyColumn = false, hasRightBorder = false, stickyMinWidth = '120px', stickyLeftOffset, isSubheader = false } = _a, props = __rest(_a, ["children", "className", "component", "dataLabel", "scope", "textCenter", "sort", "modifier", "select", "expand", "tooltip", "onMouseEnter", "width", "visibility", "innerRef", "info", "isStickyColumn", "hasRightBorder", "stickyMinWidth", "stickyLeftOffset", "isSubheader"]);
814
- const [showTooltip, setShowTooltip] = React.useState(false);
815
- const onMouseEnter = (event) => {
816
- if (event.target.offsetWidth < event.target.scrollWidth) {
817
- !showTooltip && setShowTooltip(true);
818
- }
819
- else {
820
- showTooltip && setShowTooltip(false);
821
- }
822
- onMouseEnterProp(event);
823
- };
824
- let sortParams = null;
825
- if (sort) {
826
- if (sort.isFavorites) {
827
- sortParams = sortableFavorites({
828
- onSort: sort === null || sort === void 0 ? void 0 : sort.onSort,
829
- columnIndex: sort.columnIndex,
830
- sortBy: sort.sortBy
831
- })();
832
- }
833
- else {
834
- sortParams = sortable(children, {
835
- columnIndex: sort.columnIndex,
836
- column: {
837
- extraParams: {
838
- sortBy: sort.sortBy,
839
- onSort: sort === null || sort === void 0 ? void 0 : sort.onSort
840
- }
841
- }
842
- });
1093
+ const ThBase = _a => {
1094
+ var {
1095
+ children,
1096
+ className,
1097
+ component = 'th',
1098
+ dataLabel,
1099
+ scope = 'col',
1100
+ textCenter = false,
1101
+ sort = null,
1102
+ modifier,
1103
+ select = null,
1104
+ expand: collapse = null,
1105
+ tooltip = '',
1106
+ onMouseEnter: onMouseEnterProp = () => {},
1107
+ width,
1108
+ visibility,
1109
+ innerRef,
1110
+ info: infoProps,
1111
+ isStickyColumn = false,
1112
+ hasRightBorder = false,
1113
+ stickyMinWidth = '120px',
1114
+ stickyLeftOffset,
1115
+ isSubheader = false
1116
+ } = _a,
1117
+ props = __rest(_a, ["children", "className", "component", "dataLabel", "scope", "textCenter", "sort", "modifier", "select", "expand", "tooltip", "onMouseEnter", "width", "visibility", "innerRef", "info", "isStickyColumn", "hasRightBorder", "stickyMinWidth", "stickyLeftOffset", "isSubheader"]);
1118
+
1119
+ const [showTooltip, setShowTooltip] = React.useState(false);
1120
+
1121
+ const onMouseEnter = event => {
1122
+ if (event.target.offsetWidth < event.target.scrollWidth) {
1123
+ !showTooltip && setShowTooltip(true);
1124
+ } else {
1125
+ showTooltip && setShowTooltip(false);
1126
+ }
1127
+
1128
+ onMouseEnterProp(event);
1129
+ };
1130
+
1131
+ let sortParams = null;
1132
+
1133
+ if (sort) {
1134
+ if (sort.isFavorites) {
1135
+ sortParams = sortableFavorites({
1136
+ onSort: sort === null || sort === void 0 ? void 0 : sort.onSort,
1137
+ columnIndex: sort.columnIndex,
1138
+ sortBy: sort.sortBy
1139
+ })();
1140
+ } else {
1141
+ sortParams = sortable(children, {
1142
+ columnIndex: sort.columnIndex,
1143
+ column: {
1144
+ extraParams: {
1145
+ sortBy: sort.sortBy,
1146
+ onSort: sort === null || sort === void 0 ? void 0 : sort.onSort
1147
+ }
843
1148
  }
1149
+ });
844
1150
  }
845
- const selectParams = select
846
- ? selectable(children, {
847
- column: {
848
- extraParams: {
849
- onSelect: select === null || select === void 0 ? void 0 : select.onSelect,
850
- selectVariant: 'checkbox',
851
- allRowsSelected: select.isSelected,
852
- isHeaderSelectDisabled: !!select.isHeaderSelectDisabled
853
- }
854
- }
855
- })
856
- : null;
857
- const collapseParams = collapse
858
- ? collapsible(children, {
859
- column: {
860
- extraParams: {
861
- onCollapse: collapse === null || collapse === void 0 ? void 0 : collapse.onToggle,
862
- allRowsExpanded: !collapse.areAllExpanded,
863
- collapseAllAriaLabel: ''
864
- }
865
- }
866
- })
867
- : null;
868
- const widthParams = width ? cellWidth(width)() : null;
869
- const visibilityParams = visibility
870
- ? classNames(...visibility.map((vis) => Visibility[vis]))()
871
- : null;
872
- let 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;
873
- // info can wrap other transformedChildren
874
- let infoParams = null;
875
- if (infoProps) {
876
- infoParams = info(infoProps)(transformedChildren);
877
- transformedChildren = infoParams.children;
1151
+ }
1152
+
1153
+ const selectParams = select ? selectable(children, {
1154
+ column: {
1155
+ extraParams: {
1156
+ onSelect: select === null || select === void 0 ? void 0 : select.onSelect,
1157
+ selectVariant: 'checkbox',
1158
+ allRowsSelected: select.isSelected,
1159
+ isHeaderSelectDisabled: !!select.isHeaderSelectDisabled
1160
+ }
878
1161
  }
879
- const merged = mergeProps(sortParams, selectParams, collapseParams, widthParams, visibilityParams, infoParams);
880
- const {
1162
+ }) : null;
1163
+ const collapseParams = collapse ? collapsible(children, {
1164
+ column: {
1165
+ extraParams: {
1166
+ onCollapse: collapse === null || collapse === void 0 ? void 0 : collapse.onToggle,
1167
+ allRowsExpanded: !collapse.areAllExpanded,
1168
+ collapseAllAriaLabel: ''
1169
+ }
1170
+ }
1171
+ }) : null;
1172
+ const widthParams = width ? cellWidth(width)() : null;
1173
+ const visibilityParams = visibility ? classNames(...visibility.map(vis => Visibility[vis]))() : null;
1174
+ let 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
1175
+
1176
+ let infoParams = null;
1177
+
1178
+ if (infoProps) {
1179
+ infoParams = info(infoProps)(transformedChildren);
1180
+ transformedChildren = infoParams.children;
1181
+ }
1182
+
1183
+ const merged = mergeProps(sortParams, selectParams, collapseParams, widthParams, visibilityParams, infoParams);
1184
+
1185
+ const {
881
1186
  // ignore the merged children since we transform them ourselves so we can wrap it with info
882
1187
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
883
- children: mergedChildren = null,
1188
+ children: mergedChildren = null,
884
1189
  // selectable adds this but we don't want it
885
1190
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
886
- isVisible = null, className: mergedClassName = '', component: MergedComponent = component } = merged, mergedProps = __rest(merged, ["children", "isVisible", "className", "component"]);
887
- const cell = (React.createElement(MergedComponent, Object.assign({ "data-label": dataLabel, onMouseEnter: tooltip !== null ? onMouseEnter : onMouseEnterProp, scope: component === 'th' && children ? scope : null, ref: innerRef, 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) }, mergedProps, props, (isStickyColumn && {
888
- style: Object.assign({ '--pf-c-table__sticky-column--MinWidth': stickyMinWidth ? stickyMinWidth : undefined, '--pf-c-table__sticky-column--Left': stickyLeftOffset ? stickyLeftOffset : undefined }, props.style)
889
- })), transformedChildren));
890
- const canDefault = tooltip === '' ? typeof children === 'string' : true;
891
- return tooltip !== null && canDefault && showTooltip ? (React.createElement(Tooltip, { content: tooltip || (tooltip === '' && children), isVisible: true }, cell)) : (cell);
1191
+ isVisible = null,
1192
+ className: mergedClassName = '',
1193
+ component: MergedComponent = component
1194
+ } = merged,
1195
+ mergedProps = __rest(merged, ["children", "isVisible", "className", "component"]);
1196
+
1197
+ const cell = React.createElement(MergedComponent, Object.assign({
1198
+ "data-label": dataLabel,
1199
+ onMouseEnter: tooltip !== null ? onMouseEnter : onMouseEnterProp,
1200
+ scope: component === 'th' && children ? scope : null,
1201
+ ref: innerRef,
1202
+ 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)
1203
+ }, mergedProps, props, isStickyColumn && {
1204
+ style: Object.assign({
1205
+ '--pf-c-table__sticky-column--MinWidth': stickyMinWidth ? stickyMinWidth : undefined,
1206
+ '--pf-c-table__sticky-column--Left': stickyLeftOffset ? stickyLeftOffset : undefined
1207
+ }, props.style)
1208
+ }), transformedChildren);
1209
+ const canDefault = tooltip === '' ? typeof children === 'string' : true;
1210
+ return tooltip !== null && canDefault && showTooltip ? React.createElement(Tooltip, {
1211
+ content: tooltip || tooltip === '' && children,
1212
+ isVisible: true
1213
+ }, cell) : cell;
892
1214
  };
893
- const Th = React.forwardRef((props, ref) => (React.createElement(ThBase, Object.assign({}, props, { innerRef: ref }))));
1215
+
1216
+ const Th = React.forwardRef((props, ref) => React.createElement(ThBase, Object.assign({}, props, {
1217
+ innerRef: ref
1218
+ })));
894
1219
  Th.displayName = 'Th';
895
1220
 
896
1221
  class ActionsColumn extends React.Component {
897
- constructor(props) {
898
- super(props);
899
- this.toggleRef = React.createRef();
900
- this.onToggle = (isOpen) => {
901
- this.setState({
902
- isOpen
903
- });
904
- };
905
- this.onClick = (event, onClick) => {
906
- const { rowData, extraData } = this.props;
907
- // Only prevent default if onClick is provided. This allows href support.
908
- if (onClick) {
909
- event.preventDefault();
910
- // tslint:disable-next-line:no-unused-expression
911
- onClick(event, extraData && extraData.rowIndex, rowData, extraData);
912
- }
913
- };
914
- this.state = {
915
- isOpen: false
916
- };
917
- }
918
- render() {
919
- const { isOpen } = this.state;
920
- const { items, children, dropdownPosition, dropdownDirection, isDisabled, rowData, actionsToggle } = this.props;
921
- const actionsToggleClone = actionsToggle ? (actionsToggle({ onToggle: this.onToggle, isOpen, isDisabled })) : (React.createElement(KebabToggle, { isDisabled: isDisabled, onToggle: this.onToggle }));
922
- return (React.createElement(React.Fragment, null,
923
- items
924
- .filter(item => item.isOutsideDropdown)
925
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
926
- .map((_a, key) => {
927
- var { title, itemKey, onClick, isOutsideDropdown } = _a, props = __rest(_a, ["title", "itemKey", "onClick", "isOutsideDropdown"]);
928
- return typeof title === 'string' ? (React.createElement(Button$1, Object.assign({ onClick: event => this.onClick(event, onClick) }, props, { isDisabled: isDisabled, key: itemKey || `outside_dropdown_${key}`, "data-key": itemKey || `outside_dropdown_${key}` }), title)) : (React.cloneElement(title, Object.assign({ onClick, isDisabled }, props)));
929
- }),
930
- React.createElement(Dropdown, Object.assign({ toggle: actionsToggleClone, position: dropdownPosition, direction: dropdownDirection, isOpen: isOpen, dropdownItems: items
931
- .filter(item => !item.isOutsideDropdown)
932
- .map((_a, key) => {
933
- var { title, itemKey, onClick, isSeparator } = _a, props = __rest(_a, ["title", "itemKey", "onClick", "isSeparator"]);
934
- return isSeparator ? (React.createElement(DropdownSeparator, Object.assign({}, props, { key: itemKey || key, "data-key": itemKey || key }))) : (React.createElement(DropdownItem, Object.assign({ component: "button", onClick: event => {
935
- this.onClick(event, onClick);
936
- this.onToggle(!isOpen);
937
- } }, props, { key: itemKey || key, "data-key": itemKey || key }), title));
938
- }), isPlain: true }, (rowData && rowData.actionProps))),
939
- children));
940
- }
1222
+ constructor(props) {
1223
+ super(props);
1224
+ this.toggleRef = React.createRef();
1225
+
1226
+ this.onToggle = isOpen => {
1227
+ this.setState({
1228
+ isOpen
1229
+ });
1230
+ };
1231
+
1232
+ this.onClick = (event, onClick) => {
1233
+ const {
1234
+ rowData,
1235
+ extraData
1236
+ } = this.props; // Only prevent default if onClick is provided. This allows href support.
1237
+
1238
+ if (onClick) {
1239
+ event.preventDefault(); // tslint:disable-next-line:no-unused-expression
1240
+
1241
+ onClick(event, extraData && extraData.rowIndex, rowData, extraData);
1242
+ }
1243
+ };
1244
+
1245
+ this.state = {
1246
+ isOpen: false
1247
+ };
1248
+ }
1249
+
1250
+ render() {
1251
+ const {
1252
+ isOpen
1253
+ } = this.state;
1254
+ const {
1255
+ items,
1256
+ children,
1257
+ dropdownPosition,
1258
+ dropdownDirection,
1259
+ isDisabled,
1260
+ rowData,
1261
+ actionsToggle
1262
+ } = this.props;
1263
+ const actionsToggleClone = actionsToggle ? actionsToggle({
1264
+ onToggle: this.onToggle,
1265
+ isOpen,
1266
+ isDisabled
1267
+ }) : React.createElement(KebabToggle, {
1268
+ isDisabled: isDisabled,
1269
+ onToggle: this.onToggle
1270
+ });
1271
+ return React.createElement(React.Fragment, null, items.filter(item => item.isOutsideDropdown) // eslint-disable-next-line @typescript-eslint/no-unused-vars
1272
+ .map((_a, key) => {
1273
+ var {
1274
+ title,
1275
+ itemKey,
1276
+ onClick,
1277
+ isOutsideDropdown
1278
+ } = _a,
1279
+ props = __rest(_a, ["title", "itemKey", "onClick", "isOutsideDropdown"]);
1280
+
1281
+ return typeof title === 'string' ? React.createElement(Button$1, Object.assign({
1282
+ onClick: event => this.onClick(event, onClick)
1283
+ }, props, {
1284
+ isDisabled: isDisabled,
1285
+ key: itemKey || `outside_dropdown_${key}`,
1286
+ "data-key": itemKey || `outside_dropdown_${key}`
1287
+ }), title) : React.cloneElement(title, Object.assign({
1288
+ onClick,
1289
+ isDisabled
1290
+ }, props));
1291
+ }), React.createElement(Dropdown, Object.assign({
1292
+ toggle: actionsToggleClone,
1293
+ position: dropdownPosition,
1294
+ direction: dropdownDirection,
1295
+ isOpen: isOpen,
1296
+ dropdownItems: items.filter(item => !item.isOutsideDropdown).map((_a, key) => {
1297
+ var {
1298
+ title,
1299
+ itemKey,
1300
+ onClick,
1301
+ isSeparator
1302
+ } = _a,
1303
+ props = __rest(_a, ["title", "itemKey", "onClick", "isSeparator"]);
1304
+
1305
+ return isSeparator ? React.createElement(DropdownSeparator, Object.assign({}, props, {
1306
+ key: itemKey || key,
1307
+ "data-key": itemKey || key
1308
+ })) : React.createElement(DropdownItem, Object.assign({
1309
+ component: "button",
1310
+ onClick: event => {
1311
+ this.onClick(event, onClick);
1312
+ this.onToggle(!isOpen);
1313
+ }
1314
+ }, props, {
1315
+ key: itemKey || key,
1316
+ "data-key": itemKey || key
1317
+ }), title);
1318
+ }),
1319
+ isPlain: true
1320
+ }, rowData && rowData.actionProps)), children);
1321
+ }
1322
+
941
1323
  }
942
1324
  ActionsColumn.displayName = 'ActionsColumn';
943
1325
  ActionsColumn.defaultProps = {
944
- children: null,
945
- items: [],
946
- dropdownPosition: DropdownPosition.right,
947
- dropdownDirection: DropdownDirection.down,
948
- rowData: {},
949
- extraData: {}
1326
+ children: null,
1327
+ items: [],
1328
+ dropdownPosition: DropdownPosition.right,
1329
+ dropdownDirection: DropdownDirection.down,
1330
+ rowData: {},
1331
+ extraData: {}
950
1332
  };
951
1333
 
952
- const resolveOrDefault = (resolver, defaultValue, rowData, extraData) => (typeof resolver === 'function' ? resolver(rowData, extraData) : defaultValue);
953
- const cellActions = (actions, actionResolver, areActionsDisabled) => (label, { rowData, column, rowIndex, columnIndex, column: { extraParams: { dropdownPosition, dropdownDirection, actionsToggle } }, property }) => {
954
- const extraData = {
955
- rowIndex,
956
- columnIndex,
957
- column,
958
- property
959
- };
960
- const resolvedActions = resolveOrDefault(actionResolver, actions, rowData, extraData);
961
- const resolvedIsDisabled = resolveOrDefault(areActionsDisabled, rowData && rowData.disableActions, rowData, extraData);
962
- const renderProps = resolvedActions && resolvedActions.length > 0
963
- ? {
964
- children: (React.createElement(ActionsColumn, { items: resolvedActions, dropdownPosition: dropdownPosition, dropdownDirection: dropdownDirection, isDisabled: resolvedIsDisabled, rowData: rowData, extraData: extraData, actionsToggle: actionsToggle }, label))
965
- }
966
- : {};
967
- return Object.assign({ className: css(styles$1.tableAction), style: { paddingRight: 0 }, isVisible: true }, renderProps);
1334
+ const resolveOrDefault = (resolver, defaultValue, rowData, extraData) => typeof resolver === 'function' ? resolver(rowData, extraData) : defaultValue;
1335
+
1336
+ const cellActions = (actions, actionResolver, areActionsDisabled) => (label, {
1337
+ rowData,
1338
+ column,
1339
+ rowIndex,
1340
+ columnIndex,
1341
+ column: {
1342
+ extraParams: {
1343
+ dropdownPosition,
1344
+ dropdownDirection,
1345
+ actionsToggle
1346
+ }
1347
+ },
1348
+ property
1349
+ }) => {
1350
+ const extraData = {
1351
+ rowIndex,
1352
+ columnIndex,
1353
+ column,
1354
+ property
1355
+ };
1356
+ const resolvedActions = resolveOrDefault(actionResolver, actions, rowData, extraData);
1357
+ const resolvedIsDisabled = resolveOrDefault(areActionsDisabled, rowData && rowData.disableActions, rowData, extraData);
1358
+ const renderProps = resolvedActions && resolvedActions.length > 0 ? {
1359
+ children: React.createElement(ActionsColumn, {
1360
+ items: resolvedActions,
1361
+ dropdownPosition: dropdownPosition,
1362
+ dropdownDirection: dropdownDirection,
1363
+ isDisabled: resolvedIsDisabled,
1364
+ rowData: rowData,
1365
+ extraData: extraData,
1366
+ actionsToggle: actionsToggle
1367
+ }, label)
1368
+ } : {};
1369
+ return Object.assign({
1370
+ className: css(styles$1.tableAction),
1371
+ style: {
1372
+ paddingRight: 0
1373
+ },
1374
+ isVisible: true
1375
+ }, renderProps);
968
1376
  };
969
1377
 
970
- const compoundExpand = (value, { rowIndex, columnIndex, rowData, column, property }) => {
971
- if (!value) {
972
- return null;
973
- }
974
- const { title, props } = value;
975
- const { extraParams: { onExpand } } = column;
976
- const extraData = {
977
- rowIndex,
978
- columnIndex,
979
- column,
980
- property
981
- };
982
- /**
983
- * @param {React.MouseEvent} event - Mouse event
984
- */
985
- function onToggle(event) {
986
- // tslint:disable-next-line:no-unused-expression
987
- onExpand && onExpand(event, rowIndex, columnIndex, props.isOpen, rowData, extraData);
1378
+ const compoundExpand = (value, {
1379
+ rowIndex,
1380
+ columnIndex,
1381
+ rowData,
1382
+ column,
1383
+ property
1384
+ }) => {
1385
+ if (!value) {
1386
+ return null;
1387
+ }
1388
+
1389
+ const {
1390
+ title,
1391
+ props
1392
+ } = value;
1393
+ const {
1394
+ extraParams: {
1395
+ onExpand
988
1396
  }
989
- return {
990
- className: css(styles$1.tableCompoundExpansionToggle, props.isOpen && styles$1.modifiers.expanded),
991
- children: props.isOpen !== undefined && (React.createElement("button", { type: "button", className: css(styles$1.tableButton), onClick: onToggle, "aria-expanded": props.isOpen, "aria-controls": props.ariaControls },
992
- React.createElement(TableText, null, title)))
993
- };
1397
+ } = column;
1398
+ const extraData = {
1399
+ rowIndex,
1400
+ columnIndex,
1401
+ column,
1402
+ property
1403
+ };
1404
+ /**
1405
+ * @param {React.MouseEvent} event - Mouse event
1406
+ */
1407
+
1408
+ function onToggle(event) {
1409
+ // tslint:disable-next-line:no-unused-expression
1410
+ onExpand && onExpand(event, rowIndex, columnIndex, props.isOpen, rowData, extraData);
1411
+ }
1412
+
1413
+ return {
1414
+ className: css(styles$1.tableCompoundExpansionToggle, props.isOpen && styles$1.modifiers.expanded),
1415
+ children: props.isOpen !== undefined && React.createElement("button", {
1416
+ type: "button",
1417
+ className: css(styles$1.tableButton),
1418
+ onClick: onToggle,
1419
+ "aria-expanded": props.isOpen,
1420
+ "aria-controls": props.ariaControls
1421
+ }, React.createElement(TableText, null, title))
1422
+ };
994
1423
  };
995
1424
 
996
- const FavoritesCell = (_a) => {
997
- var { className = '', onFavorite, isFavorited, rowIndex } = _a, props = __rest(_a, ["className", "onFavorite", "isFavorited", "rowIndex"]);
998
- const ariaProps = rowIndex === undefined
999
- ? {}
1000
- : {
1001
- id: `favorites-button-${rowIndex}`,
1002
- 'aria-labelledby': `favorites-button-${rowIndex}`
1003
- };
1004
- return (React.createElement(Button$1, Object.assign({ variant: "plain", className: className, type: "button", "aria-label": isFavorited ? 'Starred' : 'Not starred', onClick: onFavorite }, ariaProps, props),
1005
- React.createElement(StarIcon$1, { "aria-hidden": true })));
1425
+ const FavoritesCell = _a => {
1426
+ var {
1427
+ className = '',
1428
+ onFavorite,
1429
+ isFavorited,
1430
+ rowIndex
1431
+ } = _a,
1432
+ props = __rest(_a, ["className", "onFavorite", "isFavorited", "rowIndex"]);
1433
+
1434
+ const ariaProps = rowIndex === undefined ? {} : {
1435
+ id: `favorites-button-${rowIndex}`,
1436
+ 'aria-labelledby': `favorites-button-${rowIndex}`
1437
+ };
1438
+ return React.createElement(Button$1, Object.assign({
1439
+ variant: "plain",
1440
+ className: className,
1441
+ type: "button",
1442
+ "aria-label": isFavorited ? 'Starred' : 'Not starred',
1443
+ onClick: onFavorite
1444
+ }, ariaProps, props), React.createElement(StarIcon$1, {
1445
+ "aria-hidden": true
1446
+ }));
1006
1447
  };
1007
1448
  FavoritesCell.displayName = 'FavoritesCell';
1008
1449
 
1009
- const favoritable = (value, { rowIndex, columnIndex, rowData, column, property }) => {
1010
- const { extraParams: { onFavorite } } = column;
1011
- const extraData = {
1012
- rowIndex,
1013
- columnIndex,
1014
- column,
1015
- property
1016
- };
1017
- // this is a child row which should not display the favorites icon
1018
- if (rowData && rowData.hasOwnProperty('parent') && !rowData.fullWidth) {
1019
- return {
1020
- component: 'td',
1021
- isVisible: true
1022
- };
1023
- }
1024
- /**
1025
- * @param {React.MouseEvent} event - Mouse event
1026
- */
1027
- function favoritesClick(event) {
1028
- // tslint:disable-next-line:no-unused-expression
1029
- onFavorite && onFavorite(event, rowData && !rowData.favorited, rowIndex, rowData, extraData);
1450
+ const favoritable = (value, {
1451
+ rowIndex,
1452
+ columnIndex,
1453
+ rowData,
1454
+ column,
1455
+ property
1456
+ }) => {
1457
+ const {
1458
+ extraParams: {
1459
+ onFavorite
1030
1460
  }
1031
- const additionalProps = rowData.favoritesProps || {};
1461
+ } = column;
1462
+ const extraData = {
1463
+ rowIndex,
1464
+ columnIndex,
1465
+ column,
1466
+ property
1467
+ }; // this is a child row which should not display the favorites icon
1468
+
1469
+ if (rowData && rowData.hasOwnProperty('parent') && !rowData.fullWidth) {
1032
1470
  return {
1033
- className: css(styles$1.tableFavorite, rowData && rowData.favorited && styles$1.modifiers.favorited),
1034
- isVisible: !rowData || !rowData.fullWidth,
1035
- children: (React.createElement(FavoritesCell, Object.assign({ rowIndex: rowIndex, onFavorite: favoritesClick, isFavorited: rowData && rowData.favorited }, additionalProps)))
1471
+ component: 'td',
1472
+ isVisible: true
1036
1473
  };
1474
+ }
1475
+ /**
1476
+ * @param {React.MouseEvent} event - Mouse event
1477
+ */
1478
+
1479
+
1480
+ function favoritesClick(event) {
1481
+ // tslint:disable-next-line:no-unused-expression
1482
+ onFavorite && onFavorite(event, rowData && !rowData.favorited, rowIndex, rowData, extraData);
1483
+ }
1484
+
1485
+ const additionalProps = rowData.favoritesProps || {};
1486
+ return {
1487
+ className: css(styles$1.tableFavorite, rowData && rowData.favorited && styles$1.modifiers.favorited),
1488
+ isVisible: !rowData || !rowData.fullWidth,
1489
+ children: React.createElement(FavoritesCell, Object.assign({
1490
+ rowIndex: rowIndex,
1491
+ onFavorite: favoritesClick,
1492
+ isFavorited: rowData && rowData.favorited
1493
+ }, additionalProps))
1494
+ };
1037
1495
  };
1038
1496
 
1039
1497
  const GripVerticalIconConfig = {
@@ -1042,26 +1500,45 @@ const GripVerticalIconConfig = {
1042
1500
  width: 320,
1043
1501
  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',
1044
1502
  yOffset: 0,
1045
- xOffset: 0,
1503
+ xOffset: 0
1046
1504
  };
1047
-
1048
- const GripVerticalIcon = createIcon$1(GripVerticalIconConfig);
1049
-
1505
+ const GripVerticalIcon = createIcon(GripVerticalIconConfig);
1050
1506
  var GripVerticalIcon$1 = GripVerticalIcon;
1051
1507
 
1052
- const DraggableCell = (_a) => {
1053
- var { className, onClick, 'aria-label': ariaLabel, id } = _a, props = __rest(_a, ["className", "onClick", 'aria-label', "id"]);
1054
- return (React.createElement(Button$1, Object.assign({ id: id, variant: "plain", className: className, type: "button", "aria-label": ariaLabel || `Draggable row draggable button`, onClick: onClick }, props),
1055
- React.createElement(GripVerticalIcon$1, { "aria-hidden": true })));
1508
+ const DraggableCell = _a => {
1509
+ var {
1510
+ className,
1511
+ onClick,
1512
+ 'aria-label': ariaLabel,
1513
+ id
1514
+ } = _a,
1515
+ props = __rest(_a, ["className", "onClick", 'aria-label', "id"]);
1516
+
1517
+ return React.createElement(Button$1, Object.assign({
1518
+ id: id,
1519
+ variant: "plain",
1520
+ className: className,
1521
+ type: "button",
1522
+ "aria-label": ariaLabel || `Draggable row draggable button`,
1523
+ onClick: onClick
1524
+ }, props), React.createElement(GripVerticalIcon$1, {
1525
+ "aria-hidden": true
1526
+ }));
1056
1527
  };
1057
1528
  DraggableCell.displayName = 'DraggableCell';
1058
1529
 
1059
- const draggable = (value, { rowData }) => {
1060
- const { id } = rowData;
1061
- return {
1062
- className: '',
1063
- children: React.createElement(DraggableCell, { id: id })
1064
- };
1530
+ const draggable = (value, {
1531
+ rowData
1532
+ }) => {
1533
+ const {
1534
+ id
1535
+ } = rowData;
1536
+ return {
1537
+ className: '',
1538
+ children: React.createElement(DraggableCell, {
1539
+ id: id
1540
+ })
1541
+ };
1065
1542
  };
1066
1543
 
1067
1544
  const EllipsisHIconConfig = {
@@ -1070,202 +1547,214 @@ const EllipsisHIconConfig = {
1070
1547
  width: 512,
1071
1548
  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',
1072
1549
  yOffset: 0,
1073
- xOffset: 0,
1550
+ xOffset: 0
1074
1551
  };
1075
-
1076
- const EllipsisHIcon = createIcon$1(EllipsisHIconConfig);
1077
-
1552
+ const EllipsisHIcon = createIcon(EllipsisHIconConfig);
1078
1553
  var EllipsisHIcon$1 = EllipsisHIcon;
1079
1554
 
1080
- const treeRow = (onCollapse, onCheckChange, onToggleRowDetails) => (value, { rowIndex, rowData }) => {
1081
- const { isExpanded, isDetailsExpanded, 'aria-level': level, 'aria-setsize': setsize, toggleAriaLabel, checkAriaLabel, showDetailsAriaLabel, isChecked, checkboxId, icon } = rowData.props;
1082
- const content = value.title || value;
1083
- const text = (React.createElement("div", { className: css(stylesTreeView.tableTreeViewText), key: "tree-view-text" },
1084
- icon && (React.createElement("span", { className: css(stylesTreeView.tableTreeViewIcon), key: "tree-view-text-icon" }, icon)),
1085
- React.createElement("span", { className: "pf-c-table__text", key: "table-text" }, content)));
1086
- const onChange = (isChecked, event) => {
1087
- onCheckChange(event, isChecked, rowIndex, content, rowData);
1088
- };
1089
- return {
1090
- component: 'th',
1091
- className: 'pf-c-table__tree-view-title-cell',
1092
- children: level !== undefined ? (React.createElement("div", { className: css(stylesTreeView.tableTreeViewMain) },
1093
- setsize > 0 && (React.createElement("span", { className: css(stylesTreeView.tableToggle), key: "table-toggle" },
1094
- React.createElement(Button, { variant: "plain", onClick: event => onCollapse && onCollapse(event, rowIndex, content, rowData), className: css(isExpanded && styles$1.modifiers.expanded), "aria-expanded": isExpanded, "aria-label": toggleAriaLabel || `${isExpanded ? 'Collapse' : 'Expand'} row ${rowIndex}` },
1095
- React.createElement("div", { className: css(stylesTreeView.tableToggleIcon) },
1096
- React.createElement(AngleDownIcon$1, { "aria-hidden": "true" }))))),
1097
- !!onCheckChange && (React.createElement("span", { className: css(stylesTreeView.tableCheck), key: "table-check" },
1098
- React.createElement("label", { htmlFor: checkboxId || `checkbox_${rowIndex}` },
1099
- React.createElement(Checkbox, { id: checkboxId || `checkbox_${rowIndex}`, "aria-label": checkAriaLabel || `Row ${rowIndex} checkbox`, isChecked: isChecked, onChange: onChange })))),
1100
- text,
1101
- !!onToggleRowDetails && (React.createElement("span", { className: css(stylesTreeView.tableTreeViewDetailsToggle), key: "view-details-toggle" },
1102
- React.createElement(Button, { variant: "plain", "aria-expanded": isDetailsExpanded, "aria-label": showDetailsAriaLabel || 'Show row details', onClick: event => onToggleRowDetails && onToggleRowDetails(event, rowIndex, content, rowData) },
1103
- React.createElement("span", { className: "pf-c-table__details-toggle-icon" },
1104
- React.createElement(EllipsisHIcon$1, { "aria-hidden": true }))))))) : (text)
1105
- };
1555
+ const treeRow = (onCollapse, onCheckChange, onToggleRowDetails) => (value, {
1556
+ rowIndex,
1557
+ rowData
1558
+ }) => {
1559
+ const {
1560
+ isExpanded,
1561
+ isDetailsExpanded,
1562
+ 'aria-level': level,
1563
+ 'aria-setsize': setsize,
1564
+ toggleAriaLabel,
1565
+ checkAriaLabel,
1566
+ showDetailsAriaLabel,
1567
+ isChecked,
1568
+ checkboxId,
1569
+ icon
1570
+ } = rowData.props;
1571
+ const content = value.title || value;
1572
+ const text = React.createElement("div", {
1573
+ className: css(stylesTreeView.tableTreeViewText),
1574
+ key: "tree-view-text"
1575
+ }, icon && React.createElement("span", {
1576
+ className: css(stylesTreeView.tableTreeViewIcon),
1577
+ key: "tree-view-text-icon"
1578
+ }, icon), React.createElement("span", {
1579
+ className: "pf-c-table__text",
1580
+ key: "table-text"
1581
+ }, content));
1582
+
1583
+ const onChange = (isChecked, event) => {
1584
+ onCheckChange(event, isChecked, rowIndex, content, rowData);
1585
+ };
1586
+
1587
+ return {
1588
+ component: 'th',
1589
+ className: 'pf-c-table__tree-view-title-cell',
1590
+ children: level !== undefined ? React.createElement("div", {
1591
+ className: css(stylesTreeView.tableTreeViewMain)
1592
+ }, setsize > 0 && React.createElement("span", {
1593
+ className: css(stylesTreeView.tableToggle),
1594
+ key: "table-toggle"
1595
+ }, React.createElement(Button, {
1596
+ variant: "plain",
1597
+ onClick: event => onCollapse && onCollapse(event, rowIndex, content, rowData),
1598
+ className: css(isExpanded && styles$1.modifiers.expanded),
1599
+ "aria-expanded": isExpanded,
1600
+ "aria-label": toggleAriaLabel || `${isExpanded ? 'Collapse' : 'Expand'} row ${rowIndex}`
1601
+ }, React.createElement("div", {
1602
+ className: css(stylesTreeView.tableToggleIcon)
1603
+ }, React.createElement(AngleDownIcon$1, {
1604
+ "aria-hidden": "true"
1605
+ })))), !!onCheckChange && React.createElement("span", {
1606
+ className: css(stylesTreeView.tableCheck),
1607
+ key: "table-check"
1608
+ }, React.createElement("label", {
1609
+ htmlFor: checkboxId || `checkbox_${rowIndex}`
1610
+ }, React.createElement(Checkbox, {
1611
+ id: checkboxId || `checkbox_${rowIndex}`,
1612
+ "aria-label": checkAriaLabel || `Row ${rowIndex} checkbox`,
1613
+ isChecked: isChecked,
1614
+ onChange: onChange
1615
+ }))), text, !!onToggleRowDetails && React.createElement("span", {
1616
+ className: css(stylesTreeView.tableTreeViewDetailsToggle),
1617
+ key: "view-details-toggle"
1618
+ }, React.createElement(Button, {
1619
+ variant: "plain",
1620
+ "aria-expanded": isDetailsExpanded,
1621
+ "aria-label": showDetailsAriaLabel || 'Show row details',
1622
+ onClick: event => onToggleRowDetails && onToggleRowDetails(event, rowIndex, content, rowData)
1623
+ }, React.createElement("span", {
1624
+ className: "pf-c-table__details-toggle-icon"
1625
+ }, React.createElement(EllipsisHIcon$1, {
1626
+ "aria-hidden": true
1627
+ }))))) : text
1628
+ };
1106
1629
  };
1107
1630
 
1108
- const TdBase = (_a) => {
1109
- var { children, className, isActionCell = false, component = 'td', dataLabel, textCenter = false, modifier, select = null, actions = null, expand = null, treeRow: treeRowProp = null, compoundExpand: compoundExpandProp = null, noPadding, width, visibility, innerRef, favorites = null, draggableRow: draggableRowProp = null } = _a, props = __rest(_a, ["children", "className", "isActionCell", "component", "dataLabel", "textCenter", "modifier", "select", "actions", "expand", "treeRow", "compoundExpand", "noPadding", "width", "visibility", "innerRef", "favorites", "draggableRow"]);
1110
- const selectParams = select
1111
- ? selectable(children, {
1112
- rowIndex: select.rowIndex,
1113
- rowData: {
1114
- selected: select.isSelected,
1115
- disableSelection: select === null || select === void 0 ? void 0 : select.disable,
1116
- props: select === null || select === void 0 ? void 0 : select.props
1117
- },
1118
- column: {
1119
- extraParams: {
1120
- onSelect: select === null || select === void 0 ? void 0 : select.onSelect,
1121
- selectVariant: select.variant || 'checkbox'
1122
- }
1123
- }
1124
- })
1125
- : null;
1126
- const favoriteParams = favorites
1127
- ? favoritable(null, {
1128
- rowIndex: favorites === null || favorites === void 0 ? void 0 : favorites.rowIndex,
1129
- rowData: {
1130
- favorited: favorites.isFavorited,
1131
- favoritesProps: favorites === null || favorites === void 0 ? void 0 : favorites.props
1132
- },
1133
- column: {
1134
- extraParams: {
1135
- onFavorite: favorites === null || favorites === void 0 ? void 0 : favorites.onFavorite
1136
- }
1137
- }
1138
- })
1139
- : null;
1140
- const draggableParams = draggableRowProp !== null
1141
- ? draggable(null, {
1142
- rowData: {
1143
- id: draggableRowProp.id
1144
- }
1145
- })
1146
- : null;
1147
- const actionParamsFunc = actions ? cellActions(actions.items, null, null) : null;
1148
- const actionParams = actionParamsFunc
1149
- ? actionParamsFunc(null, {
1150
- rowIndex: actions === null || actions === void 0 ? void 0 : actions.rowIndex,
1151
- rowData: {
1152
- disableActions: actions === null || actions === void 0 ? void 0 : actions.disable
1153
- },
1154
- column: {
1155
- extraParams: {
1156
- dropdownPosition: actions === null || actions === void 0 ? void 0 : actions.dropdownPosition,
1157
- dropdownDirection: actions === null || actions === void 0 ? void 0 : actions.dropdownDirection,
1158
- actionsToggle: actions === null || actions === void 0 ? void 0 : actions.actionsToggle
1159
- }
1160
- }
1161
- })
1162
- : null;
1163
- const expandableParams = expand !== null
1164
- ? collapsible(null, {
1165
- rowIndex: expand.rowIndex,
1166
- columnIndex: expand === null || expand === void 0 ? void 0 : expand.columnIndex,
1167
- rowData: {
1168
- isOpen: expand.isExpanded
1169
- },
1170
- column: {
1171
- extraParams: {
1172
- onCollapse: expand === null || expand === void 0 ? void 0 : expand.onToggle
1173
- }
1174
- }
1175
- })
1176
- : null;
1177
- const compoundParams = compoundExpandProp !== null
1178
- ? compoundExpand({
1179
- title: children,
1180
- props: {
1181
- isOpen: compoundExpandProp.isExpanded
1182
- }
1183
- }, {
1184
- column: {
1185
- extraParams: {
1186
- onExpand: compoundExpandProp === null || compoundExpandProp === void 0 ? void 0 : compoundExpandProp.onToggle
1187
- }
1188
- }
1189
- })
1190
- : null;
1191
- const widthParams = width ? cellWidth(width)() : null;
1192
- const visibilityParams = visibility
1193
- ? classNames(...visibility.map((vis) => Visibility[vis]))()
1194
- : null;
1195
- const treeRowParams = treeRowProp !== null
1196
- ? treeRow(treeRowProp.onCollapse, treeRowProp.onCheckChange, treeRowProp.onToggleRowDetails)({
1197
- title: children
1198
- }, {
1199
- rowIndex: treeRowProp.rowIndex,
1200
- rowData: {
1201
- props: treeRowProp.props
1202
- }
1203
- })
1204
- : null;
1205
- const merged = mergeProps(selectParams, actionParams, expandableParams, compoundParams, widthParams, visibilityParams, favoriteParams, treeRowParams, draggableParams);
1206
- const {
1631
+ const TdBase = _a => {
1632
+ var {
1633
+ children,
1634
+ className,
1635
+ isActionCell = false,
1636
+ component = 'td',
1637
+ dataLabel,
1638
+ textCenter = false,
1639
+ modifier,
1640
+ select = null,
1641
+ actions = null,
1642
+ expand = null,
1643
+ treeRow: treeRowProp = null,
1644
+ compoundExpand: compoundExpandProp = null,
1645
+ noPadding,
1646
+ width,
1647
+ visibility,
1648
+ innerRef,
1649
+ favorites = null,
1650
+ draggableRow: draggableRowProp = null
1651
+ } = _a,
1652
+ props = __rest(_a, ["children", "className", "isActionCell", "component", "dataLabel", "textCenter", "modifier", "select", "actions", "expand", "treeRow", "compoundExpand", "noPadding", "width", "visibility", "innerRef", "favorites", "draggableRow"]);
1653
+
1654
+ const selectParams = select ? selectable(children, {
1655
+ rowIndex: select.rowIndex,
1656
+ rowData: {
1657
+ selected: select.isSelected,
1658
+ disableSelection: select === null || select === void 0 ? void 0 : select.disable,
1659
+ props: select === null || select === void 0 ? void 0 : select.props
1660
+ },
1661
+ column: {
1662
+ extraParams: {
1663
+ onSelect: select === null || select === void 0 ? void 0 : select.onSelect,
1664
+ selectVariant: select.variant || 'checkbox'
1665
+ }
1666
+ }
1667
+ }) : null;
1668
+ const favoriteParams = favorites ? favoritable(null, {
1669
+ rowIndex: favorites === null || favorites === void 0 ? void 0 : favorites.rowIndex,
1670
+ rowData: {
1671
+ favorited: favorites.isFavorited,
1672
+ favoritesProps: favorites === null || favorites === void 0 ? void 0 : favorites.props
1673
+ },
1674
+ column: {
1675
+ extraParams: {
1676
+ onFavorite: favorites === null || favorites === void 0 ? void 0 : favorites.onFavorite
1677
+ }
1678
+ }
1679
+ }) : null;
1680
+ const draggableParams = draggableRowProp !== null ? draggable(null, {
1681
+ rowData: {
1682
+ id: draggableRowProp.id
1683
+ }
1684
+ }) : null;
1685
+ const actionParamsFunc = actions ? cellActions(actions.items, null, null) : null;
1686
+ const actionParams = actionParamsFunc ? actionParamsFunc(null, {
1687
+ rowIndex: actions === null || actions === void 0 ? void 0 : actions.rowIndex,
1688
+ rowData: {
1689
+ disableActions: actions === null || actions === void 0 ? void 0 : actions.disable
1690
+ },
1691
+ column: {
1692
+ extraParams: {
1693
+ dropdownPosition: actions === null || actions === void 0 ? void 0 : actions.dropdownPosition,
1694
+ dropdownDirection: actions === null || actions === void 0 ? void 0 : actions.dropdownDirection,
1695
+ actionsToggle: actions === null || actions === void 0 ? void 0 : actions.actionsToggle
1696
+ }
1697
+ }
1698
+ }) : null;
1699
+ const expandableParams = expand !== null ? collapsible(null, {
1700
+ rowIndex: expand.rowIndex,
1701
+ columnIndex: expand === null || expand === void 0 ? void 0 : expand.columnIndex,
1702
+ rowData: {
1703
+ isOpen: expand.isExpanded
1704
+ },
1705
+ column: {
1706
+ extraParams: {
1707
+ onCollapse: expand === null || expand === void 0 ? void 0 : expand.onToggle
1708
+ }
1709
+ }
1710
+ }) : null;
1711
+ const compoundParams = compoundExpandProp !== null ? compoundExpand({
1712
+ title: children,
1713
+ props: {
1714
+ isOpen: compoundExpandProp.isExpanded
1715
+ }
1716
+ }, {
1717
+ column: {
1718
+ extraParams: {
1719
+ onExpand: compoundExpandProp === null || compoundExpandProp === void 0 ? void 0 : compoundExpandProp.onToggle
1720
+ }
1721
+ }
1722
+ }) : null;
1723
+ const widthParams = width ? cellWidth(width)() : null;
1724
+ const visibilityParams = visibility ? classNames(...visibility.map(vis => Visibility[vis]))() : null;
1725
+ const treeRowParams = treeRowProp !== null ? treeRow(treeRowProp.onCollapse, treeRowProp.onCheckChange, treeRowProp.onToggleRowDetails)({
1726
+ title: children
1727
+ }, {
1728
+ rowIndex: treeRowProp.rowIndex,
1729
+ rowData: {
1730
+ props: treeRowProp.props
1731
+ }
1732
+ }) : null;
1733
+ const merged = mergeProps(selectParams, actionParams, expandableParams, compoundParams, widthParams, visibilityParams, favoriteParams, treeRowParams, draggableParams);
1734
+
1735
+ const {
1207
1736
  // selectable adds this but we don't want it
1208
1737
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1209
- isVisible = null, children: mergedChildren = null, className: mergedClassName = '', component: MergedComponent = component } = merged, mergedProps = __rest(merged, ["isVisible", "children", "className", "component"]);
1210
- const treeTableTitleCell = (className && className.includes('pf-c-table__tree-view-title-cell')) ||
1211
- (mergedClassName && mergedClassName.includes('pf-c-table__tree-view-title-cell'));
1212
- return (React.createElement(MergedComponent, Object.assign({}, (!treeTableTitleCell && { 'data-label': dataLabel }), { 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), ref: innerRef }, mergedProps, props), mergedChildren || children));
1738
+ isVisible = null,
1739
+ children: mergedChildren = null,
1740
+ className: mergedClassName = '',
1741
+ component: MergedComponent = component
1742
+ } = merged,
1743
+ mergedProps = __rest(merged, ["isVisible", "children", "className", "component"]);
1744
+
1745
+ const treeTableTitleCell = className && className.includes('pf-c-table__tree-view-title-cell') || mergedClassName && mergedClassName.includes('pf-c-table__tree-view-title-cell');
1746
+ return React.createElement(MergedComponent, Object.assign({}, !treeTableTitleCell && {
1747
+ 'data-label': dataLabel
1748
+ }, {
1749
+ 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),
1750
+ ref: innerRef
1751
+ }, mergedProps, props), mergedChildren || children);
1213
1752
  };
1214
- const Td = React.forwardRef((props, ref) => (React.createElement(TdBase, Object.assign({}, props, { innerRef: ref }))));
1215
- Td.displayName = 'Td';
1216
1753
 
1217
- var IconSize;
1218
- (function (IconSize) {
1219
- IconSize["sm"] = "sm";
1220
- IconSize["md"] = "md";
1221
- IconSize["lg"] = "lg";
1222
- IconSize["xl"] = "xl";
1223
- })(IconSize || (IconSize = {}));
1224
- const getSize = (size) => {
1225
- switch (size) {
1226
- case IconSize.sm:
1227
- return '1em';
1228
- case IconSize.md:
1229
- return '1.5em';
1230
- case IconSize.lg:
1231
- return '2em';
1232
- case IconSize.xl:
1233
- return '3em';
1234
- default:
1235
- return '1em';
1236
- }
1237
- };
1238
- let currentId = 0;
1239
- /**
1240
- * Factory to create Icon class components for consumers
1241
- */
1242
- function createIcon({ name, xOffset = 0, yOffset = 0, width, height, svgPath }) {
1243
- var _a;
1244
- return _a = class SVGIcon extends React.Component {
1245
- constructor() {
1246
- super(...arguments);
1247
- this.id = `icon-title-${currentId++}`;
1248
- }
1249
- render() {
1250
- const _a = this.props, { size, color, title, noVerticalAlign } = _a, props = __rest(_a, ["size", "color", "title", "noVerticalAlign"]);
1251
- const hasTitle = Boolean(title);
1252
- const heightWidth = getSize(size);
1253
- const baseAlign = -0.125 * Number.parseFloat(heightWidth);
1254
- const style = noVerticalAlign ? null : { verticalAlign: `${baseAlign}em` };
1255
- const viewBox = [xOffset, yOffset, width, height].join(' ');
1256
- return (React.createElement("svg", Object.assign({ style: style, fill: color, height: heightWidth, width: heightWidth, viewBox: viewBox, "aria-labelledby": hasTitle ? this.id : null, "aria-hidden": hasTitle ? null : true, role: "img" }, props),
1257
- hasTitle && React.createElement("title", { id: this.id }, title),
1258
- React.createElement("path", { d: svgPath })));
1259
- }
1260
- },
1261
- _a.displayName = name,
1262
- _a.defaultProps = {
1263
- color: 'currentColor',
1264
- size: IconSize.sm,
1265
- noVerticalAlign: false
1266
- },
1267
- _a;
1268
- }
1754
+ const Td = React.forwardRef((props, ref) => React.createElement(TdBase, Object.assign({}, props, {
1755
+ innerRef: ref
1756
+ })));
1757
+ Td.displayName = 'Td';
1269
1758
 
1270
1759
  const SearchIconConfig = {
1271
1760
  name: 'SearchIcon',
@@ -1273,9 +1762,8 @@ const SearchIconConfig = {
1273
1762
  width: 512,
1274
1763
  svgPath: 'M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z',
1275
1764
  yOffset: 0,
1276
- xOffset: 0,
1765
+ xOffset: 0
1277
1766
  };
1278
-
1279
1767
  const SearchIcon = createIcon(SearchIconConfig);
1280
1768
 
1281
1769
  const SecurityIconConfig = {
@@ -1284,9 +1772,8 @@ const SecurityIconConfig = {
1284
1772
  width: 896,
1285
1773
  svgPath: 'M861.5,0 L34.5,0 C15.4,0 0,14.3 0,32 L0,452.1 C0,768 387.7,1024 448.5,1024 C509.3,1024 896,768 896,452.2 L896,32 C896,14.3 880.6,0 861.5,0 Z M490.7,768 L405.3,768 C393.5,767.8 384.2,757.5 384,744.7 L384,663.3 C384.2,650.5 393.6,640.3 405.3,640 L490.7,640 C502.5,640.2 511.8,650.5 512,663.3 L512,744.7 L512.1,744.7 C511.8,757.5 502.4,767.8 490.7,768 Z M543.9,162.7 L517.2,514.4 C515.8,530.9 502,544 485.3,544 L410.6,544 C394,544 380.1,531.2 378.7,514.7 L352.1,163 C350.5,144.3 365.3,128.3 384,128.3 L512,128 C530.7,128 545.4,144 543.9,162.7 Z',
1286
1774
  yOffset: 0,
1287
- xOffset: 0,
1775
+ xOffset: 0
1288
1776
  };
1289
-
1290
1777
  const SecurityIcon = createIcon(SecurityIconConfig);
1291
1778
 
1292
1779
  const DEFAULT_PAGE = 1;
@@ -1789,17 +2276,33 @@ const PackagesTable = ({
1789
2276
  const uniqueVulnerabilities = [..._vulnerabilities]; // augment vulnerabilities with link data
1790
2277
 
1791
2278
  uniqueVulnerabilities.forEach(vulnerability => {
1792
- var _vulnerability$packag;
2279
+ vulnerability.rpm_nvra_with_link_data = []; // // CONNCERT-2121
1793
2280
 
1794
- vulnerability.rpm_nvra_with_link_data = [];
1795
- return vulnerability == null ? void 0 : (_vulnerability$packag = vulnerability.packages) == null ? void 0 : _vulnerability$packag.forEach(p => {
1796
- var _p$rpm_nvra;
2281
+ if (vulnerability != null && vulnerability.affected_packages) {
2282
+ var _vulnerability$affect;
1797
2283
 
1798
- return p == null ? void 0 : (_p$rpm_nvra = p.rpm_nvra) == null ? void 0 : _p$rpm_nvra.forEach(rpm_nvra => {
1799
- const link_data = _rpms == null ? void 0 : _rpms.filter(pk => pk.nvra === rpm_nvra);
2284
+ vulnerability == null ? void 0 : (_vulnerability$affect = vulnerability.affected_packages) == null ? void 0 : _vulnerability$affect.forEach(({
2285
+ name,
2286
+ version,
2287
+ arch
2288
+ }) => {
2289
+ const link_data = _rpms == null ? void 0 : _rpms.filter(rpm => rpm.name === name && rpm.version === version && rpm.architecture === arch);
1800
2290
  vulnerability.rpm_nvra_with_link_data.push(link_data[0]);
1801
2291
  });
1802
- });
2292
+ } else {
2293
+ var _vulnerability$packag;
2294
+
2295
+ vulnerability == null ? void 0 : (_vulnerability$packag = vulnerability.packages) == null ? void 0 : _vulnerability$packag.forEach(p => {
2296
+ var _p$rpm_nvra;
2297
+
2298
+ return p == null ? void 0 : (_p$rpm_nvra = p.rpm_nvra) == null ? void 0 : _p$rpm_nvra.forEach(rpm_nvra => {
2299
+ const link_data = _rpms == null ? void 0 : _rpms.filter(pk => pk.nvra === rpm_nvra);
2300
+ vulnerability.rpm_nvra_with_link_data.push(link_data[0]);
2301
+ });
2302
+ });
2303
+ }
2304
+
2305
+ return vulnerability;
1803
2306
  }); // sort vulnerabilities by severity
1804
2307
 
1805
2308
  uniqueVulnerabilities.sort(vulnerability => severitySortOrder[vulnerability.severity]); // filter out vulnerabilities with duplicate CVE IDs