@patternfly/react-table 4.48.1 → 4.50.1

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.
@@ -6298,14 +6298,31 @@
6298
6298
  PopoverContent.displayName = 'PopoverContent';
6299
6299
 
6300
6300
  const PopoverBody = (_a) => {
6301
- var { children, id } = _a, props = __rest$1(_a, ["children", "id"]);
6302
- return (React__namespace.createElement("div", Object.assign({ className: css(_default$6.popoverBody), id: id }, props), children));
6301
+ var { children, id, className } = _a, props = __rest$1(_a, ["children", "id", "className"]);
6302
+ return (React__namespace.createElement("div", Object.assign({ className: css(_default$6.popoverBody, className), id: id }, props), children));
6303
6303
  };
6304
6304
  PopoverBody.displayName = 'PopoverBody';
6305
6305
 
6306
+ const PopoverHeaderIcon = (_a) => {
6307
+ var { children, className } = _a, props = __rest$1(_a, ["children", "className"]);
6308
+ return (React__namespace.createElement("span", Object.assign({ className: css(_default$6.popoverTitleIcon, className) }, props), children));
6309
+ };
6310
+ PopoverHeaderIcon.displayName = 'PopoverHeaderIcon';
6311
+
6312
+ const PopoverHeaderText = (_a) => {
6313
+ var { children, className } = _a, props = __rest$1(_a, ["children", "className"]);
6314
+ return (React__namespace.createElement("span", Object.assign({ className: css(_default$6.popoverTitleText, className) }, props), children));
6315
+ };
6316
+ PopoverHeaderText.displayName = 'PopoverHeaderText';
6317
+
6306
6318
  const PopoverHeader = (_a) => {
6307
- var { children, id } = _a, props = __rest$1(_a, ["children", "id"]);
6308
- return (React__namespace.createElement(PopoverContext.Consumer, null, ({ headerComponent }) => (React__namespace.createElement(Title, Object.assign({ headingLevel: headerComponent, size: TitleSizes.md, id: id }, props), children))));
6319
+ var { children, icon, className, titleHeadingLevel = 'h6', alertSeverityVariant, id, alertSeverityScreenReaderText } = _a, props = __rest$1(_a, ["children", "icon", "className", "titleHeadingLevel", "alertSeverityVariant", "id", "alertSeverityScreenReaderText"]);
6320
+ const HeadingLevel = titleHeadingLevel;
6321
+ return icon || alertSeverityVariant ? (React__namespace.createElement("header", Object.assign({ className: css('pf-c-popover__header', className), id: id }, props),
6322
+ React__namespace.createElement(HeadingLevel, { className: css(_default$6.popoverTitle, icon && _default$6.modifiers.icon) },
6323
+ icon && React__namespace.createElement(PopoverHeaderIcon, null, icon),
6324
+ alertSeverityVariant && alertSeverityScreenReaderText && (React__namespace.createElement("span", { className: "pf-u-screen-reader" }, alertSeverityScreenReaderText)),
6325
+ React__namespace.createElement(PopoverHeaderText, null, children)))) : (React__namespace.createElement(Title, Object.assign({ headingLevel: titleHeadingLevel, size: TitleSizes.md, id: id, className: className }, props), children));
6309
6326
  };
6310
6327
  PopoverHeader.displayName = 'PopoverHeader';
6311
6328
 
@@ -6366,10 +6383,17 @@
6366
6383
  PopoverPosition["rightStart"] = "right-start";
6367
6384
  PopoverPosition["rightEnd"] = "right-end";
6368
6385
  })(PopoverPosition || (PopoverPosition = {}));
6386
+ const alertStyle = {
6387
+ default: _default$6.modifiers.default,
6388
+ info: _default$6.modifiers.info,
6389
+ success: _default$6.modifiers.success,
6390
+ warning: _default$6.modifiers.warning,
6391
+ danger: _default$6.modifiers.danger
6392
+ };
6369
6393
  const Popover = (_a) => {
6370
- var { children, position = 'top', enableFlip = true, className = '', isVisible = null, shouldClose = () => null, shouldOpen = () => null, 'aria-label': ariaLabel = '', bodyContent, headerContent = null, headerComponent = 'h6', footerContent = null, appendTo = () => document.body, hideOnOutsideClick = true, onHide = () => null, onHidden = () => null, onShow = () => null, onShown = () => null, onMount = () => null, zIndex = 9999, minWidth = popoverMinWidth && popoverMinWidth.value, maxWidth = popoverMaxWidth && popoverMaxWidth.value, closeBtnAriaLabel = 'Close', showClose = true, distance = 25,
6394
+ var { children, position = 'top', enableFlip = true, className = '', isVisible = null, shouldClose = () => null, shouldOpen = () => null, 'aria-label': ariaLabel = '', bodyContent, headerContent = null, headerComponent = 'h6', headerIcon = null, alertSeverityVariant, alertSeverityScreenReaderText, footerContent = null, appendTo = () => document.body, hideOnOutsideClick = true, onHide = () => null, onHidden = () => null, onShow = () => null, onShown = () => null, onMount = () => null, zIndex = 9999, minWidth = popoverMinWidth && popoverMinWidth.value, maxWidth = popoverMaxWidth && popoverMaxWidth.value, closeBtnAriaLabel = 'Close', showClose = true, distance = 25,
6371
6395
  // For every initial starting position, there are 3 escape positions
6372
- flipBehavior = ['top', 'right', 'bottom', 'left', 'top', 'right', 'bottom'], animationDuration = 300, id, withFocusTrap: propWithFocusTrap, boundary, tippyProps, reference, hasNoPadding = false, hasAutoWidth = false } = _a, rest = __rest$1(_a, ["children", "position", "enableFlip", "className", "isVisible", "shouldClose", "shouldOpen", 'aria-label', "bodyContent", "headerContent", "headerComponent", "footerContent", "appendTo", "hideOnOutsideClick", "onHide", "onHidden", "onShow", "onShown", "onMount", "zIndex", "minWidth", "maxWidth", "closeBtnAriaLabel", "showClose", "distance", "flipBehavior", "animationDuration", "id", "withFocusTrap", "boundary", "tippyProps", "reference", "hasNoPadding", "hasAutoWidth"]);
6396
+ flipBehavior = ['top', 'right', 'bottom', 'left', 'top', 'right', 'bottom'], animationDuration = 300, id, withFocusTrap: propWithFocusTrap, boundary, tippyProps, reference, hasNoPadding = false, hasAutoWidth = false } = _a, rest = __rest$1(_a, ["children", "position", "enableFlip", "className", "isVisible", "shouldClose", "shouldOpen", 'aria-label', "bodyContent", "headerContent", "headerComponent", "headerIcon", "alertSeverityVariant", "alertSeverityScreenReaderText", "footerContent", "appendTo", "hideOnOutsideClick", "onHide", "onHidden", "onShow", "onShown", "onMount", "zIndex", "minWidth", "maxWidth", "closeBtnAriaLabel", "showClose", "distance", "flipBehavior", "animationDuration", "id", "withFocusTrap", "boundary", "tippyProps", "reference", "hasNoPadding", "hasAutoWidth"]);
6373
6397
  {
6374
6398
  boundary !== undefined &&
6375
6399
  console.warn('The Popover boundary prop has been deprecated. If you want to constrain the popper to a specific element use the appendTo prop instead.');
@@ -6515,7 +6539,7 @@
6515
6539
  }
6516
6540
  return node;
6517
6541
  }
6518
- }, preventScrollOnDeactivate: true, className: css(_default$6.popover, hasNoPadding && _default$6.modifiers.noPadding, hasAutoWidth && _default$6.modifiers.widthAuto, className), role: "dialog", "aria-modal": "true", "aria-label": headerContent ? undefined : ariaLabel, "aria-labelledby": headerContent ? `popover-${uniqueId}-header` : undefined, "aria-describedby": `popover-${uniqueId}-body`, onMouseDown: onContentMouseDown, style: {
6542
+ }, preventScrollOnDeactivate: true, className: css(_default$6.popover, alertSeverityVariant && alertStyle[alertSeverityVariant], hasNoPadding && _default$6.modifiers.noPadding, hasAutoWidth && _default$6.modifiers.widthAuto, className), role: "dialog", "aria-modal": "true", "aria-label": headerContent ? undefined : ariaLabel, "aria-labelledby": headerContent ? `popover-${uniqueId}-header` : undefined, "aria-describedby": `popover-${uniqueId}-body`, onMouseDown: onContentMouseDown, style: {
6519
6543
  minWidth: hasCustomMinWidth ? minWidth : null,
6520
6544
  maxWidth: hasCustomMaxWidth ? maxWidth : null,
6521
6545
  opacity,
@@ -6524,7 +6548,7 @@
6524
6548
  React__namespace.createElement(PopoverArrow, null),
6525
6549
  React__namespace.createElement(PopoverContent, null,
6526
6550
  showClose && React__namespace.createElement(PopoverCloseButton, { onClose: closePopover, "aria-label": closeBtnAriaLabel }),
6527
- headerContent && (React__namespace.createElement(PopoverHeader, { id: `popover-${uniqueId}-header` }, typeof headerContent === 'function' ? headerContent(hide) : headerContent)),
6551
+ headerContent && (React__namespace.createElement(PopoverHeader, { id: `popover-${uniqueId}-header`, icon: headerIcon, alertSeverityVariant: alertSeverityVariant, alertSeverityScreenReaderText: alertSeverityScreenReaderText || `${alertSeverityVariant} alert:`, titleHeadingLevel: headerComponent }, typeof headerContent === 'function' ? headerContent(hide) : headerContent)),
6528
6552
  React__namespace.createElement(PopoverBody, { id: `popover-${uniqueId}-body` }, typeof bodyContent === 'function' ? bodyContent(hide) : bodyContent),
6529
6553
  footerContent && (React__namespace.createElement(PopoverFooter, { id: `popover-${uniqueId}-footer` }, typeof footerContent === 'function' ? footerContent(hide) : footerContent)))));
6530
6554
  return (React__namespace.createElement(PopoverContext.Provider, { value: { headerComponent } },