@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.
- package/dist/index.js +1467 -864
- package/dist/index.modern.js +1340 -837
- package/package.json +1 -1
- /package/dist/{check-27d5ec91.js → check-293a8689.js} +0 -0
- /package/dist/{check-120c4f98.js → check-8277bc89.js} +0 -0
- /package/dist/{inline-edit-e7ffaa36.js → inline-edit-aba2c28a.js} +0 -0
- /package/dist/{inline-edit-5c45ab66.js → inline-edit-dea85160.js} +0 -0
- /package/dist/{table-76f2f3f9.js → table-68d022f9.js} +0 -0
- /package/dist/{table-468a84b2.js → table-ee2a086b.js} +0 -0
- /package/dist/{table-grid-06209f24.js → table-grid-5f08beb3.js} +0 -0
- /package/dist/{table-grid-f5923ae5.js → table-grid-be1510e7.js} +0 -0
- /package/dist/{table-scrollable-5eeb1c66.js → table-scrollable-08a401e0.js} +0 -0
- /package/dist/{table-scrollable-e0f500ba.js → table-scrollable-8d506d50.js} +0 -0
- /package/dist/{table-tree-view-650158c9.js → table-tree-view-248a6705.js} +0 -0
- /package/dist/{table-tree-view-121a2cdb.js → table-tree-view-c9374e2e.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -37,6 +37,22 @@ var mergeWith__default = /*#__PURE__*/_interopDefaultLegacy(mergeWith);
|
|
|
37
37
|
|
|
38
38
|
var css_248z = ".vulnerabilities-table .impact-icon {\n font-size: 1.5rem;\n padding-right: 0.5rem;\n}\n.vulnerabilities-table .impact-icon.color-critical {\n color: #a30000;\n}\n.vulnerabilities-table .impact-icon.color-important {\n color: #ec7a08;\n}\n.vulnerabilities-table .impact-icon.color-moderate {\n color: #f5c12e;\n}\n.vulnerabilities-table .impact-icon.color-low {\n color: #777;\n}\n.vulnerabilities-table__affected-packages-cell {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n.vulnerabilities-table__impact-cell {\n display: flex;\n align-items: center;\n flex-wrap: nowrap;\n}\n\n.filterable-table {\n padding-bottom: var(--pf-global--spacer--lg);\n}\n.filterable-table__bottom-pagination[class] {\n margin-top: 1rem;\n}\n.filterable-table .pf-c-toolbar {\n padding-top: 0;\n}\n.filterable-table .pf-c-toolbar__content {\n --pf-c-toolbar__content--PaddingRight: 0;\n --pf-c-toolbar__content--PaddingLeft: 0;\n}\n.filterable-table .pf-c-input-group__text {\n --pf-c-input-group__text--PaddingRight: 0;\n}\n.filterable-table .pf-c-pagination.pf-m-bottom {\n --pf-c-pagination--m-bottom--md--PaddingRight: 0;\n}\n\n.packages-table .pf-c-tabs__item > button {\n padding: 1rem 1.5rem;\n}\n.packages-table__excluded-packages-disclaimer {\n margin: 1rem 0 0 0.5rem;\n}\n\n.filter-input {\n width: 18rem;\n margin: 1rem 0 1rem 0;\n}";
|
|
39
39
|
|
|
40
|
+
function _inheritsLoose(subClass, superClass) {
|
|
41
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
42
|
+
subClass.prototype.constructor = subClass;
|
|
43
|
+
|
|
44
|
+
_setPrototypeOf(subClass, superClass);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function _setPrototypeOf(o, p) {
|
|
48
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
49
|
+
o.__proto__ = p;
|
|
50
|
+
return o;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
return _setPrototypeOf(o, p);
|
|
54
|
+
}
|
|
55
|
+
|
|
40
56
|
/*! *****************************************************************************
|
|
41
57
|
Copyright (c) Microsoft Corporation.
|
|
42
58
|
|
|
@@ -64,7 +80,7 @@ function __rest(s, e) {
|
|
|
64
80
|
return t;
|
|
65
81
|
}
|
|
66
82
|
|
|
67
|
-
Promise.resolve().then(function () { return require('./inline-edit-
|
|
83
|
+
Promise.resolve().then(function () { return require('./inline-edit-aba2c28a.js'); });
|
|
68
84
|
var inlineStyles = {
|
|
69
85
|
"button": "pf-c-button",
|
|
70
86
|
"inlineEdit": "pf-c-inline-edit",
|
|
@@ -92,33 +108,33 @@ var inlineStyles = {
|
|
|
92
108
|
*
|
|
93
109
|
* @param {any} args list of objects, string, or arrays to reduce
|
|
94
110
|
*/
|
|
95
|
-
function css(
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
}
|
|
111
|
+
function css() {
|
|
112
|
+
// Adapted from https://github.com/JedWatson/classnames/blob/master/index.js
|
|
113
|
+
var classes = [];
|
|
114
|
+
var hasOwn = {}.hasOwnProperty;
|
|
115
|
+
[].slice.call(arguments).filter(Boolean).forEach(function (arg) {
|
|
116
|
+
var argType = typeof arg;
|
|
117
|
+
|
|
118
|
+
if (argType === 'string' || argType === 'number') {
|
|
119
|
+
classes.push(arg);
|
|
120
|
+
} else if (Array.isArray(arg) && arg.length) {
|
|
121
|
+
var inner = css.apply(void 0, arg);
|
|
122
|
+
|
|
123
|
+
if (inner) {
|
|
124
|
+
classes.push(inner);
|
|
125
|
+
}
|
|
126
|
+
} else if (argType === 'object') {
|
|
127
|
+
for (var key in arg) {
|
|
128
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
129
|
+
classes.push(key);
|
|
116
130
|
}
|
|
117
|
-
|
|
118
|
-
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
return classes.join(' ');
|
|
119
135
|
}
|
|
120
136
|
|
|
121
|
-
Promise.resolve().then(function () { return require('./table-
|
|
137
|
+
Promise.resolve().then(function () { return require('./table-ee2a086b.js'); });
|
|
122
138
|
var styles$1 = {
|
|
123
139
|
"button": "pf-c-button",
|
|
124
140
|
"modifiers": {
|
|
@@ -199,7 +215,7 @@ var styles$1 = {
|
|
|
199
215
|
"themeDark": "pf-theme-dark"
|
|
200
216
|
};
|
|
201
217
|
|
|
202
|
-
Promise.resolve().then(function () { return require('./table-grid-
|
|
218
|
+
Promise.resolve().then(function () { return require('./table-grid-be1510e7.js'); });
|
|
203
219
|
var stylesGrid = {
|
|
204
220
|
"button": "pf-c-button",
|
|
205
221
|
"modifiers": {
|
|
@@ -232,7 +248,7 @@ var stylesGrid = {
|
|
|
232
248
|
"tableToggleIcon": "pf-c-table__toggle-icon"
|
|
233
249
|
};
|
|
234
250
|
|
|
235
|
-
Promise.resolve().then(function () { return require('./table-tree-view-
|
|
251
|
+
Promise.resolve().then(function () { return require('./table-tree-view-248a6705.js'); });
|
|
236
252
|
var stylesTreeView = {
|
|
237
253
|
"dropdown": "pf-c-dropdown",
|
|
238
254
|
"modifiers": {
|
|
@@ -257,142 +273,288 @@ var stylesTreeView = {
|
|
|
257
273
|
"tableTreeViewTitleHeaderCell": "pf-c-table__tree-view-title-header-cell"
|
|
258
274
|
};
|
|
259
275
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
276
|
+
var camelize = function camelize(s) {
|
|
277
|
+
return s.toUpperCase().replace('-', '').replace('_', '');
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
var toCamel = function toCamel(s) {
|
|
281
|
+
return s.replace(/([-_][a-z])/gi, camelize);
|
|
282
|
+
};
|
|
265
283
|
/**
|
|
266
284
|
* @param {string} input - String to capitalize
|
|
267
285
|
*/
|
|
286
|
+
|
|
268
287
|
function capitalize(input) {
|
|
269
|
-
|
|
288
|
+
return input[0].toUpperCase() + input.substring(1);
|
|
270
289
|
}
|
|
271
290
|
|
|
272
291
|
var TableGridBreakpoint;
|
|
292
|
+
|
|
273
293
|
(function (TableGridBreakpoint) {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
294
|
+
TableGridBreakpoint["none"] = "";
|
|
295
|
+
TableGridBreakpoint["grid"] = "grid";
|
|
296
|
+
TableGridBreakpoint["gridMd"] = "grid-md";
|
|
297
|
+
TableGridBreakpoint["gridLg"] = "grid-lg";
|
|
298
|
+
TableGridBreakpoint["gridXl"] = "grid-xl";
|
|
299
|
+
TableGridBreakpoint["grid2xl"] = "grid-2xl";
|
|
280
300
|
})(TableGridBreakpoint || (TableGridBreakpoint = {}));
|
|
301
|
+
|
|
281
302
|
var TableVariant;
|
|
303
|
+
|
|
282
304
|
(function (TableVariant) {
|
|
283
|
-
|
|
305
|
+
TableVariant["compact"] = "compact";
|
|
284
306
|
})(TableVariant || (TableVariant = {}));
|
|
285
307
|
|
|
286
|
-
|
|
287
|
-
|
|
308
|
+
var TableComposableContext = React__namespace.createContext({
|
|
309
|
+
registerSelectableRow: function registerSelectableRow() {}
|
|
288
310
|
});
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
311
|
+
|
|
312
|
+
var TableComposableBase = function TableComposableBase(_a) {
|
|
313
|
+
var _b, _c;
|
|
314
|
+
|
|
315
|
+
var children = _a.children,
|
|
316
|
+
className = _a.className,
|
|
317
|
+
variant = _a.variant,
|
|
318
|
+
_a$borders = _a.borders,
|
|
319
|
+
borders = _a$borders === void 0 ? true : _a$borders,
|
|
320
|
+
_a$isStickyHeader = _a.isStickyHeader,
|
|
321
|
+
isStickyHeader = _a$isStickyHeader === void 0 ? false : _a$isStickyHeader,
|
|
322
|
+
_a$gridBreakPoint = _a.gridBreakPoint,
|
|
323
|
+
gridBreakPoint = _a$gridBreakPoint === void 0 ? TableGridBreakpoint.gridMd : _a$gridBreakPoint,
|
|
324
|
+
ariaLabel = _a['aria-label'],
|
|
325
|
+
_a$role = _a.role,
|
|
326
|
+
role = _a$role === void 0 ? 'grid' : _a$role,
|
|
327
|
+
innerRef = _a.innerRef,
|
|
328
|
+
ouiaId = _a.ouiaId,
|
|
329
|
+
_a$ouiaSafe = _a.ouiaSafe,
|
|
330
|
+
ouiaSafe = _a$ouiaSafe === void 0 ? true : _a$ouiaSafe,
|
|
331
|
+
_a$isTreeTable = _a.isTreeTable,
|
|
332
|
+
isTreeTable = _a$isTreeTable === void 0 ? false : _a$isTreeTable,
|
|
333
|
+
_a$isNested = _a.isNested,
|
|
334
|
+
isNested = _a$isNested === void 0 ? false : _a$isNested,
|
|
335
|
+
_a$isStriped = _a.isStriped,
|
|
336
|
+
isStriped = _a$isStriped === void 0 ? false : _a$isStriped,
|
|
337
|
+
_a$isExpandable = _a.isExpandable,
|
|
338
|
+
isExpandable = _a$isExpandable === void 0 ? false : _a$isExpandable,
|
|
339
|
+
hasSelectableRowCaption = _a.hasSelectableRowCaption,
|
|
340
|
+
selectableRowCaptionText = _a.selectableRowCaptionText,
|
|
341
|
+
props = __rest(_a, ["children", "className", "variant", "borders", "isStickyHeader", "gridBreakPoint", 'aria-label', "role", "innerRef", "ouiaId", "ouiaSafe", "isTreeTable", "isNested", "isStriped", "isExpandable", "nestedHeaderColumnSpans", "hasSelectableRowCaption", "selectableRowCaptionText"]);
|
|
342
|
+
|
|
343
|
+
var tableRef = innerRef || React__namespace.useRef(null);
|
|
344
|
+
|
|
345
|
+
var _React$useState = React__namespace.useState(false),
|
|
346
|
+
hasSelectableRows = _React$useState[0],
|
|
347
|
+
setHasSelectableRows = _React$useState[1];
|
|
348
|
+
|
|
349
|
+
var _React$useState2 = React__namespace.useState(),
|
|
350
|
+
tableCaption = _React$useState2[0],
|
|
351
|
+
setTableCaption = _React$useState2[1];
|
|
352
|
+
|
|
353
|
+
React__namespace.useEffect(function () {
|
|
354
|
+
document.addEventListener('keydown', handleKeys); // sets up roving tab-index to tree tables only
|
|
355
|
+
|
|
356
|
+
if (tableRef && tableRef.current && tableRef.current.classList.contains('pf-m-tree-view')) {
|
|
357
|
+
var tbody = tableRef.current.querySelector('tbody');
|
|
358
|
+
tbody && reactCore.setTabIndex(Array.from(tbody.querySelectorAll('button, a, input')));
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
return function cleanup() {
|
|
362
|
+
document.removeEventListener('keydown', handleKeys);
|
|
337
363
|
};
|
|
338
|
-
|
|
339
|
-
|
|
364
|
+
}, [tableRef, tableRef.current]);
|
|
365
|
+
React__namespace.useEffect(function () {
|
|
366
|
+
if (selectableRowCaptionText) {
|
|
367
|
+
setTableCaption(React__namespace.createElement("caption", null, selectableRowCaptionText, React__namespace.createElement("div", {
|
|
368
|
+
className: "pf-screen-reader"
|
|
369
|
+
}, "This table has selectable rows. It can be navigated by row using tab, and each row can be selected using space or enter.")));
|
|
370
|
+
} else {
|
|
371
|
+
setTableCaption(React__namespace.createElement("caption", {
|
|
372
|
+
className: "pf-screen-reader"
|
|
373
|
+
}, "This table has selectable rows. It can be navigated by row using tab, and each row can be selected using space or enter."));
|
|
374
|
+
}
|
|
375
|
+
}, [selectableRowCaptionText]);
|
|
376
|
+
var ouiaProps = reactCore.useOUIAProps('Table', ouiaId, ouiaSafe);
|
|
377
|
+
var grid = (_b = stylesGrid.modifiers) === null || _b === void 0 ? void 0 : _b[toCamel(gridBreakPoint || '').replace(/-?2xl/, '_2xl')];
|
|
378
|
+
var breakPointPrefix = "treeView" + (gridBreakPoint.charAt(0).toUpperCase() + gridBreakPoint.slice(1));
|
|
379
|
+
var treeGrid = (_c = stylesTreeView.modifiers) === null || _c === void 0 ? void 0 : _c[toCamel(breakPointPrefix || '').replace(/-?2xl/, '_2xl')];
|
|
380
|
+
|
|
381
|
+
var handleKeys = function handleKeys(event) {
|
|
382
|
+
if (isNested || !(tableRef && tableRef.current && tableRef.current.classList.contains('pf-m-tree-view')) || // implements roving tab-index to tree tables only
|
|
383
|
+
tableRef && tableRef.current !== event.target.closest('.pf-c-table:not(.pf-m-nested)')) {
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
var activeElement = document.activeElement;
|
|
388
|
+
var key = event.key;
|
|
389
|
+
var rows = Array.from(tableRef.current.querySelectorAll('tbody tr')).filter(function (el) {
|
|
390
|
+
return !el.classList.contains('pf-m-disabled') && !el.hidden;
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
if (key === 'Space' || key === 'Enter') {
|
|
394
|
+
activeElement.click();
|
|
395
|
+
event.preventDefault();
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
var getFocusableElement = function getFocusableElement(element) {
|
|
399
|
+
return element.querySelectorAll('button:not(:disabled), input:not(:disabled), a:not(:disabled)')[0];
|
|
340
400
|
};
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
401
|
+
|
|
402
|
+
reactCore.handleArrows(event, rows, function (element) {
|
|
403
|
+
return element === activeElement.closest('tr');
|
|
404
|
+
}, getFocusableElement, ['button', 'input', 'a'], undefined, false, true, false);
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
var registerSelectableRow = function registerSelectableRow() {
|
|
408
|
+
!hasSelectableRows && setHasSelectableRows(true);
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
return React__namespace.createElement(TableComposableContext.Provider, {
|
|
412
|
+
value: {
|
|
413
|
+
registerSelectableRow: registerSelectableRow
|
|
414
|
+
}
|
|
415
|
+
}, React__namespace.createElement("table", Object.assign({
|
|
416
|
+
"aria-label": ariaLabel,
|
|
417
|
+
role: role,
|
|
418
|
+
className: css(className, styles$1.table, isTreeTable ? treeGrid : grid, styles$1.modifiers[variant], !borders && styles$1.modifiers.noBorderRows, isStickyHeader && styles$1.modifiers.stickyHeader, isTreeTable && stylesTreeView.modifiers.treeView, isStriped && styles$1.modifiers.striped, isExpandable && styles$1.modifiers.expandable, isNested && 'pf-m-nested'),
|
|
419
|
+
ref: tableRef
|
|
420
|
+
}, isTreeTable && {
|
|
421
|
+
role: 'treegrid'
|
|
422
|
+
}, ouiaProps, props), hasSelectableRowCaption && hasSelectableRows && tableCaption, children));
|
|
345
423
|
};
|
|
346
|
-
|
|
424
|
+
|
|
425
|
+
var TableComposable = React__namespace.forwardRef(function (props, ref) {
|
|
426
|
+
return React__namespace.createElement(TableComposableBase, Object.assign({}, props, {
|
|
427
|
+
innerRef: ref
|
|
428
|
+
}));
|
|
429
|
+
});
|
|
347
430
|
TableComposable.displayName = 'TableComposable';
|
|
348
431
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
432
|
+
var TheadBase = function TheadBase(_a) {
|
|
433
|
+
var children = _a.children,
|
|
434
|
+
className = _a.className,
|
|
435
|
+
_a$noWrap = _a.noWrap,
|
|
436
|
+
noWrap = _a$noWrap === void 0 ? false : _a$noWrap,
|
|
437
|
+
innerRef = _a.innerRef,
|
|
438
|
+
hasNestedHeader = _a.hasNestedHeader,
|
|
439
|
+
props = __rest(_a, ["children", "className", "noWrap", "innerRef", "hasNestedHeader"]);
|
|
440
|
+
|
|
441
|
+
return React__namespace.createElement("thead", Object.assign({
|
|
442
|
+
className: css(className, noWrap && styles$1.modifiers.nowrap, hasNestedHeader && styles$1.modifiers.nestedColumnHeader),
|
|
443
|
+
ref: innerRef
|
|
444
|
+
}, props), children);
|
|
352
445
|
};
|
|
353
|
-
|
|
446
|
+
|
|
447
|
+
var Thead = React__namespace.forwardRef(function (props, ref) {
|
|
448
|
+
return React__namespace.createElement(TheadBase, Object.assign({}, props, {
|
|
449
|
+
innerRef: ref
|
|
450
|
+
}));
|
|
451
|
+
});
|
|
354
452
|
Thead.displayName = 'Thead';
|
|
355
453
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
454
|
+
var TbodyBase = function TbodyBase(_a) {
|
|
455
|
+
var children = _a.children,
|
|
456
|
+
className = _a.className,
|
|
457
|
+
isExpanded = _a.isExpanded,
|
|
458
|
+
innerRef = _a.innerRef,
|
|
459
|
+
_a$isEvenStriped = _a.isEvenStriped,
|
|
460
|
+
isEvenStriped = _a$isEvenStriped === void 0 ? false : _a$isEvenStriped,
|
|
461
|
+
_a$isOddStriped = _a.isOddStriped,
|
|
462
|
+
isOddStriped = _a$isOddStriped === void 0 ? false : _a$isOddStriped,
|
|
463
|
+
props = __rest(_a, ["children", "className", "isExpanded", "innerRef", "isEvenStriped", "isOddStriped"]);
|
|
464
|
+
|
|
465
|
+
return React__namespace.createElement("tbody", Object.assign({
|
|
466
|
+
role: "rowgroup",
|
|
467
|
+
className: css(className, isExpanded && styles$1.modifiers.expanded, isOddStriped && styles$1.modifiers.striped, isEvenStriped && styles$1.modifiers.stripedEven),
|
|
468
|
+
ref: innerRef
|
|
469
|
+
}, props), children);
|
|
359
470
|
};
|
|
360
|
-
|
|
471
|
+
|
|
472
|
+
var Tbody = React__namespace.forwardRef(function (props, ref) {
|
|
473
|
+
return React__namespace.createElement(TbodyBase, Object.assign({}, props, {
|
|
474
|
+
innerRef: ref
|
|
475
|
+
}));
|
|
476
|
+
});
|
|
361
477
|
Tbody.displayName = 'Tbody';
|
|
362
478
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
479
|
+
var TrBase = function TrBase(_a) {
|
|
480
|
+
var children = _a.children,
|
|
481
|
+
className = _a.className,
|
|
482
|
+
isExpanded = _a.isExpanded,
|
|
483
|
+
isEditable = _a.isEditable,
|
|
484
|
+
_a$isHidden = _a.isHidden,
|
|
485
|
+
isHidden = _a$isHidden === void 0 ? false : _a$isHidden,
|
|
486
|
+
_a$isHoverable = _a.isHoverable,
|
|
487
|
+
isHoverable = _a$isHoverable === void 0 ? false : _a$isHoverable,
|
|
488
|
+
_a$isRowSelected = _a.isRowSelected,
|
|
489
|
+
isRowSelected = _a$isRowSelected === void 0 ? false : _a$isRowSelected,
|
|
490
|
+
_a$isStriped = _a.isStriped,
|
|
491
|
+
isStriped = _a$isStriped === void 0 ? false : _a$isStriped,
|
|
492
|
+
innerRef = _a.innerRef,
|
|
493
|
+
ouiaId = _a.ouiaId,
|
|
494
|
+
_a$ouiaSafe = _a.ouiaSafe,
|
|
495
|
+
ouiaSafe = _a$ouiaSafe === void 0 ? true : _a$ouiaSafe,
|
|
496
|
+
_a$resetOffset = _a.resetOffset,
|
|
497
|
+
resetOffset = _a$resetOffset === void 0 ? false : _a$resetOffset,
|
|
498
|
+
onRowClick = _a.onRowClick,
|
|
499
|
+
isSelectable = _a.isSelectable,
|
|
500
|
+
passedAriaLabel = _a['aria-label'],
|
|
501
|
+
props = __rest(_a, ["children", "className", "isExpanded", "isEditable", "isHidden", "isHoverable", "isRowSelected", "isStriped", "innerRef", "ouiaId", "ouiaSafe", "resetOffset", "onRowClick", "isSelectable", 'aria-label']);
|
|
502
|
+
|
|
503
|
+
var ouiaProps = reactCore.useOUIAProps('TableRow', ouiaId, ouiaSafe);
|
|
504
|
+
|
|
505
|
+
var _React$useState = React__namespace.useState(''),
|
|
506
|
+
computedAriaLabel = _React$useState[0],
|
|
507
|
+
setComputedAriaLabel = _React$useState[1];
|
|
508
|
+
|
|
509
|
+
var onKeyDown = null;
|
|
510
|
+
|
|
511
|
+
if (onRowClick) {
|
|
512
|
+
onKeyDown = function onKeyDown(e) {
|
|
513
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
514
|
+
onRowClick(e);
|
|
515
|
+
e.preventDefault();
|
|
516
|
+
}
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
var rowIsHidden = isHidden || isExpanded !== undefined && !isExpanded;
|
|
521
|
+
|
|
522
|
+
var _React$useContext = React__namespace.useContext(TableComposableContext),
|
|
523
|
+
registerSelectableRow = _React$useContext.registerSelectableRow;
|
|
524
|
+
|
|
525
|
+
React__namespace.useEffect(function () {
|
|
526
|
+
if (isSelectable && !rowIsHidden) {
|
|
527
|
+
setComputedAriaLabel((isRowSelected ? 'Selected' : 'Unselected') + ", selectable row.");
|
|
528
|
+
registerSelectableRow();
|
|
529
|
+
} else {
|
|
530
|
+
setComputedAriaLabel(undefined);
|
|
375
531
|
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
532
|
+
}, [isRowSelected, isSelectable, registerSelectableRow, rowIsHidden]);
|
|
533
|
+
var ariaLabel = passedAriaLabel || computedAriaLabel;
|
|
534
|
+
return React__namespace.createElement(React__namespace.Fragment, null, isSelectable && React__namespace.createElement("output", {
|
|
535
|
+
className: "pf-screen-reader"
|
|
536
|
+
}, ariaLabel), React__namespace.createElement("tr", Object.assign({
|
|
537
|
+
className: css(className, isExpanded !== undefined && styles$1.tableExpandableRow, isExpanded && styles$1.modifiers.expanded, isEditable && inlineStyles.modifiers.inlineEditable, isHoverable && styles$1.modifiers.hoverable, isRowSelected && styles$1.modifiers.selected, isStriped && styles$1.modifiers.striped, resetOffset && styles$1.modifiers.firstCellOffsetReset),
|
|
538
|
+
hidden: rowIsHidden
|
|
539
|
+
}, isHoverable && {
|
|
540
|
+
tabIndex: 0
|
|
541
|
+
}, {
|
|
542
|
+
"aria-label": ariaLabel,
|
|
543
|
+
ref: innerRef
|
|
544
|
+
}, onRowClick && {
|
|
545
|
+
onClick: onRowClick,
|
|
546
|
+
onKeyDown: onKeyDown
|
|
547
|
+
}, ouiaProps, props), children));
|
|
391
548
|
};
|
|
392
|
-
|
|
549
|
+
|
|
550
|
+
var Tr = React__namespace.forwardRef(function (props, ref) {
|
|
551
|
+
return React__namespace.createElement(TrBase, Object.assign({}, props, {
|
|
552
|
+
innerRef: ref
|
|
553
|
+
}));
|
|
554
|
+
});
|
|
393
555
|
Tr.displayName = 'Tr';
|
|
394
556
|
|
|
395
|
-
Promise.resolve().then(function () { return require('./table-scrollable-
|
|
557
|
+
Promise.resolve().then(function () { return require('./table-scrollable-8d506d50.js'); });
|
|
396
558
|
var styles = {
|
|
397
559
|
"modifiers": {
|
|
398
560
|
"borderRight": "pf-m-border-right",
|
|
@@ -405,251 +567,407 @@ var styles = {
|
|
|
405
567
|
"tableStickyColumn": "pf-c-table__sticky-column"
|
|
406
568
|
};
|
|
407
569
|
|
|
408
|
-
var IconSize
|
|
570
|
+
var IconSize;
|
|
571
|
+
|
|
409
572
|
(function (IconSize) {
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
})(IconSize
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
573
|
+
IconSize["sm"] = "sm";
|
|
574
|
+
IconSize["md"] = "md";
|
|
575
|
+
IconSize["lg"] = "lg";
|
|
576
|
+
IconSize["xl"] = "xl";
|
|
577
|
+
})(IconSize || (IconSize = {}));
|
|
578
|
+
|
|
579
|
+
var getSize = function getSize(size) {
|
|
580
|
+
switch (size) {
|
|
581
|
+
case IconSize.sm:
|
|
582
|
+
return '1em';
|
|
583
|
+
|
|
584
|
+
case IconSize.md:
|
|
585
|
+
return '1.5em';
|
|
586
|
+
|
|
587
|
+
case IconSize.lg:
|
|
588
|
+
return '2em';
|
|
589
|
+
|
|
590
|
+
case IconSize.xl:
|
|
591
|
+
return '3em';
|
|
592
|
+
|
|
593
|
+
default:
|
|
594
|
+
return '1em';
|
|
595
|
+
}
|
|
428
596
|
};
|
|
429
|
-
|
|
597
|
+
var currentId = 0;
|
|
430
598
|
/**
|
|
431
599
|
* Factory to create Icon class components for consumers
|
|
432
600
|
*/
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
601
|
+
|
|
602
|
+
function createIcon(_ref) {
|
|
603
|
+
var name = _ref.name,
|
|
604
|
+
_ref$xOffset = _ref.xOffset,
|
|
605
|
+
xOffset = _ref$xOffset === void 0 ? 0 : _ref$xOffset,
|
|
606
|
+
_ref$yOffset = _ref.yOffset,
|
|
607
|
+
yOffset = _ref$yOffset === void 0 ? 0 : _ref$yOffset,
|
|
608
|
+
width = _ref.width,
|
|
609
|
+
height = _ref.height,
|
|
610
|
+
svgPath = _ref.svgPath;
|
|
611
|
+
|
|
612
|
+
var _a;
|
|
613
|
+
|
|
614
|
+
return _a = /*#__PURE__*/function (_React$Component) {
|
|
615
|
+
_inheritsLoose(SVGIcon, _React$Component);
|
|
616
|
+
|
|
617
|
+
function SVGIcon() {
|
|
618
|
+
var _this;
|
|
619
|
+
|
|
620
|
+
_this = _React$Component.apply(this, arguments) || this;
|
|
621
|
+
_this.id = "icon-title-" + currentId++;
|
|
622
|
+
return _this;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
var _proto = SVGIcon.prototype;
|
|
626
|
+
|
|
627
|
+
_proto.render = function render() {
|
|
628
|
+
var _a = this.props,
|
|
629
|
+
size = _a.size,
|
|
630
|
+
color = _a.color,
|
|
631
|
+
title = _a.title,
|
|
632
|
+
noVerticalAlign = _a.noVerticalAlign,
|
|
633
|
+
props = __rest(_a, ["size", "color", "title", "noVerticalAlign"]);
|
|
634
|
+
|
|
635
|
+
var hasTitle = Boolean(title);
|
|
636
|
+
var heightWidth = getSize(size);
|
|
637
|
+
var baseAlign = -0.125 * Number.parseFloat(heightWidth);
|
|
638
|
+
var style = noVerticalAlign ? null : {
|
|
639
|
+
verticalAlign: baseAlign + "em"
|
|
640
|
+
};
|
|
641
|
+
var viewBox = [xOffset, yOffset, width, height].join(' ');
|
|
642
|
+
return React__namespace.createElement("svg", Object.assign({
|
|
643
|
+
style: style,
|
|
644
|
+
fill: color,
|
|
645
|
+
height: heightWidth,
|
|
646
|
+
width: heightWidth,
|
|
647
|
+
viewBox: viewBox,
|
|
648
|
+
"aria-labelledby": hasTitle ? this.id : null,
|
|
649
|
+
"aria-hidden": hasTitle ? null : true,
|
|
650
|
+
role: "img"
|
|
651
|
+
}, props), hasTitle && React__namespace.createElement("title", {
|
|
652
|
+
id: this.id
|
|
653
|
+
}, title), React__namespace.createElement("path", {
|
|
654
|
+
d: svgPath
|
|
655
|
+
}));
|
|
656
|
+
};
|
|
657
|
+
|
|
658
|
+
return SVGIcon;
|
|
659
|
+
}(React__namespace.Component), _a.displayName = name, _a.defaultProps = {
|
|
660
|
+
color: 'currentColor',
|
|
661
|
+
size: IconSize.sm,
|
|
662
|
+
noVerticalAlign: false
|
|
663
|
+
}, _a;
|
|
459
664
|
}
|
|
460
665
|
|
|
461
|
-
|
|
666
|
+
var HelpIconConfig = {
|
|
462
667
|
name: 'HelpIcon',
|
|
463
668
|
height: 1024,
|
|
464
669
|
width: 1024,
|
|
465
670
|
svgPath: 'M521.3,576 C627.5,576 713.7,502 713.7,413.7 C713.7,325.4 627.6,253.6 521.3,253.6 C366,253.6 334.5,337.7 329.2,407.2 C329.2,414.3 335.2,416 343.5,416 L445,416 C450.5,416 458,415.5 460.8,406.5 C460.8,362.6 582.9,357.1 582.9,413.6 C582.9,441.9 556.2,470.9 521.3,473 C486.4,475.1 447.3,479.8 447.3,521.7 L447.3,553.8 C447.3,570.8 456.1,576 472,576 C487.9,576 521.3,576 521.3,576 M575.3,751.3 L575.3,655.3 C575.313862,651.055109 573.620137,646.982962 570.6,644 C567.638831,640.947672 563.552355,639.247987 559.3,639.29884 L463.3,639.29884 C459.055109,639.286138 454.982962,640.979863 452,644 C448.947672,646.961169 447.247987,651.047645 447.29884,655.3 L447.29884,751.3 C447.286138,755.544891 448.979863,759.617038 452,762.6 C454.961169,765.652328 459.047645,767.352013 463.3,767.30116 L559.3,767.30116 C563.544891,767.313862 567.617038,765.620137 570.6,762.6 C573.659349,759.643612 575.360354,755.553963 575.3,751.3 M512,896 C300.2,896 128,723.9 128,512 C128,300.3 300.2,128 512,128 C723.8,128 896,300.2 896,512 C896,723.8 723.7,896 512,896 M512.1,0 C229.7,0 0,229.8 0,512 C0,794.2 229.8,1024 512.1,1024 C794.4,1024 1024,794.3 1024,512 C1024,229.7 794.4,0 512.1,0',
|
|
466
671
|
yOffset: 0,
|
|
467
|
-
xOffset: 0
|
|
672
|
+
xOffset: 0
|
|
468
673
|
};
|
|
469
|
-
|
|
470
|
-
const HelpIcon = createIcon$1(HelpIconConfig);
|
|
471
|
-
|
|
674
|
+
var HelpIcon = createIcon(HelpIconConfig);
|
|
472
675
|
var HelpIcon$1 = HelpIcon;
|
|
473
676
|
|
|
474
677
|
var TableTextVariant;
|
|
678
|
+
|
|
475
679
|
(function (TableTextVariant) {
|
|
476
|
-
|
|
477
|
-
|
|
680
|
+
TableTextVariant["div"] = "div";
|
|
681
|
+
TableTextVariant["nav"] = "nav";
|
|
478
682
|
})(TableTextVariant || (TableTextVariant = {}));
|
|
683
|
+
|
|
479
684
|
var WrapModifier;
|
|
685
|
+
|
|
480
686
|
(function (WrapModifier) {
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
687
|
+
WrapModifier["wrap"] = "wrap";
|
|
688
|
+
WrapModifier["nowrap"] = "nowrap";
|
|
689
|
+
WrapModifier["truncate"] = "truncate";
|
|
690
|
+
WrapModifier["breakWord"] = "breakWord";
|
|
691
|
+
WrapModifier["fitContent"] = "fitContent";
|
|
486
692
|
})(WrapModifier || (WrapModifier = {}));
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
693
|
+
|
|
694
|
+
var TableText = function TableText(_a) {
|
|
695
|
+
var _a$children = _a.children,
|
|
696
|
+
children = _a$children === void 0 ? null : _a$children,
|
|
697
|
+
_a$className = _a.className,
|
|
698
|
+
className = _a$className === void 0 ? '' : _a$className,
|
|
699
|
+
_a$variant = _a.variant,
|
|
700
|
+
variant = _a$variant === void 0 ? 'span' : _a$variant,
|
|
701
|
+
_a$wrapModifier = _a.wrapModifier,
|
|
702
|
+
wrapModifier = _a$wrapModifier === void 0 ? null : _a$wrapModifier,
|
|
703
|
+
_a$tooltip = _a.tooltip,
|
|
704
|
+
tooltipProp = _a$tooltip === void 0 ? '' : _a$tooltip,
|
|
705
|
+
_a$tooltipProps = _a.tooltipProps,
|
|
706
|
+
tooltipProps = _a$tooltipProps === void 0 ? {} : _a$tooltipProps,
|
|
707
|
+
_a$onMouseEnter = _a.onMouseEnter,
|
|
708
|
+
onMouseEnterProp = _a$onMouseEnter === void 0 ? function () {} : _a$onMouseEnter,
|
|
709
|
+
props = __rest(_a, ["children", "className", "variant", "wrapModifier", "tooltip", "tooltipProps", "onMouseEnter"]);
|
|
710
|
+
|
|
711
|
+
var Component = variant;
|
|
712
|
+
|
|
713
|
+
var _React$useState = React__namespace.useState(''),
|
|
714
|
+
tooltip = _React$useState[0],
|
|
715
|
+
setTooltip = _React$useState[1];
|
|
716
|
+
|
|
717
|
+
var onMouseEnter = function onMouseEnter(event) {
|
|
718
|
+
if (event.target.offsetWidth < event.target.scrollWidth) {
|
|
719
|
+
setTooltip(tooltipProp || event.target.innerText);
|
|
720
|
+
} else {
|
|
721
|
+
setTooltip('');
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
onMouseEnterProp(event);
|
|
725
|
+
};
|
|
726
|
+
|
|
727
|
+
var text = React__namespace.createElement(Component, Object.assign({
|
|
728
|
+
onMouseEnter: onMouseEnter,
|
|
729
|
+
className: css(className, wrapModifier && styles$1.modifiers[wrapModifier], styles$1.tableText)
|
|
730
|
+
}, props), children);
|
|
731
|
+
return tooltip !== '' ? React__namespace.createElement(Tooltip.Tooltip, Object.assign({
|
|
732
|
+
content: tooltip,
|
|
733
|
+
isVisible: true
|
|
734
|
+
}, tooltipProps), text) : text;
|
|
502
735
|
};
|
|
503
736
|
TableText.displayName = 'TableText';
|
|
504
737
|
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
738
|
+
var HeaderCellInfoWrapper = function HeaderCellInfoWrapper(_ref) {
|
|
739
|
+
var children = _ref.children,
|
|
740
|
+
info = _ref.info,
|
|
741
|
+
className = _ref.className,
|
|
742
|
+
_ref$variant = _ref.variant,
|
|
743
|
+
variant = _ref$variant === void 0 ? 'tooltip' : _ref$variant,
|
|
744
|
+
popoverProps = _ref.popoverProps,
|
|
745
|
+
tooltipProps = _ref.tooltipProps,
|
|
746
|
+
ariaLabel = _ref.ariaLabel;
|
|
747
|
+
return React__namespace.createElement("div", {
|
|
748
|
+
className: css(styles$1.tableColumnHelp, className)
|
|
749
|
+
}, typeof children === 'string' ? React__namespace.createElement(TableText, null, children) : children, React__namespace.createElement("span", {
|
|
750
|
+
className: css(styles$1.tableColumnHelpAction)
|
|
751
|
+
}, variant === 'tooltip' ? React__namespace.createElement(reactCore.Tooltip, Object.assign({
|
|
752
|
+
content: info
|
|
753
|
+
}, tooltipProps), React__namespace.createElement(reactCore.Button, {
|
|
754
|
+
variant: "plain",
|
|
755
|
+
"aria-label": ariaLabel || typeof info === 'string' && info || 'More info'
|
|
756
|
+
}, React__namespace.createElement(HelpIcon$1, {
|
|
757
|
+
noVerticalAlign: true
|
|
758
|
+
}))) : React__namespace.createElement(reactCore.Popover, Object.assign({
|
|
759
|
+
bodyContent: info
|
|
760
|
+
}, popoverProps), React__namespace.createElement(reactCore.Button, {
|
|
761
|
+
variant: "plain",
|
|
762
|
+
"aria-label": ariaLabel || typeof info === 'string' && info || 'More info'
|
|
763
|
+
}, React__namespace.createElement(HelpIcon$1, {
|
|
764
|
+
noVerticalAlign: true
|
|
765
|
+
})))));
|
|
766
|
+
};
|
|
512
767
|
HeaderCellInfoWrapper.displayName = 'HeaderCellInfoWrapper';
|
|
513
768
|
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
769
|
+
var info = function info(_ref) {
|
|
770
|
+
var tooltip = _ref.tooltip,
|
|
771
|
+
tooltipProps = _ref.tooltipProps,
|
|
772
|
+
popover = _ref.popover,
|
|
773
|
+
popoverProps = _ref.popoverProps,
|
|
774
|
+
className = _ref.className,
|
|
775
|
+
ariaLabel = _ref.ariaLabel;
|
|
776
|
+
|
|
777
|
+
var infoObj = function infoObj(value) {
|
|
778
|
+
return {
|
|
779
|
+
className: styles$1.modifiers.help,
|
|
780
|
+
children: tooltip ? React__namespace.createElement(HeaderCellInfoWrapper, {
|
|
781
|
+
variant: "tooltip",
|
|
782
|
+
info: tooltip,
|
|
783
|
+
tooltipProps: tooltipProps,
|
|
784
|
+
ariaLabel: ariaLabel,
|
|
785
|
+
className: className
|
|
786
|
+
}, value) : React__namespace.createElement(HeaderCellInfoWrapper, {
|
|
787
|
+
variant: "popover",
|
|
788
|
+
info: popover,
|
|
789
|
+
popoverProps: popoverProps,
|
|
790
|
+
ariaLabel: ariaLabel,
|
|
791
|
+
className: className
|
|
792
|
+
}, value)
|
|
793
|
+
};
|
|
794
|
+
};
|
|
795
|
+
|
|
796
|
+
return infoObj;
|
|
520
797
|
};
|
|
521
798
|
|
|
522
|
-
|
|
799
|
+
var LongArrowAltUpIconConfig = {
|
|
523
800
|
name: 'LongArrowAltUpIcon',
|
|
524
801
|
height: 512,
|
|
525
802
|
width: 256,
|
|
526
803
|
svgPath: 'M88 166.059V468c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12V166.059h46.059c21.382 0 32.09-25.851 16.971-40.971l-86.059-86.059c-9.373-9.373-24.569-9.373-33.941 0l-86.059 86.059c-15.119 15.119-4.411 40.971 16.971 40.971H88z',
|
|
527
804
|
yOffset: 0,
|
|
528
|
-
xOffset: 0
|
|
805
|
+
xOffset: 0
|
|
529
806
|
};
|
|
530
|
-
|
|
531
|
-
const LongArrowAltUpIcon = createIcon$1(LongArrowAltUpIconConfig);
|
|
532
|
-
|
|
807
|
+
var LongArrowAltUpIcon = createIcon(LongArrowAltUpIconConfig);
|
|
533
808
|
var LongArrowAltUpIcon$1 = LongArrowAltUpIcon;
|
|
534
809
|
|
|
535
|
-
|
|
810
|
+
var LongArrowAltDownIconConfig = {
|
|
536
811
|
name: 'LongArrowAltDownIcon',
|
|
537
812
|
height: 512,
|
|
538
813
|
width: 256,
|
|
539
814
|
svgPath: 'M168 345.941V44c0-6.627-5.373-12-12-12h-56c-6.627 0-12 5.373-12 12v301.941H41.941c-21.382 0-32.09 25.851-16.971 40.971l86.059 86.059c9.373 9.373 24.569 9.373 33.941 0l86.059-86.059c15.119-15.119 4.411-40.971-16.971-40.971H168z',
|
|
540
815
|
yOffset: 0,
|
|
541
|
-
xOffset: 0
|
|
816
|
+
xOffset: 0
|
|
542
817
|
};
|
|
543
|
-
|
|
544
|
-
const LongArrowAltDownIcon = createIcon$1(LongArrowAltDownIconConfig);
|
|
545
|
-
|
|
818
|
+
var LongArrowAltDownIcon = createIcon(LongArrowAltDownIconConfig);
|
|
546
819
|
var LongArrowAltDownIcon$1 = LongArrowAltDownIcon;
|
|
547
820
|
|
|
548
|
-
|
|
821
|
+
var ArrowsAltVIconConfig = {
|
|
549
822
|
name: 'ArrowsAltVIcon',
|
|
550
823
|
height: 512,
|
|
551
824
|
width: 256,
|
|
552
825
|
svgPath: 'M214.059 377.941H168V134.059h46.059c21.382 0 32.09-25.851 16.971-40.971L144.971 7.029c-9.373-9.373-24.568-9.373-33.941 0L24.971 93.088c-15.119 15.119-4.411 40.971 16.971 40.971H88v243.882H41.941c-21.382 0-32.09 25.851-16.971 40.971l86.059 86.059c9.373 9.373 24.568 9.373 33.941 0l86.059-86.059c15.12-15.119 4.412-40.971-16.97-40.971z',
|
|
553
826
|
yOffset: 0,
|
|
554
|
-
xOffset: 0
|
|
827
|
+
xOffset: 0
|
|
555
828
|
};
|
|
556
|
-
|
|
557
|
-
const ArrowsAltVIcon = createIcon$1(ArrowsAltVIconConfig);
|
|
558
|
-
|
|
829
|
+
var ArrowsAltVIcon = createIcon(ArrowsAltVIconConfig);
|
|
559
830
|
var ArrowsAltVIcon$1 = ArrowsAltVIcon;
|
|
560
831
|
|
|
561
832
|
var SortByDirection;
|
|
833
|
+
|
|
562
834
|
(function (SortByDirection) {
|
|
563
|
-
|
|
564
|
-
|
|
835
|
+
SortByDirection["asc"] = "asc";
|
|
836
|
+
SortByDirection["desc"] = "desc";
|
|
565
837
|
})(SortByDirection || (SortByDirection = {}));
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
838
|
+
|
|
839
|
+
var SortColumn = function SortColumn(_a) {
|
|
840
|
+
var _a$children = _a.children,
|
|
841
|
+
children = _a$children === void 0 ? null : _a$children,
|
|
842
|
+
_a$className = _a.className,
|
|
843
|
+
className = _a$className === void 0 ? '' : _a$className,
|
|
844
|
+
_a$isSortedBy = _a.isSortedBy,
|
|
845
|
+
isSortedBy = _a$isSortedBy === void 0 ? false : _a$isSortedBy,
|
|
846
|
+
_a$onSort = _a.onSort,
|
|
847
|
+
onSort = _a$onSort === void 0 ? null : _a$onSort,
|
|
848
|
+
_a$sortDirection = _a.sortDirection,
|
|
849
|
+
sortDirection = _a$sortDirection === void 0 ? '' : _a$sortDirection,
|
|
850
|
+
_a$type = _a.type,
|
|
851
|
+
type = _a$type === void 0 ? 'button' : _a$type,
|
|
852
|
+
props = __rest(_a, ["children", "className", "isSortedBy", "onSort", "sortDirection", "type"]);
|
|
853
|
+
|
|
854
|
+
var SortedByIcon;
|
|
855
|
+
|
|
856
|
+
if (isSortedBy) {
|
|
857
|
+
SortedByIcon = sortDirection === SortByDirection.asc ? LongArrowAltUpIcon$1 : LongArrowAltDownIcon$1;
|
|
858
|
+
} else {
|
|
859
|
+
SortedByIcon = ArrowsAltVIcon$1;
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
return React__namespace.createElement("button", Object.assign({}, props, {
|
|
863
|
+
type: type,
|
|
864
|
+
className: css(className, styles$1.tableButton),
|
|
865
|
+
onClick: function onClick(event) {
|
|
866
|
+
return onSort && onSort(event);
|
|
574
867
|
}
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
868
|
+
}), React__namespace.createElement("div", {
|
|
869
|
+
className: css(className, styles$1.tableButtonContent)
|
|
870
|
+
}, React__namespace.createElement(TableText, null, children), React__namespace.createElement("span", {
|
|
871
|
+
className: css(styles$1.tableSortIndicator)
|
|
872
|
+
}, React__namespace.createElement(SortedByIcon, null))));
|
|
580
873
|
};
|
|
581
874
|
SortColumn.displayName = 'SortColumn';
|
|
582
875
|
|
|
583
|
-
|
|
876
|
+
var StarIconConfig = {
|
|
584
877
|
name: 'StarIcon',
|
|
585
878
|
height: 512,
|
|
586
879
|
width: 576,
|
|
587
880
|
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',
|
|
588
881
|
yOffset: 0,
|
|
589
|
-
xOffset: 0
|
|
882
|
+
xOffset: 0
|
|
590
883
|
};
|
|
591
|
-
|
|
592
|
-
const StarIcon = createIcon$1(StarIconConfig);
|
|
593
|
-
|
|
884
|
+
var StarIcon = createIcon(StarIconConfig);
|
|
594
885
|
var StarIcon$1 = StarIcon;
|
|
595
886
|
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
887
|
+
var sortableFavorites = function sortableFavorites(sort) {
|
|
888
|
+
return function () {
|
|
889
|
+
return sortable(React__namespace.createElement(StarIcon$1, {
|
|
890
|
+
"aria-hidden": true
|
|
891
|
+
}), {
|
|
892
|
+
columnIndex: sort.columnIndex,
|
|
893
|
+
className: styles$1.modifiers.favorite,
|
|
894
|
+
ariaLabel: 'Sort favorites',
|
|
895
|
+
column: {
|
|
601
896
|
extraParams: {
|
|
602
|
-
|
|
603
|
-
|
|
897
|
+
sortBy: sort.sortBy,
|
|
898
|
+
onSort: sort === null || sort === void 0 ? void 0 : sort.onSort
|
|
604
899
|
}
|
|
605
|
-
|
|
606
|
-
});
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
}
|
|
900
|
+
}
|
|
901
|
+
});
|
|
902
|
+
};
|
|
903
|
+
};
|
|
904
|
+
var sortable = function sortable(label, _ref) {
|
|
905
|
+
var columnIndex = _ref.columnIndex,
|
|
906
|
+
column = _ref.column,
|
|
907
|
+
property = _ref.property,
|
|
908
|
+
className = _ref.className,
|
|
909
|
+
ariaLabel = _ref.ariaLabel;
|
|
910
|
+
var _column$extraParams = column.extraParams,
|
|
911
|
+
sortBy = _column$extraParams.sortBy,
|
|
912
|
+
onSort = _column$extraParams.onSort;
|
|
913
|
+
var extraData = {
|
|
914
|
+
columnIndex: columnIndex,
|
|
915
|
+
column: column,
|
|
916
|
+
property: property
|
|
917
|
+
};
|
|
918
|
+
var isSortedBy = sortBy && columnIndex === sortBy.index;
|
|
919
|
+
/**
|
|
920
|
+
* @param {React.MouseEvent} event - React mouse event
|
|
921
|
+
*/
|
|
922
|
+
|
|
923
|
+
function sortClicked(event) {
|
|
924
|
+
var reversedDirection;
|
|
925
|
+
|
|
926
|
+
if (!isSortedBy) {
|
|
927
|
+
reversedDirection = sortBy.defaultDirection ? sortBy.defaultDirection : SortByDirection.asc;
|
|
928
|
+
} else {
|
|
929
|
+
reversedDirection = sortBy.direction === SortByDirection.asc ? SortByDirection.desc : SortByDirection.asc;
|
|
930
|
+
} // tslint:disable-next-line:no-unused-expression
|
|
931
|
+
|
|
932
|
+
|
|
933
|
+
onSort && onSort(event, columnIndex, reversedDirection, extraData);
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
return {
|
|
937
|
+
className: css(styles$1.tableSort, isSortedBy && styles$1.modifiers.selected, className),
|
|
938
|
+
'aria-sort': isSortedBy ? sortBy.direction + "ending" : 'none',
|
|
939
|
+
children: React__namespace.createElement(SortColumn, {
|
|
940
|
+
isSortedBy: isSortedBy,
|
|
941
|
+
sortDirection: isSortedBy ? sortBy.direction : '',
|
|
942
|
+
onSort: sortClicked,
|
|
943
|
+
"aria-label": ariaLabel
|
|
944
|
+
}, label)
|
|
945
|
+
};
|
|
634
946
|
};
|
|
635
947
|
|
|
636
948
|
var RowSelectVariant;
|
|
949
|
+
|
|
637
950
|
(function (RowSelectVariant) {
|
|
638
|
-
|
|
639
|
-
|
|
951
|
+
RowSelectVariant["radio"] = "radio";
|
|
952
|
+
RowSelectVariant["checkbox"] = "checkbox";
|
|
640
953
|
})(RowSelectVariant || (RowSelectVariant = {}));
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
954
|
+
|
|
955
|
+
var SelectColumn = function SelectColumn(_a) {
|
|
956
|
+
var _a$children = _a.children,
|
|
957
|
+
children = _a$children === void 0 ? null : _a$children,
|
|
958
|
+
_a$onSelect = _a.onSelect,
|
|
959
|
+
onSelect = _a$onSelect === void 0 ? null : _a$onSelect,
|
|
960
|
+
selectVariant = _a.selectVariant,
|
|
961
|
+
props = __rest(_a, ["children", "className", "onSelect", "selectVariant"]);
|
|
962
|
+
|
|
963
|
+
return React__namespace.createElement(React__namespace.Fragment, null, React__namespace.createElement("label", null, React__namespace.createElement("input", Object.assign({}, props, {
|
|
964
|
+
type: selectVariant,
|
|
965
|
+
onChange: onSelect
|
|
966
|
+
}))), children);
|
|
649
967
|
};
|
|
650
968
|
SelectColumn.displayName = 'SelectColumn';
|
|
651
969
|
|
|
652
|
-
Promise.resolve().then(function () { return require('./check-
|
|
970
|
+
Promise.resolve().then(function () { return require('./check-293a8689.js'); });
|
|
653
971
|
var checkStyles = {
|
|
654
972
|
"check": "pf-c-check",
|
|
655
973
|
"checkBody": "pf-c-check__body",
|
|
@@ -662,140 +980,180 @@ var checkStyles = {
|
|
|
662
980
|
}
|
|
663
981
|
};
|
|
664
982
|
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
const selected = rowIndex === undefined ? event.currentTarget.checked : rowData && !rowData.selected;
|
|
685
|
-
// tslint:disable-next-line:no-unused-expression
|
|
686
|
-
onSelect && onSelect(event, selected, rowId, rowData, extraData);
|
|
687
|
-
}
|
|
688
|
-
const customProps = Object.assign(Object.assign(Object.assign({}, (rowId !== -1
|
|
689
|
-
? {
|
|
690
|
-
checked: rowData && !!rowData.selected,
|
|
691
|
-
'aria-label': `Select row ${rowIndex}`
|
|
692
|
-
}
|
|
693
|
-
: {
|
|
694
|
-
checked: allRowsSelected,
|
|
695
|
-
'aria-label': 'Select all rows'
|
|
696
|
-
})), (rowData &&
|
|
697
|
-
(rowData.disableCheckbox || rowData.disableSelection) && {
|
|
698
|
-
disabled: true,
|
|
699
|
-
className: checkStyles.checkInput
|
|
700
|
-
})), (!rowData && isHeaderSelectDisabled && { disabled: true }));
|
|
701
|
-
let selectName = 'check-all';
|
|
702
|
-
if (rowId !== -1 && selectVariant === RowSelectVariant.checkbox) {
|
|
703
|
-
selectName = `checkrow${rowIndex}`;
|
|
704
|
-
}
|
|
705
|
-
else if (rowId !== -1) {
|
|
706
|
-
selectName = 'radioGroup';
|
|
707
|
-
}
|
|
983
|
+
var selectable = function selectable(label, _ref) {
|
|
984
|
+
var rowIndex = _ref.rowIndex,
|
|
985
|
+
columnIndex = _ref.columnIndex,
|
|
986
|
+
rowData = _ref.rowData,
|
|
987
|
+
column = _ref.column,
|
|
988
|
+
property = _ref.property;
|
|
989
|
+
var _column$extraParams = column.extraParams,
|
|
990
|
+
onSelect = _column$extraParams.onSelect,
|
|
991
|
+
selectVariant = _column$extraParams.selectVariant,
|
|
992
|
+
allRowsSelected = _column$extraParams.allRowsSelected,
|
|
993
|
+
isHeaderSelectDisabled = _column$extraParams.isHeaderSelectDisabled;
|
|
994
|
+
var extraData = {
|
|
995
|
+
rowIndex: rowIndex,
|
|
996
|
+
columnIndex: columnIndex,
|
|
997
|
+
column: column,
|
|
998
|
+
property: property
|
|
999
|
+
};
|
|
1000
|
+
|
|
1001
|
+
if (rowData && rowData.hasOwnProperty('parent') && !rowData.showSelect && !rowData.fullWidth) {
|
|
708
1002
|
return {
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
isVisible: !rowData || !rowData.fullWidth,
|
|
712
|
-
children: (React__namespace.createElement(SelectColumn, Object.assign({}, customProps, { selectVariant: selectVariant, onSelect: selectClick, name: selectName }), label))
|
|
1003
|
+
component: 'td',
|
|
1004
|
+
isVisible: true
|
|
713
1005
|
};
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
var rowId = rowIndex !== undefined ? rowIndex : -1;
|
|
1009
|
+
/**
|
|
1010
|
+
* @param {React.FormEvent} event - React form event
|
|
1011
|
+
*/
|
|
1012
|
+
|
|
1013
|
+
function selectClick(event) {
|
|
1014
|
+
var selected = rowIndex === undefined ? event.currentTarget.checked : rowData && !rowData.selected; // tslint:disable-next-line:no-unused-expression
|
|
1015
|
+
|
|
1016
|
+
onSelect && onSelect(event, selected, rowId, rowData, extraData);
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
var customProps = Object.assign(Object.assign(Object.assign({}, rowId !== -1 ? {
|
|
1020
|
+
checked: rowData && !!rowData.selected,
|
|
1021
|
+
'aria-label': "Select row " + rowIndex
|
|
1022
|
+
} : {
|
|
1023
|
+
checked: allRowsSelected,
|
|
1024
|
+
'aria-label': 'Select all rows'
|
|
1025
|
+
}), rowData && (rowData.disableCheckbox || rowData.disableSelection) && {
|
|
1026
|
+
disabled: true,
|
|
1027
|
+
className: checkStyles.checkInput
|
|
1028
|
+
}), !rowData && isHeaderSelectDisabled && {
|
|
1029
|
+
disabled: true
|
|
1030
|
+
});
|
|
1031
|
+
var selectName = 'check-all';
|
|
1032
|
+
|
|
1033
|
+
if (rowId !== -1 && selectVariant === RowSelectVariant.checkbox) {
|
|
1034
|
+
selectName = "checkrow" + rowIndex;
|
|
1035
|
+
} else if (rowId !== -1) {
|
|
1036
|
+
selectName = 'radioGroup';
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
return {
|
|
1040
|
+
className: css(styles$1.tableCheck),
|
|
1041
|
+
component: 'td',
|
|
1042
|
+
isVisible: !rowData || !rowData.fullWidth,
|
|
1043
|
+
children: React__namespace.createElement(SelectColumn, Object.assign({}, customProps, {
|
|
1044
|
+
selectVariant: selectVariant,
|
|
1045
|
+
onSelect: selectClick,
|
|
1046
|
+
name: selectName
|
|
1047
|
+
}), label)
|
|
1048
|
+
};
|
|
714
1049
|
};
|
|
715
1050
|
|
|
716
|
-
|
|
1051
|
+
var AngleDownIconConfig = {
|
|
717
1052
|
name: 'AngleDownIcon',
|
|
718
1053
|
height: 512,
|
|
719
1054
|
width: 320,
|
|
720
1055
|
svgPath: 'M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z',
|
|
721
1056
|
yOffset: 0,
|
|
722
|
-
xOffset: 0
|
|
1057
|
+
xOffset: 0
|
|
723
1058
|
};
|
|
724
|
-
|
|
725
|
-
const AngleDownIcon = createIcon$1(AngleDownIconConfig);
|
|
726
|
-
|
|
1059
|
+
var AngleDownIcon = createIcon(AngleDownIconConfig);
|
|
727
1060
|
var AngleDownIcon$1 = AngleDownIcon;
|
|
728
1061
|
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
1062
|
+
var CollapseColumn = function CollapseColumn(_a) {
|
|
1063
|
+
var _a$className = _a.className,
|
|
1064
|
+
className = _a$className === void 0 ? '' : _a$className,
|
|
1065
|
+
_a$children = _a.children,
|
|
1066
|
+
children = _a$children === void 0 ? null : _a$children,
|
|
1067
|
+
isOpen = _a.isOpen,
|
|
1068
|
+
onToggle = _a.onToggle,
|
|
1069
|
+
props = __rest(_a, ["className", "children", "isOpen", "onToggle"]);
|
|
1070
|
+
|
|
1071
|
+
return React__namespace.createElement(React__namespace.Fragment, null, isOpen !== undefined && React__namespace.createElement(Button.Button, Object.assign({
|
|
1072
|
+
className: css(className, isOpen && styles$1.modifiers.expanded)
|
|
1073
|
+
}, props, {
|
|
1074
|
+
variant: "plain",
|
|
1075
|
+
"aria-label": props['aria-label'] || 'Details',
|
|
1076
|
+
onClick: onToggle,
|
|
1077
|
+
"aria-expanded": isOpen
|
|
1078
|
+
}), React__namespace.createElement("div", {
|
|
1079
|
+
className: css(styles$1.tableToggleIcon)
|
|
1080
|
+
}, React__namespace.createElement(AngleDownIcon$1, null))), children);
|
|
736
1081
|
};
|
|
737
1082
|
CollapseColumn.displayName = 'CollapseColumn';
|
|
738
1083
|
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
1084
|
+
var collapsible = function collapsible(value, _ref) {
|
|
1085
|
+
var rowIndex = _ref.rowIndex,
|
|
1086
|
+
columnIndex = _ref.columnIndex,
|
|
1087
|
+
rowData = _ref.rowData,
|
|
1088
|
+
column = _ref.column,
|
|
1089
|
+
property = _ref.property;
|
|
1090
|
+
var _column$extraParams = column.extraParams,
|
|
1091
|
+
onCollapse = _column$extraParams.onCollapse,
|
|
1092
|
+
_column$extraParams$r = _column$extraParams.rowLabeledBy,
|
|
1093
|
+
rowLabeledBy = _column$extraParams$r === void 0 ? 'simple-node' : _column$extraParams$r,
|
|
1094
|
+
_column$extraParams$e = _column$extraParams.expandId,
|
|
1095
|
+
expandId = _column$extraParams$e === void 0 ? 'expand-toggle' : _column$extraParams$e,
|
|
1096
|
+
allRowsExpanded = _column$extraParams.allRowsExpanded,
|
|
1097
|
+
collapseAllAriaLabel = _column$extraParams.collapseAllAriaLabel;
|
|
1098
|
+
var extraData = {
|
|
1099
|
+
rowIndex: rowIndex,
|
|
1100
|
+
columnIndex: columnIndex,
|
|
1101
|
+
column: column,
|
|
1102
|
+
property: property
|
|
1103
|
+
};
|
|
1104
|
+
var rowId = rowIndex !== undefined ? rowIndex : -1;
|
|
1105
|
+
var customProps = Object.assign({}, rowId !== -1 ? {
|
|
1106
|
+
isOpen: rowData === null || rowData === void 0 ? void 0 : rowData.isOpen,
|
|
1107
|
+
'aria-labelledby': "" + rowLabeledBy + rowId + " " + expandId + rowId
|
|
1108
|
+
} : {
|
|
1109
|
+
isOpen: allRowsExpanded,
|
|
1110
|
+
'aria-label': collapseAllAriaLabel || 'Expand all rows'
|
|
1111
|
+
});
|
|
1112
|
+
/**
|
|
1113
|
+
* @param {React.MouseEvent} event - Mouse event
|
|
1114
|
+
*/
|
|
1115
|
+
|
|
1116
|
+
function onToggle(event) {
|
|
1117
|
+
var open = rowData ? !rowData.isOpen : !allRowsExpanded; // tslint:disable-next-line:no-unused-expression
|
|
1118
|
+
|
|
1119
|
+
onCollapse && onCollapse(event, rowIndex, open, rowData, extraData);
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
return {
|
|
1123
|
+
className: ((rowData === null || rowData === void 0 ? void 0 : rowData.isOpen) !== undefined || rowId === -1) && css(styles$1.tableToggle),
|
|
1124
|
+
isVisible: !(rowData === null || rowData === void 0 ? void 0 : rowData.fullWidth),
|
|
1125
|
+
children: React__namespace.createElement(CollapseColumn, Object.assign({
|
|
1126
|
+
"aria-labelledby": "" + rowLabeledBy + rowId + " " + expandId + rowId,
|
|
1127
|
+
onToggle: onToggle,
|
|
1128
|
+
id: expandId + rowId
|
|
1129
|
+
}, customProps), value)
|
|
1130
|
+
};
|
|
1131
|
+
};
|
|
1132
|
+
|
|
1133
|
+
var cellWidth = function cellWidth(width) {
|
|
1134
|
+
return function () {
|
|
765
1135
|
return {
|
|
766
|
-
|
|
767
|
-
isVisible: !(rowData === null || rowData === void 0 ? void 0 : rowData.fullWidth),
|
|
768
|
-
children: (React__namespace.createElement(CollapseColumn, Object.assign({ "aria-labelledby": `${rowLabeledBy}${rowId} ${expandId}${rowId}`, onToggle: onToggle, id: expandId + rowId }, customProps), value))
|
|
1136
|
+
className: css(styles$1.modifiers[typeof width === 'number' ? "width_" + width : "width" + capitalize(width)])
|
|
769
1137
|
};
|
|
1138
|
+
};
|
|
770
1139
|
};
|
|
771
1140
|
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
'hiddenOnMd',
|
|
780
|
-
'hiddenOnLg',
|
|
781
|
-
'hiddenOnXl',
|
|
782
|
-
'hiddenOn_2xl',
|
|
783
|
-
'visibleOnSm',
|
|
784
|
-
'visibleOnMd',
|
|
785
|
-
'visibleOnLg',
|
|
786
|
-
'visibleOnXl',
|
|
787
|
-
'visibleOn_2xl'
|
|
788
|
-
];
|
|
789
|
-
const Visibility = visibilityModifiers
|
|
790
|
-
.filter(key => styles$1.modifiers[key])
|
|
791
|
-
.reduce((acc, curr) => {
|
|
792
|
-
const key2 = curr.replace('_2xl', '2Xl');
|
|
793
|
-
acc[key2] = styles$1.modifiers[curr];
|
|
794
|
-
return acc;
|
|
1141
|
+
var visibilityModifiers = ['hidden', 'hiddenOnSm', 'hiddenOnMd', 'hiddenOnLg', 'hiddenOnXl', 'hiddenOn_2xl', 'visibleOnSm', 'visibleOnMd', 'visibleOnLg', 'visibleOnXl', 'visibleOn_2xl'];
|
|
1142
|
+
var Visibility = visibilityModifiers.filter(function (key) {
|
|
1143
|
+
return styles$1.modifiers[key];
|
|
1144
|
+
}).reduce(function (acc, curr) {
|
|
1145
|
+
var key2 = curr.replace('_2xl', '2Xl');
|
|
1146
|
+
acc[key2] = styles$1.modifiers[curr];
|
|
1147
|
+
return acc;
|
|
795
1148
|
}, {});
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
1149
|
+
var classNames = function classNames() {
|
|
1150
|
+
var _arguments = arguments;
|
|
1151
|
+
return function () {
|
|
1152
|
+
return {
|
|
1153
|
+
className: css.apply(void 0, [].slice.call(_arguments))
|
|
1154
|
+
};
|
|
1155
|
+
};
|
|
1156
|
+
};
|
|
799
1157
|
|
|
800
1158
|
/**
|
|
801
1159
|
* merge-props.js
|
|
@@ -806,513 +1164,741 @@ const classNames = (...classes) => () => ({
|
|
|
806
1164
|
/**
|
|
807
1165
|
* @param {any} props - Props
|
|
808
1166
|
*/
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
1167
|
+
|
|
1168
|
+
function mergeProps() {
|
|
1169
|
+
var props = [].slice.call(arguments);
|
|
1170
|
+
var firstProps = props[0];
|
|
1171
|
+
var restProps = props.slice(1);
|
|
1172
|
+
|
|
1173
|
+
if (!restProps.length) {
|
|
1174
|
+
return mergeWith__default["default"]({}, firstProps);
|
|
1175
|
+
} // Avoid mutating the first prop collection
|
|
1176
|
+
|
|
1177
|
+
|
|
1178
|
+
return mergeWith__default["default"].apply(void 0, [mergeWith__default["default"]({}, firstProps)].concat(restProps, [function (a, b, key) {
|
|
1179
|
+
if (key === 'children') {
|
|
1180
|
+
if (a && b) {
|
|
1181
|
+
// compose the two
|
|
1182
|
+
return React__namespace.cloneElement(a, {
|
|
1183
|
+
children: b
|
|
1184
|
+
});
|
|
1185
|
+
} // Children have to be merged in reverse order for Reactabular
|
|
1186
|
+
// logic to work.
|
|
1187
|
+
|
|
1188
|
+
|
|
1189
|
+
return Object.assign(Object.assign({}, b), a);
|
|
814
1190
|
}
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
// Children have to be merged in reverse order for Reactabular
|
|
825
|
-
// logic to work.
|
|
826
|
-
return Object.assign(Object.assign({}, b), a);
|
|
827
|
-
}
|
|
828
|
-
if (key === 'className') {
|
|
829
|
-
// Process class names through classNames to merge properly
|
|
830
|
-
// as a string.
|
|
831
|
-
return css(a, b);
|
|
832
|
-
}
|
|
833
|
-
return undefined;
|
|
834
|
-
});
|
|
1191
|
+
|
|
1192
|
+
if (key === 'className') {
|
|
1193
|
+
// Process class names through classNames to merge properly
|
|
1194
|
+
// as a string.
|
|
1195
|
+
return css(a, b);
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
return undefined;
|
|
1199
|
+
}]));
|
|
835
1200
|
}
|
|
836
1201
|
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
1202
|
+
var ThBase = function ThBase(_a) {
|
|
1203
|
+
var children = _a.children,
|
|
1204
|
+
className = _a.className,
|
|
1205
|
+
_a$component = _a.component,
|
|
1206
|
+
component = _a$component === void 0 ? 'th' : _a$component,
|
|
1207
|
+
dataLabel = _a.dataLabel,
|
|
1208
|
+
_a$scope = _a.scope,
|
|
1209
|
+
scope = _a$scope === void 0 ? 'col' : _a$scope,
|
|
1210
|
+
_a$textCenter = _a.textCenter,
|
|
1211
|
+
textCenter = _a$textCenter === void 0 ? false : _a$textCenter,
|
|
1212
|
+
_a$sort = _a.sort,
|
|
1213
|
+
sort = _a$sort === void 0 ? null : _a$sort,
|
|
1214
|
+
modifier = _a.modifier,
|
|
1215
|
+
_a$select = _a.select,
|
|
1216
|
+
select = _a$select === void 0 ? null : _a$select,
|
|
1217
|
+
_a$expand = _a.expand,
|
|
1218
|
+
collapse = _a$expand === void 0 ? null : _a$expand,
|
|
1219
|
+
_a$tooltip = _a.tooltip,
|
|
1220
|
+
tooltip = _a$tooltip === void 0 ? '' : _a$tooltip,
|
|
1221
|
+
_a$onMouseEnter = _a.onMouseEnter,
|
|
1222
|
+
onMouseEnterProp = _a$onMouseEnter === void 0 ? function () {} : _a$onMouseEnter,
|
|
1223
|
+
width = _a.width,
|
|
1224
|
+
visibility = _a.visibility,
|
|
1225
|
+
innerRef = _a.innerRef,
|
|
1226
|
+
infoProps = _a.info,
|
|
1227
|
+
_a$isStickyColumn = _a.isStickyColumn,
|
|
1228
|
+
isStickyColumn = _a$isStickyColumn === void 0 ? false : _a$isStickyColumn,
|
|
1229
|
+
_a$hasRightBorder = _a.hasRightBorder,
|
|
1230
|
+
hasRightBorder = _a$hasRightBorder === void 0 ? false : _a$hasRightBorder,
|
|
1231
|
+
_a$stickyMinWidth = _a.stickyMinWidth,
|
|
1232
|
+
stickyMinWidth = _a$stickyMinWidth === void 0 ? '120px' : _a$stickyMinWidth,
|
|
1233
|
+
stickyLeftOffset = _a.stickyLeftOffset,
|
|
1234
|
+
_a$isSubheader = _a.isSubheader,
|
|
1235
|
+
isSubheader = _a$isSubheader === void 0 ? false : _a$isSubheader,
|
|
1236
|
+
props = __rest(_a, ["children", "className", "component", "dataLabel", "scope", "textCenter", "sort", "modifier", "select", "expand", "tooltip", "onMouseEnter", "width", "visibility", "innerRef", "info", "isStickyColumn", "hasRightBorder", "stickyMinWidth", "stickyLeftOffset", "isSubheader"]);
|
|
1237
|
+
|
|
1238
|
+
var _React$useState = React__namespace.useState(false),
|
|
1239
|
+
showTooltip = _React$useState[0],
|
|
1240
|
+
setShowTooltip = _React$useState[1];
|
|
1241
|
+
|
|
1242
|
+
var onMouseEnter = function onMouseEnter(event) {
|
|
1243
|
+
if (event.target.offsetWidth < event.target.scrollWidth) {
|
|
1244
|
+
!showTooltip && setShowTooltip(true);
|
|
1245
|
+
} else {
|
|
1246
|
+
showTooltip && setShowTooltip(false);
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
onMouseEnterProp(event);
|
|
1250
|
+
};
|
|
1251
|
+
|
|
1252
|
+
var sortParams = null;
|
|
1253
|
+
|
|
1254
|
+
if (sort) {
|
|
1255
|
+
if (sort.isFavorites) {
|
|
1256
|
+
sortParams = sortableFavorites({
|
|
1257
|
+
onSort: sort === null || sort === void 0 ? void 0 : sort.onSort,
|
|
1258
|
+
columnIndex: sort.columnIndex,
|
|
1259
|
+
sortBy: sort.sortBy
|
|
1260
|
+
})();
|
|
1261
|
+
} else {
|
|
1262
|
+
sortParams = sortable(children, {
|
|
1263
|
+
columnIndex: sort.columnIndex,
|
|
1264
|
+
column: {
|
|
1265
|
+
extraParams: {
|
|
1266
|
+
sortBy: sort.sortBy,
|
|
1267
|
+
onSort: sort === null || sort === void 0 ? void 0 : sort.onSort
|
|
1268
|
+
}
|
|
868
1269
|
}
|
|
1270
|
+
});
|
|
869
1271
|
}
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
})
|
|
881
|
-
: null;
|
|
882
|
-
const collapseParams = collapse
|
|
883
|
-
? collapsible(children, {
|
|
884
|
-
column: {
|
|
885
|
-
extraParams: {
|
|
886
|
-
onCollapse: collapse === null || collapse === void 0 ? void 0 : collapse.onToggle,
|
|
887
|
-
allRowsExpanded: !collapse.areAllExpanded,
|
|
888
|
-
collapseAllAriaLabel: ''
|
|
889
|
-
}
|
|
890
|
-
}
|
|
891
|
-
})
|
|
892
|
-
: null;
|
|
893
|
-
const widthParams = width ? cellWidth(width)() : null;
|
|
894
|
-
const visibilityParams = visibility
|
|
895
|
-
? classNames(...visibility.map((vis) => Visibility[vis]))()
|
|
896
|
-
: null;
|
|
897
|
-
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;
|
|
898
|
-
// info can wrap other transformedChildren
|
|
899
|
-
let infoParams = null;
|
|
900
|
-
if (infoProps) {
|
|
901
|
-
infoParams = info(infoProps)(transformedChildren);
|
|
902
|
-
transformedChildren = infoParams.children;
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
var selectParams = select ? selectable(children, {
|
|
1275
|
+
column: {
|
|
1276
|
+
extraParams: {
|
|
1277
|
+
onSelect: select === null || select === void 0 ? void 0 : select.onSelect,
|
|
1278
|
+
selectVariant: 'checkbox',
|
|
1279
|
+
allRowsSelected: select.isSelected,
|
|
1280
|
+
isHeaderSelectDisabled: !!select.isHeaderSelectDisabled
|
|
1281
|
+
}
|
|
903
1282
|
}
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
return
|
|
1283
|
+
}) : null;
|
|
1284
|
+
var collapseParams = collapse ? collapsible(children, {
|
|
1285
|
+
column: {
|
|
1286
|
+
extraParams: {
|
|
1287
|
+
onCollapse: collapse === null || collapse === void 0 ? void 0 : collapse.onToggle,
|
|
1288
|
+
allRowsExpanded: !collapse.areAllExpanded,
|
|
1289
|
+
collapseAllAriaLabel: ''
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
}) : null;
|
|
1293
|
+
var widthParams = width ? cellWidth(width)() : null;
|
|
1294
|
+
var visibilityParams = visibility ? classNames.apply(void 0, visibility.map(function (vis) {
|
|
1295
|
+
return Visibility[vis];
|
|
1296
|
+
}))() : null;
|
|
1297
|
+
var transformedChildren = (sortParams === null || sortParams === void 0 ? void 0 : sortParams.children) || (selectParams === null || selectParams === void 0 ? void 0 : selectParams.children) || (collapseParams === null || collapseParams === void 0 ? void 0 : collapseParams.children) || children; // info can wrap other transformedChildren
|
|
1298
|
+
|
|
1299
|
+
var infoParams = null;
|
|
1300
|
+
|
|
1301
|
+
if (infoProps) {
|
|
1302
|
+
infoParams = info(infoProps)(transformedChildren);
|
|
1303
|
+
transformedChildren = infoParams.children;
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
var merged = mergeProps(sortParams, selectParams, collapseParams, widthParams, visibilityParams, infoParams);
|
|
1307
|
+
|
|
1308
|
+
var _merged$className = merged.className,
|
|
1309
|
+
mergedClassName = _merged$className === void 0 ? '' : _merged$className,
|
|
1310
|
+
_merged$component = merged.component,
|
|
1311
|
+
MergedComponent = _merged$component === void 0 ? component : _merged$component,
|
|
1312
|
+
mergedProps = __rest(merged, ["children", "isVisible", "className", "component"]);
|
|
1313
|
+
|
|
1314
|
+
var cell = React__namespace.createElement(MergedComponent, Object.assign({
|
|
1315
|
+
"data-label": dataLabel,
|
|
1316
|
+
onMouseEnter: tooltip !== null ? onMouseEnter : onMouseEnterProp,
|
|
1317
|
+
scope: component === 'th' && children ? scope : null,
|
|
1318
|
+
ref: innerRef,
|
|
1319
|
+
className: css(className, textCenter && styles$1.modifiers.center, isSubheader && styles$1.tableSubhead, isStickyColumn && styles.tableStickyColumn, hasRightBorder && styles.modifiers.borderRight, modifier && styles$1.modifiers[modifier], mergedClassName)
|
|
1320
|
+
}, mergedProps, props, isStickyColumn && {
|
|
1321
|
+
style: Object.assign({
|
|
1322
|
+
'--pf-c-table__sticky-column--MinWidth': stickyMinWidth ? stickyMinWidth : undefined,
|
|
1323
|
+
'--pf-c-table__sticky-column--Left': stickyLeftOffset ? stickyLeftOffset : undefined
|
|
1324
|
+
}, props.style)
|
|
1325
|
+
}), transformedChildren);
|
|
1326
|
+
var canDefault = tooltip === '' ? typeof children === 'string' : true;
|
|
1327
|
+
return tooltip !== null && canDefault && showTooltip ? React__namespace.createElement(Tooltip.Tooltip, {
|
|
1328
|
+
content: tooltip || tooltip === '' && children,
|
|
1329
|
+
isVisible: true
|
|
1330
|
+
}, cell) : cell;
|
|
917
1331
|
};
|
|
918
|
-
|
|
1332
|
+
|
|
1333
|
+
var Th = React__namespace.forwardRef(function (props, ref) {
|
|
1334
|
+
return React__namespace.createElement(ThBase, Object.assign({}, props, {
|
|
1335
|
+
innerRef: ref
|
|
1336
|
+
}));
|
|
1337
|
+
});
|
|
919
1338
|
Th.displayName = 'Th';
|
|
920
1339
|
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
1340
|
+
var ActionsColumn = /*#__PURE__*/function (_React$Component) {
|
|
1341
|
+
_inheritsLoose(ActionsColumn, _React$Component);
|
|
1342
|
+
|
|
1343
|
+
function ActionsColumn(props) {
|
|
1344
|
+
var _this;
|
|
1345
|
+
|
|
1346
|
+
_this = _React$Component.call(this, props) || this;
|
|
1347
|
+
_this.toggleRef = React__namespace.createRef();
|
|
1348
|
+
|
|
1349
|
+
_this.onToggle = function (isOpen) {
|
|
1350
|
+
_this.setState({
|
|
1351
|
+
isOpen: isOpen
|
|
1352
|
+
});
|
|
1353
|
+
};
|
|
1354
|
+
|
|
1355
|
+
_this.onClick = function (event, onClick) {
|
|
1356
|
+
var _this$props = _this.props,
|
|
1357
|
+
rowData = _this$props.rowData,
|
|
1358
|
+
extraData = _this$props.extraData; // Only prevent default if onClick is provided. This allows href support.
|
|
1359
|
+
|
|
1360
|
+
if (onClick) {
|
|
1361
|
+
event.preventDefault(); // tslint:disable-next-line:no-unused-expression
|
|
1362
|
+
|
|
1363
|
+
onClick(event, extraData && extraData.rowIndex, rowData, extraData);
|
|
1364
|
+
}
|
|
1365
|
+
};
|
|
1366
|
+
|
|
1367
|
+
_this.state = {
|
|
1368
|
+
isOpen: false
|
|
1369
|
+
};
|
|
1370
|
+
return _this;
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
var _proto = ActionsColumn.prototype;
|
|
1374
|
+
|
|
1375
|
+
_proto.render = function render() {
|
|
1376
|
+
var _this2 = this;
|
|
1377
|
+
|
|
1378
|
+
var isOpen = this.state.isOpen;
|
|
1379
|
+
var _this$props2 = this.props,
|
|
1380
|
+
items = _this$props2.items,
|
|
1381
|
+
children = _this$props2.children,
|
|
1382
|
+
dropdownPosition = _this$props2.dropdownPosition,
|
|
1383
|
+
dropdownDirection = _this$props2.dropdownDirection,
|
|
1384
|
+
isDisabled = _this$props2.isDisabled,
|
|
1385
|
+
rowData = _this$props2.rowData,
|
|
1386
|
+
actionsToggle = _this$props2.actionsToggle;
|
|
1387
|
+
var actionsToggleClone = actionsToggle ? actionsToggle({
|
|
1388
|
+
onToggle: this.onToggle,
|
|
1389
|
+
isOpen: isOpen,
|
|
1390
|
+
isDisabled: isDisabled
|
|
1391
|
+
}) : React__namespace.createElement(KebabToggle.KebabToggle, {
|
|
1392
|
+
isDisabled: isDisabled,
|
|
1393
|
+
onToggle: this.onToggle
|
|
1394
|
+
});
|
|
1395
|
+
return React__namespace.createElement(React__namespace.Fragment, null, items.filter(function (item) {
|
|
1396
|
+
return item.isOutsideDropdown;
|
|
1397
|
+
}) // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1398
|
+
.map(function (_a, key) {
|
|
1399
|
+
var title = _a.title,
|
|
1400
|
+
itemKey = _a.itemKey,
|
|
1401
|
+
_onClick = _a.onClick,
|
|
1402
|
+
props = __rest(_a, ["title", "itemKey", "onClick", "isOutsideDropdown"]);
|
|
1403
|
+
|
|
1404
|
+
return typeof title === 'string' ? React__namespace.createElement(Button.Button, Object.assign({
|
|
1405
|
+
onClick: function onClick(event) {
|
|
1406
|
+
return _this2.onClick(event, _onClick);
|
|
1407
|
+
}
|
|
1408
|
+
}, props, {
|
|
1409
|
+
isDisabled: isDisabled,
|
|
1410
|
+
key: itemKey || "outside_dropdown_" + key,
|
|
1411
|
+
"data-key": itemKey || "outside_dropdown_" + key
|
|
1412
|
+
}), title) : React__namespace.cloneElement(title, Object.assign({
|
|
1413
|
+
onClick: _onClick,
|
|
1414
|
+
isDisabled: isDisabled
|
|
1415
|
+
}, props));
|
|
1416
|
+
}), React__namespace.createElement(Dropdown.Dropdown, Object.assign({
|
|
1417
|
+
toggle: actionsToggleClone,
|
|
1418
|
+
position: dropdownPosition,
|
|
1419
|
+
direction: dropdownDirection,
|
|
1420
|
+
isOpen: isOpen,
|
|
1421
|
+
dropdownItems: items.filter(function (item) {
|
|
1422
|
+
return !item.isOutsideDropdown;
|
|
1423
|
+
}).map(function (_a, key) {
|
|
1424
|
+
var title = _a.title,
|
|
1425
|
+
itemKey = _a.itemKey,
|
|
1426
|
+
_onClick2 = _a.onClick,
|
|
1427
|
+
isSeparator = _a.isSeparator,
|
|
1428
|
+
props = __rest(_a, ["title", "itemKey", "onClick", "isSeparator"]);
|
|
1429
|
+
|
|
1430
|
+
return isSeparator ? React__namespace.createElement(DropdownSeparator.DropdownSeparator, Object.assign({}, props, {
|
|
1431
|
+
key: itemKey || key,
|
|
1432
|
+
"data-key": itemKey || key
|
|
1433
|
+
})) : React__namespace.createElement(DropdownItem.DropdownItem, Object.assign({
|
|
1434
|
+
component: "button",
|
|
1435
|
+
onClick: function onClick(event) {
|
|
1436
|
+
_this2.onClick(event, _onClick2);
|
|
1437
|
+
|
|
1438
|
+
_this2.onToggle(!isOpen);
|
|
1439
|
+
}
|
|
1440
|
+
}, props, {
|
|
1441
|
+
key: itemKey || key,
|
|
1442
|
+
"data-key": itemKey || key
|
|
1443
|
+
}), title);
|
|
1444
|
+
}),
|
|
1445
|
+
isPlain: true
|
|
1446
|
+
}, rowData && rowData.actionProps)), children);
|
|
1447
|
+
};
|
|
1448
|
+
|
|
1449
|
+
return ActionsColumn;
|
|
1450
|
+
}(React__namespace.Component);
|
|
967
1451
|
ActionsColumn.displayName = 'ActionsColumn';
|
|
968
1452
|
ActionsColumn.defaultProps = {
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
1453
|
+
children: null,
|
|
1454
|
+
items: [],
|
|
1455
|
+
dropdownPosition: dropdownConstants.DropdownPosition.right,
|
|
1456
|
+
dropdownDirection: dropdownConstants.DropdownDirection.down,
|
|
1457
|
+
rowData: {},
|
|
1458
|
+
extraData: {}
|
|
975
1459
|
};
|
|
976
1460
|
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
const extraData = {
|
|
980
|
-
rowIndex,
|
|
981
|
-
columnIndex,
|
|
982
|
-
column,
|
|
983
|
-
property
|
|
984
|
-
};
|
|
985
|
-
const resolvedActions = resolveOrDefault(actionResolver, actions, rowData, extraData);
|
|
986
|
-
const resolvedIsDisabled = resolveOrDefault(areActionsDisabled, rowData && rowData.disableActions, rowData, extraData);
|
|
987
|
-
const renderProps = resolvedActions && resolvedActions.length > 0
|
|
988
|
-
? {
|
|
989
|
-
children: (React__namespace.createElement(ActionsColumn, { items: resolvedActions, dropdownPosition: dropdownPosition, dropdownDirection: dropdownDirection, isDisabled: resolvedIsDisabled, rowData: rowData, extraData: extraData, actionsToggle: actionsToggle }, label))
|
|
990
|
-
}
|
|
991
|
-
: {};
|
|
992
|
-
return Object.assign({ className: css(styles$1.tableAction), style: { paddingRight: 0 }, isVisible: true }, renderProps);
|
|
1461
|
+
var resolveOrDefault = function resolveOrDefault(resolver, defaultValue, rowData, extraData) {
|
|
1462
|
+
return typeof resolver === 'function' ? resolver(rowData, extraData) : defaultValue;
|
|
993
1463
|
};
|
|
994
1464
|
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
column,
|
|
1005
|
-
property
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
// tslint:disable-next-line:no-unused-expression
|
|
1012
|
-
onExpand && onExpand(event, rowIndex, columnIndex, props.isOpen, rowData, extraData);
|
|
1013
|
-
}
|
|
1014
|
-
return {
|
|
1015
|
-
className: css(styles$1.tableCompoundExpansionToggle, props.isOpen && styles$1.modifiers.expanded),
|
|
1016
|
-
children: props.isOpen !== undefined && (React__namespace.createElement("button", { type: "button", className: css(styles$1.tableButton), onClick: onToggle, "aria-expanded": props.isOpen, "aria-controls": props.ariaControls },
|
|
1017
|
-
React__namespace.createElement(TableText, null, title)))
|
|
1465
|
+
var cellActions = function cellActions(actions, actionResolver, areActionsDisabled) {
|
|
1466
|
+
return function (label, _ref) {
|
|
1467
|
+
var rowData = _ref.rowData,
|
|
1468
|
+
column = _ref.column,
|
|
1469
|
+
rowIndex = _ref.rowIndex,
|
|
1470
|
+
columnIndex = _ref.columnIndex,
|
|
1471
|
+
_ref$column$extraPara = _ref.column.extraParams,
|
|
1472
|
+
dropdownPosition = _ref$column$extraPara.dropdownPosition,
|
|
1473
|
+
dropdownDirection = _ref$column$extraPara.dropdownDirection,
|
|
1474
|
+
actionsToggle = _ref$column$extraPara.actionsToggle,
|
|
1475
|
+
property = _ref.property;
|
|
1476
|
+
var extraData = {
|
|
1477
|
+
rowIndex: rowIndex,
|
|
1478
|
+
columnIndex: columnIndex,
|
|
1479
|
+
column: column,
|
|
1480
|
+
property: property
|
|
1018
1481
|
};
|
|
1482
|
+
var resolvedActions = resolveOrDefault(actionResolver, actions, rowData, extraData);
|
|
1483
|
+
var resolvedIsDisabled = resolveOrDefault(areActionsDisabled, rowData && rowData.disableActions, rowData, extraData);
|
|
1484
|
+
var renderProps = resolvedActions && resolvedActions.length > 0 ? {
|
|
1485
|
+
children: React__namespace.createElement(ActionsColumn, {
|
|
1486
|
+
items: resolvedActions,
|
|
1487
|
+
dropdownPosition: dropdownPosition,
|
|
1488
|
+
dropdownDirection: dropdownDirection,
|
|
1489
|
+
isDisabled: resolvedIsDisabled,
|
|
1490
|
+
rowData: rowData,
|
|
1491
|
+
extraData: extraData,
|
|
1492
|
+
actionsToggle: actionsToggle
|
|
1493
|
+
}, label)
|
|
1494
|
+
} : {};
|
|
1495
|
+
return Object.assign({
|
|
1496
|
+
className: css(styles$1.tableAction),
|
|
1497
|
+
style: {
|
|
1498
|
+
paddingRight: 0
|
|
1499
|
+
},
|
|
1500
|
+
isVisible: true
|
|
1501
|
+
}, renderProps);
|
|
1502
|
+
};
|
|
1503
|
+
};
|
|
1504
|
+
|
|
1505
|
+
var compoundExpand = function compoundExpand(value, _ref) {
|
|
1506
|
+
var rowIndex = _ref.rowIndex,
|
|
1507
|
+
columnIndex = _ref.columnIndex,
|
|
1508
|
+
rowData = _ref.rowData,
|
|
1509
|
+
column = _ref.column,
|
|
1510
|
+
property = _ref.property;
|
|
1511
|
+
|
|
1512
|
+
if (!value) {
|
|
1513
|
+
return null;
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
var title = value.title,
|
|
1517
|
+
props = value.props;
|
|
1518
|
+
var onExpand = column.extraParams.onExpand;
|
|
1519
|
+
var extraData = {
|
|
1520
|
+
rowIndex: rowIndex,
|
|
1521
|
+
columnIndex: columnIndex,
|
|
1522
|
+
column: column,
|
|
1523
|
+
property: property
|
|
1524
|
+
};
|
|
1525
|
+
/**
|
|
1526
|
+
* @param {React.MouseEvent} event - Mouse event
|
|
1527
|
+
*/
|
|
1528
|
+
|
|
1529
|
+
function onToggle(event) {
|
|
1530
|
+
// tslint:disable-next-line:no-unused-expression
|
|
1531
|
+
onExpand && onExpand(event, rowIndex, columnIndex, props.isOpen, rowData, extraData);
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
return {
|
|
1535
|
+
className: css(styles$1.tableCompoundExpansionToggle, props.isOpen && styles$1.modifiers.expanded),
|
|
1536
|
+
children: props.isOpen !== undefined && React__namespace.createElement("button", {
|
|
1537
|
+
type: "button",
|
|
1538
|
+
className: css(styles$1.tableButton),
|
|
1539
|
+
onClick: onToggle,
|
|
1540
|
+
"aria-expanded": props.isOpen,
|
|
1541
|
+
"aria-controls": props.ariaControls
|
|
1542
|
+
}, React__namespace.createElement(TableText, null, title))
|
|
1543
|
+
};
|
|
1019
1544
|
};
|
|
1020
1545
|
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1546
|
+
var FavoritesCell = function FavoritesCell(_a) {
|
|
1547
|
+
var _a$className = _a.className,
|
|
1548
|
+
className = _a$className === void 0 ? '' : _a$className,
|
|
1549
|
+
onFavorite = _a.onFavorite,
|
|
1550
|
+
isFavorited = _a.isFavorited,
|
|
1551
|
+
rowIndex = _a.rowIndex,
|
|
1552
|
+
props = __rest(_a, ["className", "onFavorite", "isFavorited", "rowIndex"]);
|
|
1553
|
+
|
|
1554
|
+
var ariaProps = rowIndex === undefined ? {} : {
|
|
1555
|
+
id: "favorites-button-" + rowIndex,
|
|
1556
|
+
'aria-labelledby': "favorites-button-" + rowIndex
|
|
1557
|
+
};
|
|
1558
|
+
return React__namespace.createElement(Button.Button, Object.assign({
|
|
1559
|
+
variant: "plain",
|
|
1560
|
+
className: className,
|
|
1561
|
+
type: "button",
|
|
1562
|
+
"aria-label": isFavorited ? 'Starred' : 'Not starred',
|
|
1563
|
+
onClick: onFavorite
|
|
1564
|
+
}, ariaProps, props), React__namespace.createElement(StarIcon$1, {
|
|
1565
|
+
"aria-hidden": true
|
|
1566
|
+
}));
|
|
1031
1567
|
};
|
|
1032
1568
|
FavoritesCell.displayName = 'FavoritesCell';
|
|
1033
1569
|
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
/**
|
|
1050
|
-
* @param {React.MouseEvent} event - Mouse event
|
|
1051
|
-
*/
|
|
1052
|
-
function favoritesClick(event) {
|
|
1053
|
-
// tslint:disable-next-line:no-unused-expression
|
|
1054
|
-
onFavorite && onFavorite(event, rowData && !rowData.favorited, rowIndex, rowData, extraData);
|
|
1055
|
-
}
|
|
1056
|
-
const additionalProps = rowData.favoritesProps || {};
|
|
1570
|
+
var favoritable = function favoritable(value, _ref) {
|
|
1571
|
+
var rowIndex = _ref.rowIndex,
|
|
1572
|
+
columnIndex = _ref.columnIndex,
|
|
1573
|
+
rowData = _ref.rowData,
|
|
1574
|
+
column = _ref.column,
|
|
1575
|
+
property = _ref.property;
|
|
1576
|
+
var onFavorite = column.extraParams.onFavorite;
|
|
1577
|
+
var extraData = {
|
|
1578
|
+
rowIndex: rowIndex,
|
|
1579
|
+
columnIndex: columnIndex,
|
|
1580
|
+
column: column,
|
|
1581
|
+
property: property
|
|
1582
|
+
}; // this is a child row which should not display the favorites icon
|
|
1583
|
+
|
|
1584
|
+
if (rowData && rowData.hasOwnProperty('parent') && !rowData.fullWidth) {
|
|
1057
1585
|
return {
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
children: (React__namespace.createElement(FavoritesCell, Object.assign({ rowIndex: rowIndex, onFavorite: favoritesClick, isFavorited: rowData && rowData.favorited }, additionalProps)))
|
|
1586
|
+
component: 'td',
|
|
1587
|
+
isVisible: true
|
|
1061
1588
|
};
|
|
1589
|
+
}
|
|
1590
|
+
/**
|
|
1591
|
+
* @param {React.MouseEvent} event - Mouse event
|
|
1592
|
+
*/
|
|
1593
|
+
|
|
1594
|
+
|
|
1595
|
+
function favoritesClick(event) {
|
|
1596
|
+
// tslint:disable-next-line:no-unused-expression
|
|
1597
|
+
onFavorite && onFavorite(event, rowData && !rowData.favorited, rowIndex, rowData, extraData);
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
var additionalProps = rowData.favoritesProps || {};
|
|
1601
|
+
return {
|
|
1602
|
+
className: css(styles$1.tableFavorite, rowData && rowData.favorited && styles$1.modifiers.favorited),
|
|
1603
|
+
isVisible: !rowData || !rowData.fullWidth,
|
|
1604
|
+
children: React__namespace.createElement(FavoritesCell, Object.assign({
|
|
1605
|
+
rowIndex: rowIndex,
|
|
1606
|
+
onFavorite: favoritesClick,
|
|
1607
|
+
isFavorited: rowData && rowData.favorited
|
|
1608
|
+
}, additionalProps))
|
|
1609
|
+
};
|
|
1062
1610
|
};
|
|
1063
1611
|
|
|
1064
|
-
|
|
1612
|
+
var GripVerticalIconConfig = {
|
|
1065
1613
|
name: 'GripVerticalIcon',
|
|
1066
1614
|
height: 512,
|
|
1067
1615
|
width: 320,
|
|
1068
1616
|
svgPath: 'M96 32H32C14.33 32 0 46.33 0 64v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32V64c0-17.67-14.33-32-32-32zm0 160H32c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32zm0 160H32c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32zM288 32h-64c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32V64c0-17.67-14.33-32-32-32zm0 160h-64c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32zm0 160h-64c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32z',
|
|
1069
1617
|
yOffset: 0,
|
|
1070
|
-
xOffset: 0
|
|
1618
|
+
xOffset: 0
|
|
1071
1619
|
};
|
|
1072
|
-
|
|
1073
|
-
const GripVerticalIcon = createIcon$1(GripVerticalIconConfig);
|
|
1074
|
-
|
|
1620
|
+
var GripVerticalIcon = createIcon(GripVerticalIconConfig);
|
|
1075
1621
|
var GripVerticalIcon$1 = GripVerticalIcon;
|
|
1076
1622
|
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1623
|
+
var DraggableCell = function DraggableCell(_a) {
|
|
1624
|
+
var className = _a.className,
|
|
1625
|
+
onClick = _a.onClick,
|
|
1626
|
+
ariaLabel = _a['aria-label'],
|
|
1627
|
+
id = _a.id,
|
|
1628
|
+
props = __rest(_a, ["className", "onClick", 'aria-label', "id"]);
|
|
1629
|
+
|
|
1630
|
+
return React__namespace.createElement(Button.Button, Object.assign({
|
|
1631
|
+
id: id,
|
|
1632
|
+
variant: "plain",
|
|
1633
|
+
className: className,
|
|
1634
|
+
type: "button",
|
|
1635
|
+
"aria-label": ariaLabel || "Draggable row draggable button",
|
|
1636
|
+
onClick: onClick
|
|
1637
|
+
}, props), React__namespace.createElement(GripVerticalIcon$1, {
|
|
1638
|
+
"aria-hidden": true
|
|
1639
|
+
}));
|
|
1081
1640
|
};
|
|
1082
1641
|
DraggableCell.displayName = 'DraggableCell';
|
|
1083
1642
|
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1643
|
+
var draggable = function draggable(value, _ref) {
|
|
1644
|
+
var rowData = _ref.rowData;
|
|
1645
|
+
var id = rowData.id;
|
|
1646
|
+
return {
|
|
1647
|
+
className: '',
|
|
1648
|
+
children: React__namespace.createElement(DraggableCell, {
|
|
1649
|
+
id: id
|
|
1650
|
+
})
|
|
1651
|
+
};
|
|
1090
1652
|
};
|
|
1091
1653
|
|
|
1092
|
-
|
|
1654
|
+
var EllipsisHIconConfig = {
|
|
1093
1655
|
name: 'EllipsisHIcon',
|
|
1094
1656
|
height: 512,
|
|
1095
1657
|
width: 512,
|
|
1096
1658
|
svgPath: 'M328 256c0 39.8-32.2 72-72 72s-72-32.2-72-72 32.2-72 72-72 72 32.2 72 72zm104-72c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72zm-352 0c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72z',
|
|
1097
1659
|
yOffset: 0,
|
|
1098
|
-
xOffset: 0
|
|
1660
|
+
xOffset: 0
|
|
1099
1661
|
};
|
|
1100
|
-
|
|
1101
|
-
const EllipsisHIcon = createIcon$1(EllipsisHIconConfig);
|
|
1102
|
-
|
|
1662
|
+
var EllipsisHIcon = createIcon(EllipsisHIconConfig);
|
|
1103
1663
|
var EllipsisHIcon$1 = EllipsisHIcon;
|
|
1104
1664
|
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1665
|
+
var treeRow = function treeRow(onCollapse, onCheckChange, onToggleRowDetails) {
|
|
1666
|
+
return function (value, _ref) {
|
|
1667
|
+
var rowIndex = _ref.rowIndex,
|
|
1668
|
+
rowData = _ref.rowData;
|
|
1669
|
+
var _rowData$props = rowData.props,
|
|
1670
|
+
isExpanded = _rowData$props.isExpanded,
|
|
1671
|
+
isDetailsExpanded = _rowData$props.isDetailsExpanded,
|
|
1672
|
+
level = _rowData$props['aria-level'],
|
|
1673
|
+
setsize = _rowData$props['aria-setsize'],
|
|
1674
|
+
toggleAriaLabel = _rowData$props.toggleAriaLabel,
|
|
1675
|
+
checkAriaLabel = _rowData$props.checkAriaLabel,
|
|
1676
|
+
showDetailsAriaLabel = _rowData$props.showDetailsAriaLabel,
|
|
1677
|
+
isChecked = _rowData$props.isChecked,
|
|
1678
|
+
checkboxId = _rowData$props.checkboxId,
|
|
1679
|
+
icon = _rowData$props.icon;
|
|
1680
|
+
var content = value.title || value;
|
|
1681
|
+
var text = React__namespace.createElement("div", {
|
|
1682
|
+
className: css(stylesTreeView.tableTreeViewText),
|
|
1683
|
+
key: "tree-view-text"
|
|
1684
|
+
}, icon && React__namespace.createElement("span", {
|
|
1685
|
+
className: css(stylesTreeView.tableTreeViewIcon),
|
|
1686
|
+
key: "tree-view-text-icon"
|
|
1687
|
+
}, icon), React__namespace.createElement("span", {
|
|
1688
|
+
className: "pf-c-table__text",
|
|
1689
|
+
key: "table-text"
|
|
1690
|
+
}, content));
|
|
1691
|
+
|
|
1692
|
+
var onChange = function onChange(isChecked, event) {
|
|
1693
|
+
onCheckChange(event, isChecked, rowIndex, content, rowData);
|
|
1113
1694
|
};
|
|
1695
|
+
|
|
1114
1696
|
return {
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1697
|
+
component: 'th',
|
|
1698
|
+
className: 'pf-c-table__tree-view-title-cell',
|
|
1699
|
+
children: level !== undefined ? React__namespace.createElement("div", {
|
|
1700
|
+
className: css(stylesTreeView.tableTreeViewMain)
|
|
1701
|
+
}, setsize > 0 && React__namespace.createElement("span", {
|
|
1702
|
+
className: css(stylesTreeView.tableToggle),
|
|
1703
|
+
key: "table-toggle"
|
|
1704
|
+
}, React__namespace.createElement(reactCore.Button, {
|
|
1705
|
+
variant: "plain",
|
|
1706
|
+
onClick: function onClick(event) {
|
|
1707
|
+
return onCollapse && onCollapse(event, rowIndex, content, rowData);
|
|
1708
|
+
},
|
|
1709
|
+
className: css(isExpanded && styles$1.modifiers.expanded),
|
|
1710
|
+
"aria-expanded": isExpanded,
|
|
1711
|
+
"aria-label": toggleAriaLabel || (isExpanded ? 'Collapse' : 'Expand') + " row " + rowIndex
|
|
1712
|
+
}, React__namespace.createElement("div", {
|
|
1713
|
+
className: css(stylesTreeView.tableToggleIcon)
|
|
1714
|
+
}, React__namespace.createElement(AngleDownIcon$1, {
|
|
1715
|
+
"aria-hidden": "true"
|
|
1716
|
+
})))), !!onCheckChange && React__namespace.createElement("span", {
|
|
1717
|
+
className: css(stylesTreeView.tableCheck),
|
|
1718
|
+
key: "table-check"
|
|
1719
|
+
}, React__namespace.createElement("label", {
|
|
1720
|
+
htmlFor: checkboxId || "checkbox_" + rowIndex
|
|
1721
|
+
}, React__namespace.createElement(reactCore.Checkbox, {
|
|
1722
|
+
id: checkboxId || "checkbox_" + rowIndex,
|
|
1723
|
+
"aria-label": checkAriaLabel || "Row " + rowIndex + " checkbox",
|
|
1724
|
+
isChecked: isChecked,
|
|
1725
|
+
onChange: onChange
|
|
1726
|
+
}))), text, !!onToggleRowDetails && React__namespace.createElement("span", {
|
|
1727
|
+
className: css(stylesTreeView.tableTreeViewDetailsToggle),
|
|
1728
|
+
key: "view-details-toggle"
|
|
1729
|
+
}, React__namespace.createElement(reactCore.Button, {
|
|
1730
|
+
variant: "plain",
|
|
1731
|
+
"aria-expanded": isDetailsExpanded,
|
|
1732
|
+
"aria-label": showDetailsAriaLabel || 'Show row details',
|
|
1733
|
+
onClick: function onClick(event) {
|
|
1734
|
+
return onToggleRowDetails && onToggleRowDetails(event, rowIndex, content, rowData);
|
|
1735
|
+
}
|
|
1736
|
+
}, React__namespace.createElement("span", {
|
|
1737
|
+
className: "pf-c-table__details-toggle-icon"
|
|
1738
|
+
}, React__namespace.createElement(EllipsisHIcon$1, {
|
|
1739
|
+
"aria-hidden": true
|
|
1740
|
+
}))))) : text
|
|
1130
1741
|
};
|
|
1742
|
+
};
|
|
1131
1743
|
};
|
|
1132
1744
|
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
?
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
: null
|
|
1230
|
-
|
|
1231
|
-
const {
|
|
1232
|
-
// selectable adds this but we don't want it
|
|
1233
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1234
|
-
isVisible = null, children: mergedChildren = null, className: mergedClassName = '', component: MergedComponent = component } = merged, mergedProps = __rest(merged, ["isVisible", "children", "className", "component"]);
|
|
1235
|
-
const treeTableTitleCell = (className && className.includes('pf-c-table__tree-view-title-cell')) ||
|
|
1236
|
-
(mergedClassName && mergedClassName.includes('pf-c-table__tree-view-title-cell'));
|
|
1237
|
-
return (React__namespace.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));
|
|
1238
|
-
};
|
|
1239
|
-
const Td = React__namespace.forwardRef((props, ref) => (React__namespace.createElement(TdBase, Object.assign({}, props, { innerRef: ref }))));
|
|
1240
|
-
Td.displayName = 'Td';
|
|
1241
|
-
|
|
1242
|
-
var IconSize;
|
|
1243
|
-
(function (IconSize) {
|
|
1244
|
-
IconSize["sm"] = "sm";
|
|
1245
|
-
IconSize["md"] = "md";
|
|
1246
|
-
IconSize["lg"] = "lg";
|
|
1247
|
-
IconSize["xl"] = "xl";
|
|
1248
|
-
})(IconSize || (IconSize = {}));
|
|
1249
|
-
const getSize = (size) => {
|
|
1250
|
-
switch (size) {
|
|
1251
|
-
case IconSize.sm:
|
|
1252
|
-
return '1em';
|
|
1253
|
-
case IconSize.md:
|
|
1254
|
-
return '1.5em';
|
|
1255
|
-
case IconSize.lg:
|
|
1256
|
-
return '2em';
|
|
1257
|
-
case IconSize.xl:
|
|
1258
|
-
return '3em';
|
|
1259
|
-
default:
|
|
1260
|
-
return '1em';
|
|
1745
|
+
var TdBase = function TdBase(_a) {
|
|
1746
|
+
var children = _a.children,
|
|
1747
|
+
className = _a.className,
|
|
1748
|
+
_a$isActionCell = _a.isActionCell,
|
|
1749
|
+
isActionCell = _a$isActionCell === void 0 ? false : _a$isActionCell,
|
|
1750
|
+
_a$component = _a.component,
|
|
1751
|
+
component = _a$component === void 0 ? 'td' : _a$component,
|
|
1752
|
+
dataLabel = _a.dataLabel,
|
|
1753
|
+
_a$textCenter = _a.textCenter,
|
|
1754
|
+
textCenter = _a$textCenter === void 0 ? false : _a$textCenter,
|
|
1755
|
+
modifier = _a.modifier,
|
|
1756
|
+
_a$select = _a.select,
|
|
1757
|
+
select = _a$select === void 0 ? null : _a$select,
|
|
1758
|
+
_a$actions = _a.actions,
|
|
1759
|
+
actions = _a$actions === void 0 ? null : _a$actions,
|
|
1760
|
+
_a$expand = _a.expand,
|
|
1761
|
+
expand = _a$expand === void 0 ? null : _a$expand,
|
|
1762
|
+
_a$treeRow = _a.treeRow,
|
|
1763
|
+
treeRowProp = _a$treeRow === void 0 ? null : _a$treeRow,
|
|
1764
|
+
_a$compoundExpand = _a.compoundExpand,
|
|
1765
|
+
compoundExpandProp = _a$compoundExpand === void 0 ? null : _a$compoundExpand,
|
|
1766
|
+
noPadding = _a.noPadding,
|
|
1767
|
+
width = _a.width,
|
|
1768
|
+
visibility = _a.visibility,
|
|
1769
|
+
innerRef = _a.innerRef,
|
|
1770
|
+
_a$favorites = _a.favorites,
|
|
1771
|
+
favorites = _a$favorites === void 0 ? null : _a$favorites,
|
|
1772
|
+
_a$draggableRow = _a.draggableRow,
|
|
1773
|
+
draggableRowProp = _a$draggableRow === void 0 ? null : _a$draggableRow,
|
|
1774
|
+
props = __rest(_a, ["children", "className", "isActionCell", "component", "dataLabel", "textCenter", "modifier", "select", "actions", "expand", "treeRow", "compoundExpand", "noPadding", "width", "visibility", "innerRef", "favorites", "draggableRow"]);
|
|
1775
|
+
|
|
1776
|
+
var selectParams = select ? selectable(children, {
|
|
1777
|
+
rowIndex: select.rowIndex,
|
|
1778
|
+
rowData: {
|
|
1779
|
+
selected: select.isSelected,
|
|
1780
|
+
disableSelection: select === null || select === void 0 ? void 0 : select.disable,
|
|
1781
|
+
props: select === null || select === void 0 ? void 0 : select.props
|
|
1782
|
+
},
|
|
1783
|
+
column: {
|
|
1784
|
+
extraParams: {
|
|
1785
|
+
onSelect: select === null || select === void 0 ? void 0 : select.onSelect,
|
|
1786
|
+
selectVariant: select.variant || 'checkbox'
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1789
|
+
}) : null;
|
|
1790
|
+
var favoriteParams = favorites ? favoritable(null, {
|
|
1791
|
+
rowIndex: favorites === null || favorites === void 0 ? void 0 : favorites.rowIndex,
|
|
1792
|
+
rowData: {
|
|
1793
|
+
favorited: favorites.isFavorited,
|
|
1794
|
+
favoritesProps: favorites === null || favorites === void 0 ? void 0 : favorites.props
|
|
1795
|
+
},
|
|
1796
|
+
column: {
|
|
1797
|
+
extraParams: {
|
|
1798
|
+
onFavorite: favorites === null || favorites === void 0 ? void 0 : favorites.onFavorite
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
}) : null;
|
|
1802
|
+
var draggableParams = draggableRowProp !== null ? draggable(null, {
|
|
1803
|
+
rowData: {
|
|
1804
|
+
id: draggableRowProp.id
|
|
1805
|
+
}
|
|
1806
|
+
}) : null;
|
|
1807
|
+
var actionParamsFunc = actions ? cellActions(actions.items, null, null) : null;
|
|
1808
|
+
var actionParams = actionParamsFunc ? actionParamsFunc(null, {
|
|
1809
|
+
rowIndex: actions === null || actions === void 0 ? void 0 : actions.rowIndex,
|
|
1810
|
+
rowData: {
|
|
1811
|
+
disableActions: actions === null || actions === void 0 ? void 0 : actions.disable
|
|
1812
|
+
},
|
|
1813
|
+
column: {
|
|
1814
|
+
extraParams: {
|
|
1815
|
+
dropdownPosition: actions === null || actions === void 0 ? void 0 : actions.dropdownPosition,
|
|
1816
|
+
dropdownDirection: actions === null || actions === void 0 ? void 0 : actions.dropdownDirection,
|
|
1817
|
+
actionsToggle: actions === null || actions === void 0 ? void 0 : actions.actionsToggle
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
}) : null;
|
|
1821
|
+
var expandableParams = expand !== null ? collapsible(null, {
|
|
1822
|
+
rowIndex: expand.rowIndex,
|
|
1823
|
+
columnIndex: expand === null || expand === void 0 ? void 0 : expand.columnIndex,
|
|
1824
|
+
rowData: {
|
|
1825
|
+
isOpen: expand.isExpanded
|
|
1826
|
+
},
|
|
1827
|
+
column: {
|
|
1828
|
+
extraParams: {
|
|
1829
|
+
onCollapse: expand === null || expand === void 0 ? void 0 : expand.onToggle
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1832
|
+
}) : null;
|
|
1833
|
+
var compoundParams = compoundExpandProp !== null ? compoundExpand({
|
|
1834
|
+
title: children,
|
|
1835
|
+
props: {
|
|
1836
|
+
isOpen: compoundExpandProp.isExpanded
|
|
1837
|
+
}
|
|
1838
|
+
}, {
|
|
1839
|
+
column: {
|
|
1840
|
+
extraParams: {
|
|
1841
|
+
onExpand: compoundExpandProp === null || compoundExpandProp === void 0 ? void 0 : compoundExpandProp.onToggle
|
|
1842
|
+
}
|
|
1261
1843
|
}
|
|
1844
|
+
}) : null;
|
|
1845
|
+
var widthParams = width ? cellWidth(width)() : null;
|
|
1846
|
+
var visibilityParams = visibility ? classNames.apply(void 0, visibility.map(function (vis) {
|
|
1847
|
+
return Visibility[vis];
|
|
1848
|
+
}))() : null;
|
|
1849
|
+
var treeRowParams = treeRowProp !== null ? treeRow(treeRowProp.onCollapse, treeRowProp.onCheckChange, treeRowProp.onToggleRowDetails)({
|
|
1850
|
+
title: children
|
|
1851
|
+
}, {
|
|
1852
|
+
rowIndex: treeRowProp.rowIndex,
|
|
1853
|
+
rowData: {
|
|
1854
|
+
props: treeRowProp.props
|
|
1855
|
+
}
|
|
1856
|
+
}) : null;
|
|
1857
|
+
var merged = mergeProps(selectParams, actionParams, expandableParams, compoundParams, widthParams, visibilityParams, favoriteParams, treeRowParams, draggableParams);
|
|
1858
|
+
|
|
1859
|
+
var _merged$children = merged.children,
|
|
1860
|
+
mergedChildren = _merged$children === void 0 ? null : _merged$children,
|
|
1861
|
+
_merged$className = merged.className,
|
|
1862
|
+
mergedClassName = _merged$className === void 0 ? '' : _merged$className,
|
|
1863
|
+
_merged$component = merged.component,
|
|
1864
|
+
MergedComponent = _merged$component === void 0 ? component : _merged$component,
|
|
1865
|
+
mergedProps = __rest(merged, ["isVisible", "children", "className", "component"]);
|
|
1866
|
+
|
|
1867
|
+
var treeTableTitleCell = className && className.includes('pf-c-table__tree-view-title-cell') || mergedClassName && mergedClassName.includes('pf-c-table__tree-view-title-cell');
|
|
1868
|
+
return React__namespace.createElement(MergedComponent, Object.assign({}, !treeTableTitleCell && {
|
|
1869
|
+
'data-label': dataLabel
|
|
1870
|
+
}, {
|
|
1871
|
+
className: css(className, isActionCell && styles$1.tableAction, textCenter && styles$1.modifiers.center, noPadding && styles$1.modifiers.noPadding, styles$1.modifiers[modifier], draggableParams && styles$1.tableDraggable, mergedClassName),
|
|
1872
|
+
ref: innerRef
|
|
1873
|
+
}, mergedProps, props), mergedChildren || children);
|
|
1262
1874
|
};
|
|
1263
|
-
let currentId = 0;
|
|
1264
|
-
/**
|
|
1265
|
-
* Factory to create Icon class components for consumers
|
|
1266
|
-
*/
|
|
1267
|
-
function createIcon({ name, xOffset = 0, yOffset = 0, width, height, svgPath }) {
|
|
1268
|
-
var _a;
|
|
1269
|
-
return _a = class SVGIcon extends React__namespace.Component {
|
|
1270
|
-
constructor() {
|
|
1271
|
-
super(...arguments);
|
|
1272
|
-
this.id = `icon-title-${currentId++}`;
|
|
1273
|
-
}
|
|
1274
|
-
render() {
|
|
1275
|
-
const _a = this.props, { size, color, title, noVerticalAlign } = _a, props = __rest(_a, ["size", "color", "title", "noVerticalAlign"]);
|
|
1276
|
-
const hasTitle = Boolean(title);
|
|
1277
|
-
const heightWidth = getSize(size);
|
|
1278
|
-
const baseAlign = -0.125 * Number.parseFloat(heightWidth);
|
|
1279
|
-
const style = noVerticalAlign ? null : { verticalAlign: `${baseAlign}em` };
|
|
1280
|
-
const viewBox = [xOffset, yOffset, width, height].join(' ');
|
|
1281
|
-
return (React__namespace.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),
|
|
1282
|
-
hasTitle && React__namespace.createElement("title", { id: this.id }, title),
|
|
1283
|
-
React__namespace.createElement("path", { d: svgPath })));
|
|
1284
|
-
}
|
|
1285
|
-
},
|
|
1286
|
-
_a.displayName = name,
|
|
1287
|
-
_a.defaultProps = {
|
|
1288
|
-
color: 'currentColor',
|
|
1289
|
-
size: IconSize.sm,
|
|
1290
|
-
noVerticalAlign: false
|
|
1291
|
-
},
|
|
1292
|
-
_a;
|
|
1293
|
-
}
|
|
1294
1875
|
|
|
1295
|
-
|
|
1876
|
+
var Td = React__namespace.forwardRef(function (props, ref) {
|
|
1877
|
+
return React__namespace.createElement(TdBase, Object.assign({}, props, {
|
|
1878
|
+
innerRef: ref
|
|
1879
|
+
}));
|
|
1880
|
+
});
|
|
1881
|
+
Td.displayName = 'Td';
|
|
1882
|
+
|
|
1883
|
+
var SearchIconConfig = {
|
|
1296
1884
|
name: 'SearchIcon',
|
|
1297
1885
|
height: 512,
|
|
1298
1886
|
width: 512,
|
|
1299
1887
|
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',
|
|
1300
1888
|
yOffset: 0,
|
|
1301
|
-
xOffset: 0
|
|
1889
|
+
xOffset: 0
|
|
1302
1890
|
};
|
|
1891
|
+
var SearchIcon = createIcon(SearchIconConfig);
|
|
1303
1892
|
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
const SecurityIconConfig = {
|
|
1893
|
+
var SecurityIconConfig = {
|
|
1307
1894
|
name: 'SecurityIcon',
|
|
1308
1895
|
height: 1024,
|
|
1309
1896
|
width: 896,
|
|
1310
1897
|
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',
|
|
1311
1898
|
yOffset: 0,
|
|
1312
|
-
xOffset: 0
|
|
1899
|
+
xOffset: 0
|
|
1313
1900
|
};
|
|
1314
|
-
|
|
1315
|
-
const SecurityIcon = createIcon(SecurityIconConfig);
|
|
1901
|
+
var SecurityIcon = createIcon(SecurityIconConfig);
|
|
1316
1902
|
|
|
1317
1903
|
var DEFAULT_PAGE = 1;
|
|
1318
1904
|
var DEFAULT_PERPAGE = 10;
|
|
@@ -1882,19 +2468,36 @@ var PackagesTable = function PackagesTable(_ref) {
|
|
|
1882
2468
|
var uniqueVulnerabilities = [].concat(vulnerabilities); // augment vulnerabilities with link data
|
|
1883
2469
|
|
|
1884
2470
|
uniqueVulnerabilities.forEach(function (vulnerability) {
|
|
1885
|
-
|
|
2471
|
+
vulnerability.rpm_nvra_with_link_data = []; // // CONNCERT-2121
|
|
1886
2472
|
|
|
1887
|
-
vulnerability.
|
|
1888
|
-
|
|
1889
|
-
var _p$rpm_nvra;
|
|
2473
|
+
if (vulnerability != null && vulnerability.affected_packages) {
|
|
2474
|
+
var _vulnerability$affect;
|
|
1890
2475
|
|
|
1891
|
-
|
|
1892
|
-
var
|
|
1893
|
-
|
|
2476
|
+
vulnerability == null ? void 0 : (_vulnerability$affect = vulnerability.affected_packages) == null ? void 0 : _vulnerability$affect.forEach(function (_ref3) {
|
|
2477
|
+
var name = _ref3.name,
|
|
2478
|
+
version = _ref3.version,
|
|
2479
|
+
arch = _ref3.arch;
|
|
2480
|
+
var link_data = rpms == null ? void 0 : rpms.filter(function (rpm) {
|
|
2481
|
+
return rpm.name === name && rpm.version === version && rpm.architecture === arch;
|
|
1894
2482
|
});
|
|
1895
2483
|
vulnerability.rpm_nvra_with_link_data.push(link_data[0]);
|
|
1896
2484
|
});
|
|
1897
|
-
}
|
|
2485
|
+
} else {
|
|
2486
|
+
var _vulnerability$packag;
|
|
2487
|
+
|
|
2488
|
+
vulnerability == null ? void 0 : (_vulnerability$packag = vulnerability.packages) == null ? void 0 : _vulnerability$packag.forEach(function (p) {
|
|
2489
|
+
var _p$rpm_nvra;
|
|
2490
|
+
|
|
2491
|
+
return p == null ? void 0 : (_p$rpm_nvra = p.rpm_nvra) == null ? void 0 : _p$rpm_nvra.forEach(function (rpm_nvra) {
|
|
2492
|
+
var link_data = rpms == null ? void 0 : rpms.filter(function (pk) {
|
|
2493
|
+
return pk.nvra === rpm_nvra;
|
|
2494
|
+
});
|
|
2495
|
+
vulnerability.rpm_nvra_with_link_data.push(link_data[0]);
|
|
2496
|
+
});
|
|
2497
|
+
});
|
|
2498
|
+
}
|
|
2499
|
+
|
|
2500
|
+
return vulnerability;
|
|
1898
2501
|
}); // sort vulnerabilities by severity
|
|
1899
2502
|
|
|
1900
2503
|
uniqueVulnerabilities.sort(function (vulnerability) {
|