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

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/CHANGELOG.md ADDED
@@ -0,0 +1,79 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ # [0.3.0](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/compare/@rhc-shared-components/packages-table@0.2.5...@rhc-shared-components/packages-table@0.3.0) (2022-08-22)
7
+
8
+
9
+ ### Features
10
+
11
+ * added toggle and helpsection prop to package table and vuns summary resp. ([9ca76b5](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/commit/9ca76b5f2622ab3a6502e78ce8140625feb3ef2f))
12
+
13
+
14
+
15
+
16
+
17
+ ## [0.2.5](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/compare/@rhc-shared-components/packages-table@0.2.4...@rhc-shared-components/packages-table@0.2.5) (2022-07-12)
18
+
19
+ **Note:** Version bump only for package @rhc-shared-components/packages-table
20
+
21
+
22
+
23
+
24
+
25
+ ## [0.2.4](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/compare/@rhc-shared-components/packages-table@0.2.0...@rhc-shared-components/packages-table@0.2.4) (2022-07-12)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * fixing bad set state on severity filter of packages table ([e48189f](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/commit/e48189f80ade3ca15340b32d3a8823b25dc64b6d))
31
+ * resetting page number of change of filter in packages table ([3b44111](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/commit/3b441115d2a1dd772df9cc3d1c32235f6dc56340))
32
+ * revert exclude pkg count check and remove console warnings ([0867905](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/commit/08679056d4f38a300624cc61ac1fdbf4a064bd76))
33
+
34
+
35
+
36
+
37
+
38
+ ## [0.2.3](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/compare/@rhc-shared-components/packages-table@0.2.0...@rhc-shared-components/packages-table@0.2.3) (2022-06-16)
39
+
40
+
41
+ ### Bug Fixes
42
+
43
+ * fixing bad set state on filterable table>ecoselect ([f7fa11e](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/commit/f7fa11e250243c5341165fe5dd8d93c85ad93e71))
44
+ * revert exclude pkg count check and remove console warnings ([0867905](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/commit/08679056d4f38a300624cc61ac1fdbf4a064bd76))
45
+
46
+
47
+
48
+
49
+
50
+ # [0.2.0](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/compare/@rhc-shared-components/packages-table@0.0.1...@rhc-shared-components/packages-table@0.2.0) (2022-06-14)
51
+
52
+
53
+ ### Bug Fixes
54
+
55
+ * replacing old pfe elements with new ones for vulnerability components ([60ca9ff](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/commit/60ca9ffd0faf29dc571999e42e6ca961aee69c3a))
56
+
57
+
58
+ ### Features
59
+
60
+ * add new packages table component ([baac2c0](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/commit/baac2c056bdb91386884a1a8b8f00e31f7af1a77))
61
+
62
+
63
+
64
+
65
+
66
+ # [0.1.0](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/compare/@rhc-shared-components/packages-table@0.0.1...@rhc-shared-components/packages-table@0.1.0) (2022-06-08)
67
+
68
+
69
+ ### Features
70
+
71
+ * add new packages table component ([baac2c0](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/commit/baac2c056bdb91386884a1a8b8f00e31f7af1a77))
72
+
73
+
74
+
75
+
76
+
77
+ ## 0.0.1 (2022-05-04)
78
+
79
+ **Note:** Version bump only for package @rhc-shared-components/packages-table
File without changes
File without changes
@@ -1,6 +1,7 @@
1
1
  interface VulnerabilitiesTableProps {
2
2
  vulnerabilities: any[];
3
3
  isLoading: boolean;
4
+ hideToggler?: boolean;
4
5
  }
5
- export declare const VulnerabilitiesTable: ({ vulnerabilities, isLoading }: VulnerabilitiesTableProps) => JSX.Element;
6
+ export declare const VulnerabilitiesTable: ({ vulnerabilities, isLoading, hideToggler }: VulnerabilitiesTableProps) => JSX.Element;
6
7
  export {};
package/dist/index.d.ts CHANGED
@@ -7,7 +7,8 @@ export declare const severitySortOrder: {
7
7
  interface PackagesTableProps {
8
8
  vulnerabilities: any[];
9
9
  rpms: any[];
10
+ hideToggler?: boolean;
10
11
  isLoading: boolean;
11
12
  }
12
- export declare const PackagesTable: ({ vulnerabilities, rpms, isLoading }: PackagesTableProps) => JSX.Element;
13
+ export declare const PackagesTable: ({ vulnerabilities, rpms, hideToggler, isLoading }: PackagesTableProps) => JSX.Element;
13
14
  export {};
package/dist/index.js CHANGED
@@ -35,7 +35,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
35
35
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
36
36
  var mergeWith__default = /*#__PURE__*/_interopDefaultLegacy(mergeWith);
37
37
 
38
- var css_248z = ".vulnerabilities-table .impact-icon {\n font-size: 1.5rem;\n padding-right: 0.5rem; }\n .vulnerabilities-table .impact-icon.color-critical {\n color: #a30000; }\n .vulnerabilities-table .impact-icon.color-important {\n color: #ec7a08; }\n .vulnerabilities-table .impact-icon.color-moderate {\n color: #f5c12e; }\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.filterable-table {\n padding-bottom: var(--pf-global--spacer--lg); }\n .filterable-table__bottom-pagination[class] {\n margin-top: 1rem; }\n .filterable-table .pf-c-toolbar {\n padding-top: 0; }\n .filterable-table .pf-c-toolbar__content {\n --pf-c-toolbar__content--PaddingRight: 0;\n --pf-c-toolbar__content--PaddingLeft: 0; }\n .filterable-table .pf-c-input-group__text {\n --pf-c-input-group__text--PaddingRight: 0; }\n .filterable-table .pf-c-pagination.pf-m-bottom {\n --pf-c-pagination--m-bottom--md--PaddingRight: 0; }\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.filter-input {\n width: 18rem;\n margin: 1rem 0 1rem 0; }\n";
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
40
  /*! *****************************************************************************
41
41
  Copyright (c) Microsoft Corporation.
@@ -64,7 +64,7 @@ function __rest(s, e) {
64
64
  return t;
65
65
  }
66
66
 
67
- Promise.resolve().then(function () { return require('./inline-edit-320c12ad.js'); });
67
+ Promise.resolve().then(function () { return require('./inline-edit-e7ffaa36.js'); });
68
68
  var inlineStyles = {
69
69
  "button": "pf-c-button",
70
70
  "inlineEdit": "pf-c-inline-edit",
@@ -118,7 +118,7 @@ function css(...args) {
118
118
  return classes.join(' ');
119
119
  }
120
120
 
121
- Promise.resolve().then(function () { return require('./table-817f1921.js'); });
121
+ Promise.resolve().then(function () { return require('./table-468a84b2.js'); });
122
122
  var styles$1 = {
123
123
  "button": "pf-c-button",
124
124
  "modifiers": {
@@ -199,7 +199,7 @@ var styles$1 = {
199
199
  "themeDark": "pf-theme-dark"
200
200
  };
201
201
 
202
- Promise.resolve().then(function () { return require('./table-grid-6f46705c.js'); });
202
+ Promise.resolve().then(function () { return require('./table-grid-f5923ae5.js'); });
203
203
  var stylesGrid = {
204
204
  "button": "pf-c-button",
205
205
  "modifiers": {
@@ -232,7 +232,7 @@ var stylesGrid = {
232
232
  "tableToggleIcon": "pf-c-table__toggle-icon"
233
233
  };
234
234
 
235
- Promise.resolve().then(function () { return require('./table-tree-view-eec85588.js'); });
235
+ Promise.resolve().then(function () { return require('./table-tree-view-650158c9.js'); });
236
236
  var stylesTreeView = {
237
237
  "dropdown": "pf-c-dropdown",
238
238
  "modifiers": {
@@ -392,7 +392,7 @@ const TrBase = (_a) => {
392
392
  const Tr = React__namespace.forwardRef((props, ref) => (React__namespace.createElement(TrBase, Object.assign({}, props, { innerRef: ref }))));
393
393
  Tr.displayName = 'Tr';
394
394
 
395
- Promise.resolve().then(function () { return require('./table-scrollable-423d12ef.js'); });
395
+ Promise.resolve().then(function () { return require('./table-scrollable-e0f500ba.js'); });
396
396
  var styles = {
397
397
  "modifiers": {
398
398
  "borderRight": "pf-m-border-right",
@@ -405,42 +405,42 @@ var styles = {
405
405
  "tableStickyColumn": "pf-c-table__sticky-column"
406
406
  };
407
407
 
408
- var IconSize;
408
+ var IconSize$1;
409
409
  (function (IconSize) {
410
410
  IconSize["sm"] = "sm";
411
411
  IconSize["md"] = "md";
412
412
  IconSize["lg"] = "lg";
413
413
  IconSize["xl"] = "xl";
414
- })(IconSize || (IconSize = {}));
415
- const getSize = (size) => {
414
+ })(IconSize$1 || (IconSize$1 = {}));
415
+ const getSize$1 = (size) => {
416
416
  switch (size) {
417
- case IconSize.sm:
417
+ case IconSize$1.sm:
418
418
  return '1em';
419
- case IconSize.md:
419
+ case IconSize$1.md:
420
420
  return '1.5em';
421
- case IconSize.lg:
421
+ case IconSize$1.lg:
422
422
  return '2em';
423
- case IconSize.xl:
423
+ case IconSize$1.xl:
424
424
  return '3em';
425
425
  default:
426
426
  return '1em';
427
427
  }
428
428
  };
429
- let currentId = 0;
429
+ let currentId$1 = 0;
430
430
  /**
431
431
  * Factory to create Icon class components for consumers
432
432
  */
433
- function createIcon({ name, xOffset = 0, yOffset = 0, width, height, svgPath }) {
433
+ function createIcon$1({ name, xOffset = 0, yOffset = 0, width, height, svgPath }) {
434
434
  var _a;
435
435
  return _a = class SVGIcon extends React__namespace.Component {
436
436
  constructor() {
437
437
  super(...arguments);
438
- this.id = `icon-title-${currentId++}`;
438
+ this.id = `icon-title-${currentId$1++}`;
439
439
  }
440
440
  render() {
441
441
  const _a = this.props, { size, color, title, noVerticalAlign } = _a, props = __rest(_a, ["size", "color", "title", "noVerticalAlign"]);
442
442
  const hasTitle = Boolean(title);
443
- const heightWidth = getSize(size);
443
+ const heightWidth = getSize$1(size);
444
444
  const baseAlign = -0.125 * Number.parseFloat(heightWidth);
445
445
  const style = noVerticalAlign ? null : { verticalAlign: `${baseAlign}em` };
446
446
  const viewBox = [xOffset, yOffset, width, height].join(' ');
@@ -452,7 +452,7 @@ function createIcon({ name, xOffset = 0, yOffset = 0, width, height, svgPath })
452
452
  _a.displayName = name,
453
453
  _a.defaultProps = {
454
454
  color: 'currentColor',
455
- size: IconSize.sm,
455
+ size: IconSize$1.sm,
456
456
  noVerticalAlign: false
457
457
  },
458
458
  _a;
@@ -467,7 +467,7 @@ const HelpIconConfig = {
467
467
  xOffset: 0,
468
468
  };
469
469
 
470
- const HelpIcon = createIcon(HelpIconConfig);
470
+ const HelpIcon = createIcon$1(HelpIconConfig);
471
471
 
472
472
  var HelpIcon$1 = HelpIcon;
473
473
 
@@ -528,7 +528,7 @@ const LongArrowAltUpIconConfig = {
528
528
  xOffset: 0,
529
529
  };
530
530
 
531
- const LongArrowAltUpIcon = createIcon(LongArrowAltUpIconConfig);
531
+ const LongArrowAltUpIcon = createIcon$1(LongArrowAltUpIconConfig);
532
532
 
533
533
  var LongArrowAltUpIcon$1 = LongArrowAltUpIcon;
534
534
 
@@ -541,7 +541,7 @@ const LongArrowAltDownIconConfig = {
541
541
  xOffset: 0,
542
542
  };
543
543
 
544
- const LongArrowAltDownIcon = createIcon(LongArrowAltDownIconConfig);
544
+ const LongArrowAltDownIcon = createIcon$1(LongArrowAltDownIconConfig);
545
545
 
546
546
  var LongArrowAltDownIcon$1 = LongArrowAltDownIcon;
547
547
 
@@ -554,7 +554,7 @@ const ArrowsAltVIconConfig = {
554
554
  xOffset: 0,
555
555
  };
556
556
 
557
- const ArrowsAltVIcon = createIcon(ArrowsAltVIconConfig);
557
+ const ArrowsAltVIcon = createIcon$1(ArrowsAltVIconConfig);
558
558
 
559
559
  var ArrowsAltVIcon$1 = ArrowsAltVIcon;
560
560
 
@@ -589,7 +589,7 @@ const StarIconConfig = {
589
589
  xOffset: 0,
590
590
  };
591
591
 
592
- const StarIcon = createIcon(StarIconConfig);
592
+ const StarIcon = createIcon$1(StarIconConfig);
593
593
 
594
594
  var StarIcon$1 = StarIcon;
595
595
 
@@ -649,7 +649,7 @@ const SelectColumn = (_a) => {
649
649
  };
650
650
  SelectColumn.displayName = 'SelectColumn';
651
651
 
652
- Promise.resolve().then(function () { return require('./check-ee7cdde5.js'); });
652
+ Promise.resolve().then(function () { return require('./check-27d5ec91.js'); });
653
653
  var checkStyles = {
654
654
  "check": "pf-c-check",
655
655
  "checkBody": "pf-c-check__body",
@@ -722,7 +722,7 @@ const AngleDownIconConfig = {
722
722
  xOffset: 0,
723
723
  };
724
724
 
725
- const AngleDownIcon = createIcon(AngleDownIconConfig);
725
+ const AngleDownIcon = createIcon$1(AngleDownIconConfig);
726
726
 
727
727
  var AngleDownIcon$1 = AngleDownIcon;
728
728
 
@@ -1070,7 +1070,7 @@ const GripVerticalIconConfig = {
1070
1070
  xOffset: 0,
1071
1071
  };
1072
1072
 
1073
- const GripVerticalIcon = createIcon(GripVerticalIconConfig);
1073
+ const GripVerticalIcon = createIcon$1(GripVerticalIconConfig);
1074
1074
 
1075
1075
  var GripVerticalIcon$1 = GripVerticalIcon;
1076
1076
 
@@ -1098,7 +1098,7 @@ const EllipsisHIconConfig = {
1098
1098
  xOffset: 0,
1099
1099
  };
1100
1100
 
1101
- const EllipsisHIcon = createIcon(EllipsisHIconConfig);
1101
+ const EllipsisHIcon = createIcon$1(EllipsisHIconConfig);
1102
1102
 
1103
1103
  var EllipsisHIcon$1 = EllipsisHIcon;
1104
1104
 
@@ -1239,6 +1239,59 @@ const TdBase = (_a) => {
1239
1239
  const Td = React__namespace.forwardRef((props, ref) => (React__namespace.createElement(TdBase, Object.assign({}, props, { innerRef: ref }))));
1240
1240
  Td.displayName = 'Td';
1241
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';
1261
+ }
1262
+ };
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
+
1242
1295
  const SearchIconConfig = {
1243
1296
  name: 'SearchIcon',
1244
1297
  height: 512,
@@ -1588,7 +1641,8 @@ function EcoSelect(_ref) {
1588
1641
  onSelect: onSelect,
1589
1642
  selections: selected,
1590
1643
  isOpen: isOpen,
1591
- placeholderText: placeholderText
1644
+ placeholderText: placeholderText,
1645
+ className: "pf-select-wrapper"
1592
1646
  }, options.map(function (option) {
1593
1647
  return React__default["default"].createElement(reactCore.SelectOption, {
1594
1648
  key: option,
@@ -1626,7 +1680,8 @@ var ToggleGroup = function ToggleGroup(props) {
1626
1680
  /* eslint-disable camelcase */
1627
1681
  var VulnerabilitiesTable = function VulnerabilitiesTable(_ref) {
1628
1682
  var vulnerabilities = _ref.vulnerabilities,
1629
- isLoading = _ref.isLoading;
1683
+ isLoading = _ref.isLoading,
1684
+ hideToggler = _ref.hideToggler;
1630
1685
 
1631
1686
  var getImpact = function getImpact(_ref2) {
1632
1687
  var severity = _ref2.severity;
@@ -1750,7 +1805,7 @@ var VulnerabilitiesTable = function VulnerabilitiesTable(_ref) {
1750
1805
  key: 'vulnerabilities-table__filter-input',
1751
1806
  onChange: onTextInputFilterChange,
1752
1807
  placeholder: 'Filter vulnerabilities'
1753
- }), React__default["default"].createElement(ToggleGroup, {
1808
+ }), !hideToggler ? React__default["default"].createElement(ToggleGroup, {
1754
1809
  key: 'vulnerabilities-table__toggle-group',
1755
1810
  onChange: onStatusFilterChange,
1756
1811
  "aria-label": 'Vulnerability status filter',
@@ -1764,7 +1819,7 @@ var VulnerabilitiesTable = function VulnerabilitiesTable(_ref) {
1764
1819
  id: 'unfixed',
1765
1820
  text: 'Unfixed'
1766
1821
  }]
1767
- }), React__default["default"].createElement(EcoSelect, {
1822
+ }) : React__default["default"].createElement(React__default["default"].Fragment, null), React__default["default"].createElement(EcoSelect, {
1768
1823
  key: 'vulnerabilities-table__select',
1769
1824
  onChange: onImpactFilterChange,
1770
1825
  "aria-label": 'Impact filter',
@@ -1801,6 +1856,7 @@ var PackagesTable = function PackagesTable(_ref) {
1801
1856
  vulnerabilities = _ref$vulnerabilities === void 0 ? [] : _ref$vulnerabilities,
1802
1857
  _ref$rpms = _ref.rpms,
1803
1858
  rpms = _ref$rpms === void 0 ? [] : _ref$rpms,
1859
+ hideToggler = _ref.hideToggler,
1804
1860
  _ref$isLoading = _ref.isLoading,
1805
1861
  isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading;
1806
1862
 
@@ -1868,7 +1924,8 @@ var PackagesTable = function PackagesTable(_ref) {
1868
1924
  title: "Vulnerabilities (" + uniqueVulnerabilities.length + ")"
1869
1925
  }, React__namespace.createElement(VulnerabilitiesTable, {
1870
1926
  vulnerabilities: uniqueVulnerabilities,
1871
- isLoading: isLoading
1927
+ isLoading: isLoading,
1928
+ hideToggler: hideToggler
1872
1929
  })), excludedPackages.length > 0 && React__namespace.createElement(reactCore.Tab, {
1873
1930
  eventKey: 1,
1874
1931
  title: "Excluded Packages (" + excludedPackages.length + ")"
@@ -12,7 +12,7 @@ import { DropdownSeparator } from '@patternfly/react-core/dist/esm/components/Dr
12
12
  import { DropdownPosition, DropdownDirection } from '@patternfly/react-core/dist/esm/components/Dropdown/dropdownConstants';
13
13
  import { format } from 'date-fns';
14
14
 
15
- var css_248z = ".vulnerabilities-table .impact-icon {\n font-size: 1.5rem;\n padding-right: 0.5rem; }\n .vulnerabilities-table .impact-icon.color-critical {\n color: #a30000; }\n .vulnerabilities-table .impact-icon.color-important {\n color: #ec7a08; }\n .vulnerabilities-table .impact-icon.color-moderate {\n color: #f5c12e; }\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.filterable-table {\n padding-bottom: var(--pf-global--spacer--lg); }\n .filterable-table__bottom-pagination[class] {\n margin-top: 1rem; }\n .filterable-table .pf-c-toolbar {\n padding-top: 0; }\n .filterable-table .pf-c-toolbar__content {\n --pf-c-toolbar__content--PaddingRight: 0;\n --pf-c-toolbar__content--PaddingLeft: 0; }\n .filterable-table .pf-c-input-group__text {\n --pf-c-input-group__text--PaddingRight: 0; }\n .filterable-table .pf-c-pagination.pf-m-bottom {\n --pf-c-pagination--m-bottom--md--PaddingRight: 0; }\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.filter-input {\n width: 18rem;\n margin: 1rem 0 1rem 0; }\n";
15
+ 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}";
16
16
 
17
17
  /*! *****************************************************************************
18
18
  Copyright (c) Microsoft Corporation.
@@ -39,7 +39,7 @@ function __rest(s, e) {
39
39
  return t;
40
40
  }
41
41
 
42
- import('./inline-edit-b186d03c.js');
42
+ import('./inline-edit-5c45ab66.js');
43
43
  var inlineStyles = {
44
44
  "button": "pf-c-button",
45
45
  "inlineEdit": "pf-c-inline-edit",
@@ -93,7 +93,7 @@ function css(...args) {
93
93
  return classes.join(' ');
94
94
  }
95
95
 
96
- import('./table-ffd0513c.js');
96
+ import('./table-76f2f3f9.js');
97
97
  var styles$1 = {
98
98
  "button": "pf-c-button",
99
99
  "modifiers": {
@@ -174,7 +174,7 @@ var styles$1 = {
174
174
  "themeDark": "pf-theme-dark"
175
175
  };
176
176
 
177
- import('./table-grid-5d7f8359.js');
177
+ import('./table-grid-06209f24.js');
178
178
  var stylesGrid = {
179
179
  "button": "pf-c-button",
180
180
  "modifiers": {
@@ -207,7 +207,7 @@ var stylesGrid = {
207
207
  "tableToggleIcon": "pf-c-table__toggle-icon"
208
208
  };
209
209
 
210
- import('./table-tree-view-ee6ac38a.js');
210
+ import('./table-tree-view-121a2cdb.js');
211
211
  var stylesTreeView = {
212
212
  "dropdown": "pf-c-dropdown",
213
213
  "modifiers": {
@@ -367,7 +367,7 @@ const TrBase = (_a) => {
367
367
  const Tr = React.forwardRef((props, ref) => (React.createElement(TrBase, Object.assign({}, props, { innerRef: ref }))));
368
368
  Tr.displayName = 'Tr';
369
369
 
370
- import('./table-scrollable-01103545.js');
370
+ import('./table-scrollable-5eeb1c66.js');
371
371
  var styles = {
372
372
  "modifiers": {
373
373
  "borderRight": "pf-m-border-right",
@@ -380,42 +380,42 @@ var styles = {
380
380
  "tableStickyColumn": "pf-c-table__sticky-column"
381
381
  };
382
382
 
383
- var IconSize;
383
+ var IconSize$1;
384
384
  (function (IconSize) {
385
385
  IconSize["sm"] = "sm";
386
386
  IconSize["md"] = "md";
387
387
  IconSize["lg"] = "lg";
388
388
  IconSize["xl"] = "xl";
389
- })(IconSize || (IconSize = {}));
390
- const getSize = (size) => {
389
+ })(IconSize$1 || (IconSize$1 = {}));
390
+ const getSize$1 = (size) => {
391
391
  switch (size) {
392
- case IconSize.sm:
392
+ case IconSize$1.sm:
393
393
  return '1em';
394
- case IconSize.md:
394
+ case IconSize$1.md:
395
395
  return '1.5em';
396
- case IconSize.lg:
396
+ case IconSize$1.lg:
397
397
  return '2em';
398
- case IconSize.xl:
398
+ case IconSize$1.xl:
399
399
  return '3em';
400
400
  default:
401
401
  return '1em';
402
402
  }
403
403
  };
404
- let currentId = 0;
404
+ let currentId$1 = 0;
405
405
  /**
406
406
  * Factory to create Icon class components for consumers
407
407
  */
408
- function createIcon({ name, xOffset = 0, yOffset = 0, width, height, svgPath }) {
408
+ function createIcon$1({ name, xOffset = 0, yOffset = 0, width, height, svgPath }) {
409
409
  var _a;
410
410
  return _a = class SVGIcon extends React.Component {
411
411
  constructor() {
412
412
  super(...arguments);
413
- this.id = `icon-title-${currentId++}`;
413
+ this.id = `icon-title-${currentId$1++}`;
414
414
  }
415
415
  render() {
416
416
  const _a = this.props, { size, color, title, noVerticalAlign } = _a, props = __rest(_a, ["size", "color", "title", "noVerticalAlign"]);
417
417
  const hasTitle = Boolean(title);
418
- const heightWidth = getSize(size);
418
+ const heightWidth = getSize$1(size);
419
419
  const baseAlign = -0.125 * Number.parseFloat(heightWidth);
420
420
  const style = noVerticalAlign ? null : { verticalAlign: `${baseAlign}em` };
421
421
  const viewBox = [xOffset, yOffset, width, height].join(' ');
@@ -427,7 +427,7 @@ function createIcon({ name, xOffset = 0, yOffset = 0, width, height, svgPath })
427
427
  _a.displayName = name,
428
428
  _a.defaultProps = {
429
429
  color: 'currentColor',
430
- size: IconSize.sm,
430
+ size: IconSize$1.sm,
431
431
  noVerticalAlign: false
432
432
  },
433
433
  _a;
@@ -442,7 +442,7 @@ const HelpIconConfig = {
442
442
  xOffset: 0,
443
443
  };
444
444
 
445
- const HelpIcon = createIcon(HelpIconConfig);
445
+ const HelpIcon = createIcon$1(HelpIconConfig);
446
446
 
447
447
  var HelpIcon$1 = HelpIcon;
448
448
 
@@ -503,7 +503,7 @@ const LongArrowAltUpIconConfig = {
503
503
  xOffset: 0,
504
504
  };
505
505
 
506
- const LongArrowAltUpIcon = createIcon(LongArrowAltUpIconConfig);
506
+ const LongArrowAltUpIcon = createIcon$1(LongArrowAltUpIconConfig);
507
507
 
508
508
  var LongArrowAltUpIcon$1 = LongArrowAltUpIcon;
509
509
 
@@ -516,7 +516,7 @@ const LongArrowAltDownIconConfig = {
516
516
  xOffset: 0,
517
517
  };
518
518
 
519
- const LongArrowAltDownIcon = createIcon(LongArrowAltDownIconConfig);
519
+ const LongArrowAltDownIcon = createIcon$1(LongArrowAltDownIconConfig);
520
520
 
521
521
  var LongArrowAltDownIcon$1 = LongArrowAltDownIcon;
522
522
 
@@ -529,7 +529,7 @@ const ArrowsAltVIconConfig = {
529
529
  xOffset: 0,
530
530
  };
531
531
 
532
- const ArrowsAltVIcon = createIcon(ArrowsAltVIconConfig);
532
+ const ArrowsAltVIcon = createIcon$1(ArrowsAltVIconConfig);
533
533
 
534
534
  var ArrowsAltVIcon$1 = ArrowsAltVIcon;
535
535
 
@@ -564,7 +564,7 @@ const StarIconConfig = {
564
564
  xOffset: 0,
565
565
  };
566
566
 
567
- const StarIcon = createIcon(StarIconConfig);
567
+ const StarIcon = createIcon$1(StarIconConfig);
568
568
 
569
569
  var StarIcon$1 = StarIcon;
570
570
 
@@ -624,7 +624,7 @@ const SelectColumn = (_a) => {
624
624
  };
625
625
  SelectColumn.displayName = 'SelectColumn';
626
626
 
627
- import('./check-317f30b2.js');
627
+ import('./check-120c4f98.js');
628
628
  var checkStyles = {
629
629
  "check": "pf-c-check",
630
630
  "checkBody": "pf-c-check__body",
@@ -697,7 +697,7 @@ const AngleDownIconConfig = {
697
697
  xOffset: 0,
698
698
  };
699
699
 
700
- const AngleDownIcon = createIcon(AngleDownIconConfig);
700
+ const AngleDownIcon = createIcon$1(AngleDownIconConfig);
701
701
 
702
702
  var AngleDownIcon$1 = AngleDownIcon;
703
703
 
@@ -1045,7 +1045,7 @@ const GripVerticalIconConfig = {
1045
1045
  xOffset: 0,
1046
1046
  };
1047
1047
 
1048
- const GripVerticalIcon = createIcon(GripVerticalIconConfig);
1048
+ const GripVerticalIcon = createIcon$1(GripVerticalIconConfig);
1049
1049
 
1050
1050
  var GripVerticalIcon$1 = GripVerticalIcon;
1051
1051
 
@@ -1073,7 +1073,7 @@ const EllipsisHIconConfig = {
1073
1073
  xOffset: 0,
1074
1074
  };
1075
1075
 
1076
- const EllipsisHIcon = createIcon(EllipsisHIconConfig);
1076
+ const EllipsisHIcon = createIcon$1(EllipsisHIconConfig);
1077
1077
 
1078
1078
  var EllipsisHIcon$1 = EllipsisHIcon;
1079
1079
 
@@ -1214,6 +1214,59 @@ const TdBase = (_a) => {
1214
1214
  const Td = React.forwardRef((props, ref) => (React.createElement(TdBase, Object.assign({}, props, { innerRef: ref }))));
1215
1215
  Td.displayName = 'Td';
1216
1216
 
1217
+ var IconSize;
1218
+ (function (IconSize) {
1219
+ IconSize["sm"] = "sm";
1220
+ IconSize["md"] = "md";
1221
+ IconSize["lg"] = "lg";
1222
+ IconSize["xl"] = "xl";
1223
+ })(IconSize || (IconSize = {}));
1224
+ const getSize = (size) => {
1225
+ switch (size) {
1226
+ case IconSize.sm:
1227
+ return '1em';
1228
+ case IconSize.md:
1229
+ return '1.5em';
1230
+ case IconSize.lg:
1231
+ return '2em';
1232
+ case IconSize.xl:
1233
+ return '3em';
1234
+ default:
1235
+ return '1em';
1236
+ }
1237
+ };
1238
+ let currentId = 0;
1239
+ /**
1240
+ * Factory to create Icon class components for consumers
1241
+ */
1242
+ function createIcon({ name, xOffset = 0, yOffset = 0, width, height, svgPath }) {
1243
+ var _a;
1244
+ return _a = class SVGIcon extends React.Component {
1245
+ constructor() {
1246
+ super(...arguments);
1247
+ this.id = `icon-title-${currentId++}`;
1248
+ }
1249
+ render() {
1250
+ const _a = this.props, { size, color, title, noVerticalAlign } = _a, props = __rest(_a, ["size", "color", "title", "noVerticalAlign"]);
1251
+ const hasTitle = Boolean(title);
1252
+ const heightWidth = getSize(size);
1253
+ const baseAlign = -0.125 * Number.parseFloat(heightWidth);
1254
+ const style = noVerticalAlign ? null : { verticalAlign: `${baseAlign}em` };
1255
+ const viewBox = [xOffset, yOffset, width, height].join(' ');
1256
+ return (React.createElement("svg", Object.assign({ style: style, fill: color, height: heightWidth, width: heightWidth, viewBox: viewBox, "aria-labelledby": hasTitle ? this.id : null, "aria-hidden": hasTitle ? null : true, role: "img" }, props),
1257
+ hasTitle && React.createElement("title", { id: this.id }, title),
1258
+ React.createElement("path", { d: svgPath })));
1259
+ }
1260
+ },
1261
+ _a.displayName = name,
1262
+ _a.defaultProps = {
1263
+ color: 'currentColor',
1264
+ size: IconSize.sm,
1265
+ noVerticalAlign: false
1266
+ },
1267
+ _a;
1268
+ }
1269
+
1217
1270
  const SearchIconConfig = {
1218
1271
  name: 'SearchIcon',
1219
1272
  height: 512,
@@ -1516,7 +1569,8 @@ function EcoSelect({
1516
1569
  onSelect: onSelect,
1517
1570
  selections: selected,
1518
1571
  isOpen: isOpen,
1519
- placeholderText: placeholderText
1572
+ placeholderText: placeholderText,
1573
+ className: "pf-select-wrapper"
1520
1574
  }, options.map(option => React__default.createElement(SelectOption, {
1521
1575
  key: option,
1522
1576
  value: option
@@ -1548,7 +1602,8 @@ const ToggleGroup = props => {
1548
1602
  /* eslint-disable camelcase */
1549
1603
  const VulnerabilitiesTable = ({
1550
1604
  vulnerabilities,
1551
- isLoading
1605
+ isLoading,
1606
+ hideToggler
1552
1607
  }) => {
1553
1608
  const getImpact = ({
1554
1609
  severity
@@ -1670,7 +1725,7 @@ const VulnerabilitiesTable = ({
1670
1725
  key: 'vulnerabilities-table__filter-input',
1671
1726
  onChange: onTextInputFilterChange,
1672
1727
  placeholder: 'Filter vulnerabilities'
1673
- }), React__default.createElement(ToggleGroup, {
1728
+ }), !hideToggler ? React__default.createElement(ToggleGroup, {
1674
1729
  key: 'vulnerabilities-table__toggle-group',
1675
1730
  onChange: onStatusFilterChange,
1676
1731
  "aria-label": 'Vulnerability status filter',
@@ -1684,7 +1739,7 @@ const VulnerabilitiesTable = ({
1684
1739
  id: 'unfixed',
1685
1740
  text: 'Unfixed'
1686
1741
  }]
1687
- }), React__default.createElement(EcoSelect, {
1742
+ }) : React__default.createElement(React__default.Fragment, null), React__default.createElement(EcoSelect, {
1688
1743
  key: 'vulnerabilities-table__select',
1689
1744
  onChange: onImpactFilterChange,
1690
1745
  "aria-label": 'Impact filter',
@@ -1717,6 +1772,7 @@ const InsertCss = () => {
1717
1772
  const PackagesTable = ({
1718
1773
  vulnerabilities: _vulnerabilities = [],
1719
1774
  rpms: _rpms = [],
1775
+ hideToggler,
1720
1776
  isLoading: _isLoading = false
1721
1777
  }) => {
1722
1778
  const [excludedPackages, setExcludedPackages] = React.useState([]);
@@ -1765,7 +1821,8 @@ const PackagesTable = ({
1765
1821
  title: `Vulnerabilities (${uniqueVulnerabilities.length})`
1766
1822
  }, React.createElement(VulnerabilitiesTable, {
1767
1823
  vulnerabilities: uniqueVulnerabilities,
1768
- isLoading: _isLoading
1824
+ isLoading: _isLoading,
1825
+ hideToggler: hideToggler
1769
1826
  })), excludedPackages.length > 0 && React.createElement(Tab, {
1770
1827
  eventKey: 1,
1771
1828
  title: `Excluded Packages (${excludedPackages.length})`
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhc-shared-components/packages-table",
3
- "version": "0.2.5",
3
+ "version": "0.3.2",
4
4
  "description": "project description",
5
5
  "author": "redhatofficial",
6
6
  "license": "MIT",
@@ -54,17 +54,17 @@
54
54
  "eslint-plugin-react": "^7.17.0",
55
55
  "eslint-plugin-standard": "^4.0.1",
56
56
  "microbundle": "^0.13.3",
57
- "node-sass": "^4.0.0",
58
57
  "npm-run-all": "^4.1.5",
59
58
  "prettier": "^2.0.4",
60
59
  "react": "^16.13.1",
61
60
  "react-dom": "^16.13.1",
62
61
  "react-scripts": "^3.4.1",
63
62
  "rimraf": "^3.0.2",
63
+ "sass": "^1.57.1",
64
64
  "typescript": "^3.7.5"
65
65
  },
66
66
  "dependencies": {
67
- "@patternfly/react-core": "^4.101.3",
67
+ "@patternfly/react-core": "^4.276.6",
68
68
  "date-fns": "^2.13.0",
69
69
  "formik": "^2.1.4",
70
70
  "lodash": "^4.17.21",