@patternfly/react-core 4.194.3 → 4.195.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/esm/components/Alert/Alert.d.ts +2 -1
  3. package/dist/esm/components/Alert/Alert.d.ts.map +1 -1
  4. package/dist/esm/components/Alert/Alert.js.map +1 -1
  5. package/dist/esm/components/ChipGroup/Chip.d.ts +2 -1
  6. package/dist/esm/components/ChipGroup/Chip.d.ts.map +1 -1
  7. package/dist/esm/components/ChipGroup/Chip.js.map +1 -1
  8. package/dist/esm/components/ChipGroup/ChipGroup.d.ts +2 -1
  9. package/dist/esm/components/ChipGroup/ChipGroup.d.ts.map +1 -1
  10. package/dist/esm/components/ChipGroup/ChipGroup.js.map +1 -1
  11. package/dist/esm/components/ClipboardCopy/ClipboardCopy.d.ts +1 -1
  12. package/dist/esm/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
  13. package/dist/esm/components/ClipboardCopy/ClipboardCopy.js +2 -2
  14. package/dist/esm/components/ClipboardCopy/ClipboardCopy.js.map +1 -1
  15. package/dist/esm/components/ClipboardCopy/ClipboardCopyButton.d.ts +2 -1
  16. package/dist/esm/components/ClipboardCopy/ClipboardCopyButton.d.ts.map +1 -1
  17. package/dist/esm/components/ClipboardCopy/ClipboardCopyButton.js.map +1 -1
  18. package/dist/esm/components/Label/Label.d.ts +2 -1
  19. package/dist/esm/components/Label/Label.d.ts.map +1 -1
  20. package/dist/esm/components/Label/Label.js.map +1 -1
  21. package/dist/esm/components/LabelGroup/LabelGroup.d.ts +2 -1
  22. package/dist/esm/components/LabelGroup/LabelGroup.d.ts.map +1 -1
  23. package/dist/esm/components/LabelGroup/LabelGroup.js.map +1 -1
  24. package/dist/esm/components/NotificationDrawer/NotificationDrawerGroup.d.ts +2 -1
  25. package/dist/esm/components/NotificationDrawer/NotificationDrawerGroup.d.ts.map +1 -1
  26. package/dist/esm/components/NotificationDrawer/NotificationDrawerGroup.js.map +1 -1
  27. package/dist/esm/components/NotificationDrawer/NotificationDrawerListItemHeader.d.ts +2 -1
  28. package/dist/esm/components/NotificationDrawer/NotificationDrawerListItemHeader.d.ts.map +1 -1
  29. package/dist/esm/components/NotificationDrawer/NotificationDrawerListItemHeader.js.map +1 -1
  30. package/dist/esm/components/Popover/Popover.d.ts +1 -1
  31. package/dist/esm/components/Popover/Popover.d.ts.map +1 -1
  32. package/dist/esm/components/Popover/Popover.js.map +1 -1
  33. package/dist/esm/components/Progress/ProgressContainer.d.ts +2 -1
  34. package/dist/esm/components/Progress/ProgressContainer.d.ts.map +1 -1
  35. package/dist/esm/components/Progress/ProgressContainer.js.map +1 -1
  36. package/dist/esm/components/TextInputGroup/TextInputGroupMain.d.ts +2 -0
  37. package/dist/esm/components/TextInputGroup/TextInputGroupMain.d.ts.map +1 -1
  38. package/dist/esm/components/TextInputGroup/TextInputGroupMain.js +2 -1
  39. package/dist/esm/components/TextInputGroup/TextInputGroupMain.js.map +1 -1
  40. package/dist/esm/components/Tooltip/Tooltip.d.ts +11 -3
  41. package/dist/esm/components/Tooltip/Tooltip.d.ts.map +1 -1
  42. package/dist/esm/components/Tooltip/Tooltip.js +17 -1
  43. package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
  44. package/dist/esm/components/Truncate/Truncate.d.ts +2 -1
  45. package/dist/esm/components/Truncate/Truncate.d.ts.map +1 -1
  46. package/dist/esm/components/Truncate/Truncate.js.map +1 -1
  47. package/dist/js/components/Alert/Alert.d.ts +2 -1
  48. package/dist/js/components/Alert/Alert.d.ts.map +1 -1
  49. package/dist/js/components/Alert/Alert.js.map +1 -1
  50. package/dist/js/components/ChipGroup/Chip.d.ts +2 -1
  51. package/dist/js/components/ChipGroup/Chip.d.ts.map +1 -1
  52. package/dist/js/components/ChipGroup/Chip.js.map +1 -1
  53. package/dist/js/components/ChipGroup/ChipGroup.d.ts +2 -1
  54. package/dist/js/components/ChipGroup/ChipGroup.d.ts.map +1 -1
  55. package/dist/js/components/ChipGroup/ChipGroup.js.map +1 -1
  56. package/dist/js/components/ClipboardCopy/ClipboardCopy.d.ts +1 -1
  57. package/dist/js/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
  58. package/dist/js/components/ClipboardCopy/ClipboardCopy.js +2 -2
  59. package/dist/js/components/ClipboardCopy/ClipboardCopy.js.map +1 -1
  60. package/dist/js/components/ClipboardCopy/ClipboardCopyButton.d.ts +2 -1
  61. package/dist/js/components/ClipboardCopy/ClipboardCopyButton.d.ts.map +1 -1
  62. package/dist/js/components/ClipboardCopy/ClipboardCopyButton.js.map +1 -1
  63. package/dist/js/components/Label/Label.d.ts +2 -1
  64. package/dist/js/components/Label/Label.d.ts.map +1 -1
  65. package/dist/js/components/Label/Label.js.map +1 -1
  66. package/dist/js/components/LabelGroup/LabelGroup.d.ts +2 -1
  67. package/dist/js/components/LabelGroup/LabelGroup.d.ts.map +1 -1
  68. package/dist/js/components/LabelGroup/LabelGroup.js.map +1 -1
  69. package/dist/js/components/NotificationDrawer/NotificationDrawerGroup.d.ts +2 -1
  70. package/dist/js/components/NotificationDrawer/NotificationDrawerGroup.d.ts.map +1 -1
  71. package/dist/js/components/NotificationDrawer/NotificationDrawerGroup.js.map +1 -1
  72. package/dist/js/components/NotificationDrawer/NotificationDrawerListItemHeader.d.ts +2 -1
  73. package/dist/js/components/NotificationDrawer/NotificationDrawerListItemHeader.d.ts.map +1 -1
  74. package/dist/js/components/NotificationDrawer/NotificationDrawerListItemHeader.js.map +1 -1
  75. package/dist/js/components/Popover/Popover.d.ts +1 -1
  76. package/dist/js/components/Popover/Popover.d.ts.map +1 -1
  77. package/dist/js/components/Popover/Popover.js.map +1 -1
  78. package/dist/js/components/Progress/ProgressContainer.d.ts +2 -1
  79. package/dist/js/components/Progress/ProgressContainer.d.ts.map +1 -1
  80. package/dist/js/components/Progress/ProgressContainer.js.map +1 -1
  81. package/dist/js/components/TextInputGroup/TextInputGroupMain.d.ts +2 -0
  82. package/dist/js/components/TextInputGroup/TextInputGroupMain.d.ts.map +1 -1
  83. package/dist/js/components/TextInputGroup/TextInputGroupMain.js +2 -1
  84. package/dist/js/components/TextInputGroup/TextInputGroupMain.js.map +1 -1
  85. package/dist/js/components/Tooltip/Tooltip.d.ts +11 -3
  86. package/dist/js/components/Tooltip/Tooltip.d.ts.map +1 -1
  87. package/dist/js/components/Tooltip/Tooltip.js +17 -1
  88. package/dist/js/components/Tooltip/Tooltip.js.map +1 -1
  89. package/dist/js/components/Truncate/Truncate.d.ts +2 -1
  90. package/dist/js/components/Truncate/Truncate.d.ts.map +1 -1
  91. package/dist/js/components/Truncate/Truncate.js.map +1 -1
  92. package/dist/umd/react-core.js +619 -602
  93. package/dist/umd/react-core.min.js +2 -2
  94. package/package.json +5 -5
  95. package/src/components/Alert/Alert.tsx +16 -2
  96. package/src/components/CalendarMonth/examples/CalendarMonth.md +2 -18
  97. package/src/components/CalendarMonth/examples/CalendarMonthDefault.tsx +4 -0
  98. package/src/components/CalendarMonth/examples/CalendarMonthSelectableDate.tsx +13 -0
  99. package/src/components/ChipGroup/Chip.tsx +16 -2
  100. package/src/components/ChipGroup/ChipGroup.tsx +16 -2
  101. package/src/components/ClipboardCopy/ClipboardCopy.tsx +16 -3
  102. package/src/components/ClipboardCopy/ClipboardCopyButton.tsx +2 -1
  103. package/src/components/Label/Label.tsx +16 -2
  104. package/src/components/LabelGroup/LabelGroup.tsx +16 -2
  105. package/src/components/NotificationDrawer/NotificationDrawerGroup.tsx +16 -2
  106. package/src/components/NotificationDrawer/NotificationDrawerListItemHeader.tsx +16 -2
  107. package/src/components/Popover/Popover.tsx +1 -0
  108. package/src/components/Progress/ProgressContainer.tsx +16 -2
  109. package/src/components/TextInputGroup/TextInputGroupMain.tsx +12 -0
  110. package/src/components/Tooltip/Tooltip.tsx +35 -3
  111. package/src/components/Tooltip/__tests__/Generated/__snapshots__/Tooltip.test.tsx.snap +8 -0
  112. package/src/components/Tooltip/__tests__/__snapshots__/Tooltip.test.tsx.snap +8 -0
  113. package/src/components/Tooltip/examples/Tooltip.md +8 -0
  114. package/src/components/Truncate/Truncate.tsx +16 -2
  115. package/src/demos/TextInputGroupDemo.md +2 -2
  116. package/src/demos/examples/TextInputGroup/AutoCompleteSearch.tsx +17 -0
@@ -4187,6 +4187,14 @@
4187
4187
  TooltipPosition["bottom"] = "bottom";
4188
4188
  TooltipPosition["left"] = "left";
4189
4189
  TooltipPosition["right"] = "right";
4190
+ TooltipPosition["topStart"] = "top-start";
4191
+ TooltipPosition["topEnd"] = "top-end";
4192
+ TooltipPosition["bottomStart"] = "bottom-start";
4193
+ TooltipPosition["bottomEnd"] = "bottom-end";
4194
+ TooltipPosition["leftStart"] = "left-start";
4195
+ TooltipPosition["leftEnd"] = "left-end";
4196
+ TooltipPosition["rightStart"] = "right-start";
4197
+ TooltipPosition["rightEnd"] = "right-end";
4190
4198
  })(exports.TooltipPosition || (exports.TooltipPosition = {}));
4191
4199
  // id for associating trigger with the content aria-describedby or aria-labelledby
4192
4200
  let pfTooltipIdCounter = 1;
@@ -4264,7 +4272,15 @@
4264
4272
  top: _default$1e.modifiers.top,
4265
4273
  bottom: _default$1e.modifiers.bottom,
4266
4274
  left: _default$1e.modifiers.left,
4267
- right: _default$1e.modifiers.right
4275
+ right: _default$1e.modifiers.right,
4276
+ 'top-start': _default$1e.modifiers.topLeft,
4277
+ 'top-end': _default$1e.modifiers.topRight,
4278
+ 'bottom-start': _default$1e.modifiers.bottomLeft,
4279
+ 'bottom-end': _default$1e.modifiers.bottomRight,
4280
+ 'left-start': _default$1e.modifiers.leftTop,
4281
+ 'left-end': _default$1e.modifiers.leftBottom,
4282
+ 'right-start': _default$1e.modifiers.rightTop,
4283
+ 'right-end': _default$1e.modifiers.rightBottom
4268
4284
  };
4269
4285
  const hasCustomMaxWidth = maxWidth !== tooltipMaxWidth.value;
4270
4286
  const content = (React__namespace.createElement("div", Object.assign({ className: css(_default$1e.tooltip, className), role: "tooltip", id: id, style: {
@@ -8033,207 +8049,509 @@
8033
8049
  }
8034
8050
  };
8035
8051
 
8036
- const CopyIconConfig = {
8037
- name: 'CopyIcon',
8038
- height: 512,
8039
- width: 448,
8040
- svgPath: 'M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z',
8041
- yOffset: 0,
8042
- xOffset: 0,
8052
+ var _default$W = {
8053
+ "button": "pf-c-button",
8054
+ "modifiers": {
8055
+ "noPadding": "pf-m-no-padding",
8056
+ "widthAuto": "pf-m-width-auto",
8057
+ "top": "pf-m-top",
8058
+ "topLeft": "pf-m-top-left",
8059
+ "topRight": "pf-m-top-right",
8060
+ "bottom": "pf-m-bottom",
8061
+ "bottomLeft": "pf-m-bottom-left",
8062
+ "bottomRight": "pf-m-bottom-right",
8063
+ "left": "pf-m-left",
8064
+ "leftTop": "pf-m-left-top",
8065
+ "leftBottom": "pf-m-left-bottom",
8066
+ "right": "pf-m-right",
8067
+ "rightTop": "pf-m-right-top",
8068
+ "rightBottom": "pf-m-right-bottom",
8069
+ "danger": "pf-m-danger",
8070
+ "warning": "pf-m-warning",
8071
+ "success": "pf-m-success",
8072
+ "default": "pf-m-default",
8073
+ "info": "pf-m-info",
8074
+ "icon": "pf-m-icon"
8075
+ },
8076
+ "popover": "pf-c-popover",
8077
+ "popoverArrow": "pf-c-popover__arrow",
8078
+ "popoverBody": "pf-c-popover__body",
8079
+ "popoverContent": "pf-c-popover__content",
8080
+ "popoverFooter": "pf-c-popover__footer",
8081
+ "popoverTitle": "pf-c-popover__title",
8082
+ "popoverTitleIcon": "pf-c-popover__title-icon",
8083
+ "popoverTitleText": "pf-c-popover__title-text",
8084
+ "title": "pf-c-title"
8043
8085
  };
8044
8086
 
8045
- const CopyIcon = createIcon(CopyIconConfig);
8046
-
8047
- var CopyIcon$1 = CopyIcon;
8087
+ const PopoverContext = React__namespace.createContext({});
8048
8088
 
8049
- const ClipboardCopyButton = (_a) => {
8050
- var { onClick, exitDelay = 0, entryDelay = 300, maxWidth = '100px', position = 'top', 'aria-label': ariaLabel = 'Copyable input', id, textId, children, variant = 'control' } = _a, props = __rest$1(_a, ["onClick", "exitDelay", "entryDelay", "maxWidth", "position", 'aria-label', "id", "textId", "children", "variant"]);
8051
- return (React__namespace.createElement(Tooltip, { trigger: "mouseenter focus click", exitDelay: exitDelay, entryDelay: entryDelay, maxWidth: maxWidth, position: position, content: React__namespace.createElement("div", null, children) },
8052
- React__namespace.createElement(Button, Object.assign({ type: "button", variant: variant, onClick: onClick, "aria-label": ariaLabel, id: id, "aria-labelledby": `${id} ${textId}` }, props),
8053
- React__namespace.createElement(CopyIcon$1, null))));
8089
+ const PopoverContent = (_a) => {
8090
+ var { className = null, children } = _a, props = __rest$1(_a, ["className", "children"]);
8091
+ return (React__namespace.createElement("div", Object.assign({ className: css(_default$W.popoverContent, className) }, props), children));
8054
8092
  };
8055
- ClipboardCopyButton.displayName = 'ClipboardCopyButton';
8093
+ PopoverContent.displayName = 'PopoverContent';
8056
8094
 
8057
- const AngleDownIconConfig = {
8058
- name: 'AngleDownIcon',
8059
- height: 512,
8060
- width: 320,
8061
- 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',
8062
- yOffset: 0,
8063
- xOffset: 0,
8095
+ const PopoverBody = (_a) => {
8096
+ var { children, id, className } = _a, props = __rest$1(_a, ["children", "id", "className"]);
8097
+ return (React__namespace.createElement("div", Object.assign({ className: css(_default$W.popoverBody, className), id: id }, props), children));
8064
8098
  };
8099
+ PopoverBody.displayName = 'PopoverBody';
8065
8100
 
8066
- const AngleDownIcon = createIcon(AngleDownIconConfig);
8067
-
8068
- var AngleDownIcon$1 = AngleDownIcon;
8101
+ const PopoverHeaderIcon = (_a) => {
8102
+ var { children, className } = _a, props = __rest$1(_a, ["children", "className"]);
8103
+ return (React__namespace.createElement("span", Object.assign({ className: css(_default$W.popoverTitleIcon, className) }, props), children));
8104
+ };
8105
+ PopoverHeaderIcon.displayName = 'PopoverHeaderIcon';
8069
8106
 
8070
- const ClipboardCopyToggle = (_a) => {
8071
- var { onClick, id, textId, contentId, isExpanded = false } = _a, props = __rest$1(_a, ["onClick", "id", "textId", "contentId", "isExpanded"]);
8072
- return (React__namespace.createElement(Button, Object.assign({ type: "button", variant: "control", onClick: onClick, id: id, "aria-labelledby": `${id} ${textId}`, "aria-controls": `${id} ${contentId}`, "aria-expanded": isExpanded }, props), isExpanded ? React__namespace.createElement(AngleDownIcon$1, { "aria-hidden": "true" }) : React__namespace.createElement(AngleRightIcon$1, { "aria-hidden": "true" })));
8107
+ const PopoverHeaderText = (_a) => {
8108
+ var { children, className } = _a, props = __rest$1(_a, ["children", "className"]);
8109
+ return (React__namespace.createElement("span", Object.assign({ className: css(_default$W.popoverTitleText, className) }, props), children));
8073
8110
  };
8074
- ClipboardCopyToggle.displayName = 'ClipboardCopyToggle';
8111
+ PopoverHeaderText.displayName = 'PopoverHeaderText';
8075
8112
 
8076
- class ClipboardCopyExpanded extends React__namespace.Component {
8077
- constructor(props) {
8078
- super(props);
8079
- }
8080
- render() {
8081
- const _a = this.props, { className, children, onChange, isReadOnly, isCode } = _a, props = __rest$1(_a, ["className", "children", "onChange", "isReadOnly", "isCode"]);
8082
- return (React__namespace.createElement("div", Object.assign({ suppressContentEditableWarning: true, className: css(_default$X.clipboardCopyExpandableContent, className), onInput: (e) => onChange(e.target.innerText, e), contentEditable: !isReadOnly }, props), isCode ? React__namespace.createElement("pre", null, children) : children));
8083
- }
8084
- }
8085
- ClipboardCopyExpanded.displayName = 'ClipboardCopyExpanded';
8086
- ClipboardCopyExpanded.defaultProps = {
8087
- onChange: () => undefined,
8088
- className: '',
8089
- isReadOnly: false,
8090
- isCode: false
8113
+ const PopoverHeader = (_a) => {
8114
+ var { children, icon, className, titleHeadingLevel = 'h6', alertSeverityVariant, id, alertSeverityScreenReaderText } = _a, props = __rest$1(_a, ["children", "icon", "className", "titleHeadingLevel", "alertSeverityVariant", "id", "alertSeverityScreenReaderText"]);
8115
+ const HeadingLevel = titleHeadingLevel;
8116
+ return icon || alertSeverityVariant ? (React__namespace.createElement("header", Object.assign({ className: css('pf-c-popover__header', className), id: id }, props),
8117
+ React__namespace.createElement(HeadingLevel, { className: css(_default$W.popoverTitle, icon && _default$W.modifiers.icon) },
8118
+ icon && React__namespace.createElement(PopoverHeaderIcon, null, icon),
8119
+ alertSeverityVariant && alertSeverityScreenReaderText && (React__namespace.createElement("span", { className: "pf-u-screen-reader" }, alertSeverityScreenReaderText)),
8120
+ React__namespace.createElement(PopoverHeaderText, null, children)))) : (React__namespace.createElement(Title, Object.assign({ headingLevel: titleHeadingLevel, size: exports.TitleSizes.md, id: id, className: className }, props), children));
8091
8121
  };
8122
+ PopoverHeader.displayName = 'PopoverHeader';
8092
8123
 
8093
- const clipboardCopyFunc = (event, text) => {
8094
- const clipboard = event.currentTarget.parentElement;
8095
- const el = document.createElement('textarea');
8096
- el.value = text.toString();
8097
- clipboard.appendChild(el);
8098
- el.select();
8099
- document.execCommand('copy');
8100
- clipboard.removeChild(el);
8124
+ const PopoverFooter = (_a) => {
8125
+ var { children, className = '' } = _a, props = __rest$1(_a, ["children", "className"]);
8126
+ return (React__namespace.createElement("footer", Object.assign({ className: css(_default$W.popoverFooter, className) }, props), children));
8101
8127
  };
8102
- exports.ClipboardCopyVariant = void 0;
8103
- (function (ClipboardCopyVariant) {
8104
- ClipboardCopyVariant["inline"] = "inline";
8105
- ClipboardCopyVariant["expansion"] = "expansion";
8106
- ClipboardCopyVariant["inlineCompact"] = "inline-compact";
8107
- })(exports.ClipboardCopyVariant || (exports.ClipboardCopyVariant = {}));
8108
- class ClipboardCopy extends React__namespace.Component {
8109
- constructor(props) {
8110
- super(props);
8111
- this.timer = null;
8112
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
8113
- this.componentDidUpdate = (prevProps, prevState) => {
8114
- if (prevProps.children !== this.props.children) {
8115
- this.updateText(this.props.children);
8116
- }
8117
- };
8118
- this.componentWillUnmount = () => {
8119
- if (this.timer) {
8120
- window.clearTimeout(this.timer);
8121
- }
8122
- };
8123
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
8124
- this.expandContent = (_event) => {
8125
- this.setState(prevState => ({
8126
- expanded: !prevState.expanded
8127
- }));
8128
- };
8129
- this.updateText = (text) => {
8130
- this.setState({ text });
8131
- this.props.onChange(text);
8132
- };
8133
- this.render = () => {
8134
- const _a = this.props, {
8135
- /* eslint-disable @typescript-eslint/no-unused-vars */
8136
- isExpanded, onChange, // Don't pass to <div>
8137
- /* eslint-enable @typescript-eslint/no-unused-vars */
8138
- isReadOnly, isCode, isBlock, exitDelay, maxWidth, entryDelay, switchDelay, onCopy, hoverTip, clickTip, textAriaLabel, toggleAriaLabel, variant, position, className, additionalActions } = _a, divProps = __rest$1(_a, ["isExpanded", "onChange", "isReadOnly", "isCode", "isBlock", "exitDelay", "maxWidth", "entryDelay", "switchDelay", "onCopy", "hoverTip", "clickTip", "textAriaLabel", "toggleAriaLabel", "variant", "position", "className", "additionalActions"]);
8139
- const textIdPrefix = 'text-input-';
8140
- const toggleIdPrefix = 'toggle-';
8141
- const contentIdPrefix = 'content-';
8142
- return (React__namespace.createElement("div", Object.assign({ className: css(_default$X.clipboardCopy, variant === 'inline-compact' && _default$X.modifiers.inline, isBlock && _default$X.modifiers.block, this.state.expanded && _default$X.modifiers.expanded, className) }, divProps),
8143
- variant === 'inline-compact' && (React__namespace.createElement(GenerateId, { prefix: "" }, id => (React__namespace.createElement(React__namespace.Fragment, null,
8144
- !isCode && (React__namespace.createElement("span", { className: css(_default$X.clipboardCopyText), id: `${textIdPrefix}${id}` }, this.state.text)),
8145
- isCode && (React__namespace.createElement("code", { className: css(_default$X.clipboardCopyText, _default$X.modifiers.code), id: `${textIdPrefix}${id}` }, this.state.text)),
8146
- React__namespace.createElement("span", { className: css(_default$X.clipboardCopyActions) },
8147
- React__namespace.createElement("span", { className: css(_default$X.clipboardCopyActionsItem) },
8148
- React__namespace.createElement(ClipboardCopyButton, { variant: "plain", exitDelay: exitDelay, entryDelay: entryDelay, maxWidth: maxWidth, position: position, id: `copy-button-${id}`, textId: `text-input-${id}`, "aria-label": hoverTip, onClick: (event) => {
8149
- if (this.timer) {
8150
- window.clearTimeout(this.timer);
8151
- this.setState({ copied: false });
8152
- }
8153
- onCopy(event, this.state.text);
8154
- this.setState({ copied: true }, () => {
8155
- this.timer = window.setTimeout(() => {
8156
- this.setState({ copied: false });
8157
- this.timer = null;
8158
- }, switchDelay);
8159
- });
8160
- } }, this.state.copied ? clickTip : hoverTip)),
8161
- additionalActions && additionalActions))))),
8162
- variant !== 'inline-compact' && (React__namespace.createElement(GenerateId, { prefix: "" }, id => (React__namespace.createElement(React__namespace.Fragment, null,
8163
- React__namespace.createElement("div", { className: css(_default$X.clipboardCopyGroup) },
8164
- variant === 'expansion' && (React__namespace.createElement(ClipboardCopyToggle, { isExpanded: this.state.expanded, onClick: this.expandContent, id: `${toggleIdPrefix}${id}`, textId: `${textIdPrefix}${id}`, contentId: `${contentIdPrefix}${id}`, "aria-label": toggleAriaLabel })),
8165
- React__namespace.createElement(TextInput, { isReadOnly: isReadOnly || this.state.expanded, onChange: this.updateText, value: this.state.text, id: `text-input-${id}`, "aria-label": textAriaLabel }),
8166
- React__namespace.createElement(ClipboardCopyButton, { exitDelay: exitDelay, entryDelay: entryDelay, maxWidth: maxWidth, position: position, id: `copy-button-${id}`, textId: `text-input-${id}`, "aria-label": hoverTip, onClick: (event) => {
8167
- if (this.timer) {
8168
- window.clearTimeout(this.timer);
8169
- this.setState({ copied: false });
8170
- }
8171
- onCopy(event, this.state.text);
8172
- this.setState({ copied: true }, () => {
8173
- this.timer = window.setTimeout(() => {
8174
- this.setState({ copied: false });
8175
- this.timer = null;
8176
- }, switchDelay);
8177
- });
8178
- } }, this.state.copied ? clickTip : hoverTip)),
8179
- this.state.expanded && (React__namespace.createElement(ClipboardCopyExpanded, { isReadOnly: isReadOnly, isCode: isCode, id: `content-${id}`, onChange: this.updateText }, this.state.text))))))));
8180
- };
8181
- this.state = {
8182
- text: this.props.children,
8183
- expanded: this.props.isExpanded,
8184
- copied: false
8128
+ PopoverFooter.displayName = 'PopoverFooter';
8129
+
8130
+ const PopoverCloseButton = (_a) => {
8131
+ var { onClose = () => undefined } = _a, props = __rest$1(_a, ["onClose"]);
8132
+ const [closeButtonElement, setCloseButtonElement] = React__namespace.useState(null);
8133
+ React__namespace.useEffect(() => {
8134
+ closeButtonElement && closeButtonElement.addEventListener('click', onClose, false);
8135
+ return () => {
8136
+ closeButtonElement && closeButtonElement.removeEventListener('click', onClose, false);
8185
8137
  };
8186
- }
8187
- }
8188
- ClipboardCopy.displayName = 'ClipboardCopy';
8189
- ClipboardCopy.defaultProps = {
8190
- hoverTip: 'Copy to clipboard',
8191
- clickTip: 'Successfully copied to clipboard!',
8192
- isReadOnly: false,
8193
- isExpanded: false,
8194
- isCode: false,
8195
- variant: 'inline',
8196
- position: exports.TooltipPosition.top,
8197
- maxWidth: '150px',
8198
- exitDelay: 1600,
8199
- entryDelay: 300,
8200
- switchDelay: 2000,
8201
- onCopy: clipboardCopyFunc,
8202
- onChange: () => undefined,
8203
- textAriaLabel: 'Copyable input',
8204
- toggleAriaLabel: 'Show content',
8205
- additionalActions: null
8138
+ }, [closeButtonElement]);
8139
+ return (React__namespace.createElement(FindRefWrapper, { onFoundRef: (foundRef) => setCloseButtonElement(foundRef) },
8140
+ React__namespace.createElement(Button, Object.assign({ variant: "plain", "aria-label": true }, props, { style: { pointerEvents: 'auto' } }),
8141
+ React__namespace.createElement(TimesIcon$1, null))));
8206
8142
  };
8143
+ PopoverCloseButton.displayName = 'PopoverCloseButton';
8207
8144
 
8208
- const ClipboardCopyAction = (_a) => {
8209
- var { children = null, className = '' } = _a, props = __rest$1(_a, ["children", "className"]);
8210
- return (React__namespace.createElement("span", Object.assign({ className: css(_default$X.clipboardCopyActionsItem, className) }, props), children));
8145
+ const PopoverArrow = (_a) => {
8146
+ var { className = '' } = _a, props = __rest$1(_a, ["className"]);
8147
+ return React__namespace.createElement("div", Object.assign({ className: css(_default$W.popoverArrow, className) }, props));
8211
8148
  };
8212
- ClipboardCopyAction.displayName = 'ClipboardCopyAction';
8149
+ PopoverArrow.displayName = 'PopoverArrow';
8213
8150
 
8214
- var _default$W = {
8215
- "codeBlock": "pf-c-code-block",
8216
- "codeBlockActions": "pf-c-code-block__actions",
8217
- "codeBlockCode": "pf-c-code-block__code",
8218
- "codeBlockContent": "pf-c-code-block__content",
8219
- "codeBlockHeader": "pf-c-code-block__header",
8220
- "codeBlockPre": "pf-c-code-block__pre"
8151
+ const c_popover_MaxWidth = {
8152
+ "name": "--pf-c-popover--MaxWidth",
8153
+ "value": "none",
8154
+ "var": "var(--pf-c-popover--MaxWidth)"
8221
8155
  };
8156
+ var popoverMaxWidth = c_popover_MaxWidth;
8222
8157
 
8223
- const CodeBlock = (_a) => {
8224
- var { children = null, className, actions = null } = _a, props = __rest$1(_a, ["children", "className", "actions"]);
8225
- return (React__namespace.createElement("div", Object.assign({ className: css(_default$W.codeBlock, className) }, props),
8226
- React__namespace.createElement("div", { className: css(_default$W.codeBlockHeader) },
8227
- React__namespace.createElement("div", { className: css(_default$W.codeBlockActions) }, actions && actions)),
8228
- React__namespace.createElement("div", { className: css(_default$W.codeBlockContent) }, children)));
8158
+ const c_popover_MinWidth = {
8159
+ "name": "--pf-c-popover--MinWidth",
8160
+ "value": "auto",
8161
+ "var": "var(--pf-c-popover--MinWidth)"
8229
8162
  };
8230
- CodeBlock.displayName = 'CodeBlock';
8163
+ var popoverMinWidth = c_popover_MinWidth;
8231
8164
 
8232
- const CodeBlockCode = (_a) => {
8233
- var { children = null } = _a, props = __rest$1(_a, ["children"]);
8234
- return (React__namespace.createElement("pre", Object.assign({ className: css(_default$W.codeBlockPre) }, props),
8235
- React__namespace.createElement("code", { className: css(_default$W.codeBlockCode) }, children)));
8236
- };
8165
+ exports.PopoverPosition = void 0;
8166
+ (function (PopoverPosition) {
8167
+ PopoverPosition["auto"] = "auto";
8168
+ PopoverPosition["top"] = "top";
8169
+ PopoverPosition["bottom"] = "bottom";
8170
+ PopoverPosition["left"] = "left";
8171
+ PopoverPosition["right"] = "right";
8172
+ PopoverPosition["topStart"] = "top-start";
8173
+ PopoverPosition["topEnd"] = "top-end";
8174
+ PopoverPosition["bottomStart"] = "bottom-start";
8175
+ PopoverPosition["bottomEnd"] = "bottom-end";
8176
+ PopoverPosition["leftStart"] = "left-start";
8177
+ PopoverPosition["leftEnd"] = "left-end";
8178
+ PopoverPosition["rightStart"] = "right-start";
8179
+ PopoverPosition["rightEnd"] = "right-end";
8180
+ })(exports.PopoverPosition || (exports.PopoverPosition = {}));
8181
+ const alertStyle = {
8182
+ default: _default$W.modifiers.default,
8183
+ info: _default$W.modifiers.info,
8184
+ success: _default$W.modifiers.success,
8185
+ warning: _default$W.modifiers.warning,
8186
+ danger: _default$W.modifiers.danger
8187
+ };
8188
+ const Popover = (_a) => {
8189
+ 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,
8190
+ // For every initial starting position, there are 3 escape positions
8191
+ 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"]);
8192
+ {
8193
+ boundary !== undefined &&
8194
+ 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.');
8195
+ tippyProps !== undefined && console.warn('The Popover tippyProps prop has been deprecated and is no longer used.');
8196
+ }
8197
+ // could make this a prop in the future (true | false | 'toggle')
8198
+ // const hideOnClick = true;
8199
+ const uniqueId = id || getUniqueId();
8200
+ const triggerManually = isVisible !== null;
8201
+ const [visible, setVisible] = React__namespace.useState(false);
8202
+ const [opacity, setOpacity] = React__namespace.useState(0);
8203
+ const [focusTrapActive, setFocusTrapActive] = React__namespace.useState(Boolean(propWithFocusTrap));
8204
+ const transitionTimerRef = React__namespace.useRef(null);
8205
+ const showTimerRef = React__namespace.useRef(null);
8206
+ const hideTimerRef = React__namespace.useRef(null);
8207
+ React__namespace.useEffect(() => {
8208
+ onMount();
8209
+ }, []);
8210
+ React__namespace.useEffect(() => {
8211
+ if (triggerManually) {
8212
+ if (isVisible) {
8213
+ show();
8214
+ }
8215
+ else {
8216
+ hide();
8217
+ }
8218
+ }
8219
+ }, [isVisible, triggerManually]);
8220
+ const show = (withFocusTrap) => {
8221
+ onShow();
8222
+ if (transitionTimerRef.current) {
8223
+ clearTimeout(transitionTimerRef.current);
8224
+ }
8225
+ if (hideTimerRef.current) {
8226
+ clearTimeout(hideTimerRef.current);
8227
+ }
8228
+ showTimerRef.current = setTimeout(() => {
8229
+ setVisible(true);
8230
+ setOpacity(1);
8231
+ propWithFocusTrap !== false && withFocusTrap && setFocusTrapActive(true);
8232
+ onShown();
8233
+ }, 0);
8234
+ };
8235
+ const hide = () => {
8236
+ onHide();
8237
+ if (showTimerRef.current) {
8238
+ clearTimeout(showTimerRef.current);
8239
+ }
8240
+ hideTimerRef.current = setTimeout(() => {
8241
+ setVisible(false);
8242
+ setOpacity(0);
8243
+ setFocusTrapActive(false);
8244
+ transitionTimerRef.current = setTimeout(() => {
8245
+ onHidden();
8246
+ }, animationDuration);
8247
+ }, 0);
8248
+ };
8249
+ const positionModifiers = {
8250
+ top: _default$W.modifiers.top,
8251
+ bottom: _default$W.modifiers.bottom,
8252
+ left: _default$W.modifiers.left,
8253
+ right: _default$W.modifiers.right,
8254
+ 'top-start': _default$W.modifiers.topLeft,
8255
+ 'top-end': _default$W.modifiers.topRight,
8256
+ 'bottom-start': _default$W.modifiers.bottomLeft,
8257
+ 'bottom-end': _default$W.modifiers.bottomRight,
8258
+ 'left-start': _default$W.modifiers.leftTop,
8259
+ 'left-end': _default$W.modifiers.leftBottom,
8260
+ 'right-start': _default$W.modifiers.rightTop,
8261
+ 'right-end': _default$W.modifiers.rightBottom
8262
+ };
8263
+ const hasCustomMinWidth = minWidth !== popoverMinWidth.value;
8264
+ const hasCustomMaxWidth = maxWidth !== popoverMaxWidth.value;
8265
+ const onDocumentKeyDown = (event) => {
8266
+ if (event.keyCode === KEY_CODES.ESCAPE_KEY && visible) {
8267
+ if (triggerManually) {
8268
+ shouldClose(null, hide, event);
8269
+ }
8270
+ else {
8271
+ hide();
8272
+ }
8273
+ }
8274
+ };
8275
+ const onDocumentClick = (event, triggerElement, popperElement) => {
8276
+ if (hideOnOutsideClick && visible) {
8277
+ // check if we clicked within the popper, if so don't do anything
8278
+ const isChild = popperElement && popperElement.contains(event.target);
8279
+ if (isChild) {
8280
+ // clicked within the popper
8281
+ return;
8282
+ }
8283
+ if (triggerManually) {
8284
+ shouldClose(null, hide, event);
8285
+ }
8286
+ else {
8287
+ hide();
8288
+ }
8289
+ }
8290
+ };
8291
+ const onTriggerClick = (event) => {
8292
+ if (triggerManually) {
8293
+ if (visible) {
8294
+ shouldClose(null, hide, event);
8295
+ }
8296
+ else {
8297
+ shouldOpen(show, event);
8298
+ }
8299
+ }
8300
+ else {
8301
+ if (visible) {
8302
+ hide();
8303
+ }
8304
+ else {
8305
+ show(true);
8306
+ }
8307
+ }
8308
+ };
8309
+ const onContentMouseDown = () => {
8310
+ if (focusTrapActive) {
8311
+ setFocusTrapActive(false);
8312
+ }
8313
+ };
8314
+ const closePopover = (event) => {
8315
+ event.stopPropagation();
8316
+ if (triggerManually) {
8317
+ shouldClose(null, hide, event);
8318
+ }
8319
+ else {
8320
+ hide();
8321
+ }
8322
+ };
8323
+ const content = (React__namespace.createElement(FocusTrap, Object.assign({ active: focusTrapActive, focusTrapOptions: {
8324
+ returnFocusOnDeactivate: true,
8325
+ clickOutsideDeactivates: true,
8326
+ fallbackFocus: () => {
8327
+ // If the popover's trigger is focused but scrolled out of view,
8328
+ // FocusTrap will throw an error when the Enter button is used on the trigger.
8329
+ // That is because the Popover is hidden when its trigger is out of view.
8330
+ // Provide a fallback in that case.
8331
+ let node = null;
8332
+ if (document && document.activeElement) {
8333
+ node = document.activeElement;
8334
+ }
8335
+ return node;
8336
+ }
8337
+ }, preventScrollOnDeactivate: true, className: css(_default$W.popover, alertSeverityVariant && alertStyle[alertSeverityVariant], hasNoPadding && _default$W.modifiers.noPadding, hasAutoWidth && _default$W.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: {
8338
+ minWidth: hasCustomMinWidth ? minWidth : null,
8339
+ maxWidth: hasCustomMaxWidth ? maxWidth : null,
8340
+ opacity,
8341
+ transition: getOpacityTransition(animationDuration)
8342
+ } }, rest),
8343
+ React__namespace.createElement(PopoverArrow, null),
8344
+ React__namespace.createElement(PopoverContent, null,
8345
+ showClose && React__namespace.createElement(PopoverCloseButton, { onClose: closePopover, "aria-label": closeBtnAriaLabel }),
8346
+ 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)),
8347
+ React__namespace.createElement(PopoverBody, { id: `popover-${uniqueId}-body` }, typeof bodyContent === 'function' ? bodyContent(hide) : bodyContent),
8348
+ footerContent && (React__namespace.createElement(PopoverFooter, { id: `popover-${uniqueId}-footer` }, typeof footerContent === 'function' ? footerContent(hide) : footerContent)))));
8349
+ return (React__namespace.createElement(PopoverContext.Provider, { value: { headerComponent } },
8350
+ React__namespace.createElement(Popper, { trigger: children, reference: reference, popper: content, popperMatchesTriggerWidth: false, appendTo: appendTo, isVisible: visible, positionModifiers: positionModifiers, distance: distance, placement: position, onTriggerClick: onTriggerClick, onDocumentClick: onDocumentClick, onDocumentKeyDown: onDocumentKeyDown, enableFlip: enableFlip, zIndex: zIndex, flipBehavior: flipBehavior })));
8351
+ };
8352
+ Popover.displayName = 'Popover';
8353
+
8354
+ const CopyIconConfig = {
8355
+ name: 'CopyIcon',
8356
+ height: 512,
8357
+ width: 448,
8358
+ svgPath: 'M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z',
8359
+ yOffset: 0,
8360
+ xOffset: 0,
8361
+ };
8362
+
8363
+ const CopyIcon = createIcon(CopyIconConfig);
8364
+
8365
+ var CopyIcon$1 = CopyIcon;
8366
+
8367
+ const ClipboardCopyButton = (_a) => {
8368
+ var { onClick, exitDelay = 0, entryDelay = 300, maxWidth = '100px', position = 'top', 'aria-label': ariaLabel = 'Copyable input', id, textId, children, variant = 'control' } = _a, props = __rest$1(_a, ["onClick", "exitDelay", "entryDelay", "maxWidth", "position", 'aria-label', "id", "textId", "children", "variant"]);
8369
+ return (React__namespace.createElement(Tooltip, { trigger: "mouseenter focus click", exitDelay: exitDelay, entryDelay: entryDelay, maxWidth: maxWidth, position: position, content: React__namespace.createElement("div", null, children) },
8370
+ React__namespace.createElement(Button, Object.assign({ type: "button", variant: variant, onClick: onClick, "aria-label": ariaLabel, id: id, "aria-labelledby": `${id} ${textId}` }, props),
8371
+ React__namespace.createElement(CopyIcon$1, null))));
8372
+ };
8373
+ ClipboardCopyButton.displayName = 'ClipboardCopyButton';
8374
+
8375
+ const AngleDownIconConfig = {
8376
+ name: 'AngleDownIcon',
8377
+ height: 512,
8378
+ width: 320,
8379
+ 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',
8380
+ yOffset: 0,
8381
+ xOffset: 0,
8382
+ };
8383
+
8384
+ const AngleDownIcon = createIcon(AngleDownIconConfig);
8385
+
8386
+ var AngleDownIcon$1 = AngleDownIcon;
8387
+
8388
+ const ClipboardCopyToggle = (_a) => {
8389
+ var { onClick, id, textId, contentId, isExpanded = false } = _a, props = __rest$1(_a, ["onClick", "id", "textId", "contentId", "isExpanded"]);
8390
+ return (React__namespace.createElement(Button, Object.assign({ type: "button", variant: "control", onClick: onClick, id: id, "aria-labelledby": `${id} ${textId}`, "aria-controls": `${id} ${contentId}`, "aria-expanded": isExpanded }, props), isExpanded ? React__namespace.createElement(AngleDownIcon$1, { "aria-hidden": "true" }) : React__namespace.createElement(AngleRightIcon$1, { "aria-hidden": "true" })));
8391
+ };
8392
+ ClipboardCopyToggle.displayName = 'ClipboardCopyToggle';
8393
+
8394
+ class ClipboardCopyExpanded extends React__namespace.Component {
8395
+ constructor(props) {
8396
+ super(props);
8397
+ }
8398
+ render() {
8399
+ const _a = this.props, { className, children, onChange, isReadOnly, isCode } = _a, props = __rest$1(_a, ["className", "children", "onChange", "isReadOnly", "isCode"]);
8400
+ return (React__namespace.createElement("div", Object.assign({ suppressContentEditableWarning: true, className: css(_default$X.clipboardCopyExpandableContent, className), onInput: (e) => onChange(e.target.innerText, e), contentEditable: !isReadOnly }, props), isCode ? React__namespace.createElement("pre", null, children) : children));
8401
+ }
8402
+ }
8403
+ ClipboardCopyExpanded.displayName = 'ClipboardCopyExpanded';
8404
+ ClipboardCopyExpanded.defaultProps = {
8405
+ onChange: () => undefined,
8406
+ className: '',
8407
+ isReadOnly: false,
8408
+ isCode: false
8409
+ };
8410
+
8411
+ const clipboardCopyFunc = (event, text) => {
8412
+ const clipboard = event.currentTarget.parentElement;
8413
+ const el = document.createElement('textarea');
8414
+ el.value = text.toString();
8415
+ clipboard.appendChild(el);
8416
+ el.select();
8417
+ document.execCommand('copy');
8418
+ clipboard.removeChild(el);
8419
+ };
8420
+ exports.ClipboardCopyVariant = void 0;
8421
+ (function (ClipboardCopyVariant) {
8422
+ ClipboardCopyVariant["inline"] = "inline";
8423
+ ClipboardCopyVariant["expansion"] = "expansion";
8424
+ ClipboardCopyVariant["inlineCompact"] = "inline-compact";
8425
+ })(exports.ClipboardCopyVariant || (exports.ClipboardCopyVariant = {}));
8426
+ class ClipboardCopy extends React__namespace.Component {
8427
+ constructor(props) {
8428
+ super(props);
8429
+ this.timer = null;
8430
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
8431
+ this.componentDidUpdate = (prevProps, prevState) => {
8432
+ if (prevProps.children !== this.props.children) {
8433
+ this.updateText(this.props.children);
8434
+ }
8435
+ };
8436
+ this.componentWillUnmount = () => {
8437
+ if (this.timer) {
8438
+ window.clearTimeout(this.timer);
8439
+ }
8440
+ };
8441
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
8442
+ this.expandContent = (_event) => {
8443
+ this.setState(prevState => ({
8444
+ expanded: !prevState.expanded
8445
+ }));
8446
+ };
8447
+ this.updateText = (text) => {
8448
+ this.setState({ text });
8449
+ this.props.onChange(text);
8450
+ };
8451
+ this.render = () => {
8452
+ const _a = this.props, {
8453
+ /* eslint-disable @typescript-eslint/no-unused-vars */
8454
+ isExpanded, onChange, // Don't pass to <div>
8455
+ /* eslint-enable @typescript-eslint/no-unused-vars */
8456
+ isReadOnly, isCode, isBlock, exitDelay, maxWidth, entryDelay, switchDelay, onCopy, hoverTip, clickTip, textAriaLabel, toggleAriaLabel, variant, position, className, additionalActions } = _a, divProps = __rest$1(_a, ["isExpanded", "onChange", "isReadOnly", "isCode", "isBlock", "exitDelay", "maxWidth", "entryDelay", "switchDelay", "onCopy", "hoverTip", "clickTip", "textAriaLabel", "toggleAriaLabel", "variant", "position", "className", "additionalActions"]);
8457
+ const textIdPrefix = 'text-input-';
8458
+ const toggleIdPrefix = 'toggle-';
8459
+ const contentIdPrefix = 'content-';
8460
+ return (React__namespace.createElement("div", Object.assign({ className: css(_default$X.clipboardCopy, variant === 'inline-compact' && _default$X.modifiers.inline, isBlock && _default$X.modifiers.block, this.state.expanded && _default$X.modifiers.expanded, className) }, divProps),
8461
+ variant === 'inline-compact' && (React__namespace.createElement(GenerateId, { prefix: "" }, id => (React__namespace.createElement(React__namespace.Fragment, null,
8462
+ !isCode && (React__namespace.createElement("span", { className: css(_default$X.clipboardCopyText), id: `${textIdPrefix}${id}` }, this.state.text)),
8463
+ isCode && (React__namespace.createElement("code", { className: css(_default$X.clipboardCopyText, _default$X.modifiers.code), id: `${textIdPrefix}${id}` }, this.state.text)),
8464
+ React__namespace.createElement("span", { className: css(_default$X.clipboardCopyActions) },
8465
+ React__namespace.createElement("span", { className: css(_default$X.clipboardCopyActionsItem) },
8466
+ React__namespace.createElement(ClipboardCopyButton, { variant: "plain", exitDelay: exitDelay, entryDelay: entryDelay, maxWidth: maxWidth, position: position, id: `copy-button-${id}`, textId: `text-input-${id}`, "aria-label": hoverTip, onClick: (event) => {
8467
+ if (this.timer) {
8468
+ window.clearTimeout(this.timer);
8469
+ this.setState({ copied: false });
8470
+ }
8471
+ onCopy(event, this.state.text);
8472
+ this.setState({ copied: true }, () => {
8473
+ this.timer = window.setTimeout(() => {
8474
+ this.setState({ copied: false });
8475
+ this.timer = null;
8476
+ }, switchDelay);
8477
+ });
8478
+ } }, this.state.copied ? clickTip : hoverTip)),
8479
+ additionalActions && additionalActions))))),
8480
+ variant !== 'inline-compact' && (React__namespace.createElement(GenerateId, { prefix: "" }, id => (React__namespace.createElement(React__namespace.Fragment, null,
8481
+ React__namespace.createElement("div", { className: css(_default$X.clipboardCopyGroup) },
8482
+ variant === 'expansion' && (React__namespace.createElement(ClipboardCopyToggle, { isExpanded: this.state.expanded, onClick: this.expandContent, id: `${toggleIdPrefix}${id}`, textId: `${textIdPrefix}${id}`, contentId: `${contentIdPrefix}${id}`, "aria-label": toggleAriaLabel })),
8483
+ React__namespace.createElement(TextInput, { isReadOnly: isReadOnly || this.state.expanded, onChange: this.updateText, value: this.state.text, id: `text-input-${id}`, "aria-label": textAriaLabel }),
8484
+ React__namespace.createElement(ClipboardCopyButton, { exitDelay: exitDelay, entryDelay: entryDelay, maxWidth: maxWidth, position: position, id: `copy-button-${id}`, textId: `text-input-${id}`, "aria-label": hoverTip, onClick: (event) => {
8485
+ if (this.timer) {
8486
+ window.clearTimeout(this.timer);
8487
+ this.setState({ copied: false });
8488
+ }
8489
+ onCopy(event, this.state.text);
8490
+ this.setState({ copied: true }, () => {
8491
+ this.timer = window.setTimeout(() => {
8492
+ this.setState({ copied: false });
8493
+ this.timer = null;
8494
+ }, switchDelay);
8495
+ });
8496
+ } }, this.state.copied ? clickTip : hoverTip)),
8497
+ this.state.expanded && (React__namespace.createElement(ClipboardCopyExpanded, { isReadOnly: isReadOnly, isCode: isCode, id: `content-${id}`, onChange: this.updateText }, this.state.text))))))));
8498
+ };
8499
+ this.state = {
8500
+ text: this.props.children,
8501
+ expanded: this.props.isExpanded,
8502
+ copied: false
8503
+ };
8504
+ }
8505
+ }
8506
+ ClipboardCopy.displayName = 'ClipboardCopy';
8507
+ ClipboardCopy.defaultProps = {
8508
+ hoverTip: 'Copy to clipboard',
8509
+ clickTip: 'Successfully copied to clipboard!',
8510
+ isReadOnly: false,
8511
+ isExpanded: false,
8512
+ isCode: false,
8513
+ variant: 'inline',
8514
+ position: exports.PopoverPosition.top,
8515
+ maxWidth: '150px',
8516
+ exitDelay: 1600,
8517
+ entryDelay: 300,
8518
+ switchDelay: 2000,
8519
+ onCopy: clipboardCopyFunc,
8520
+ onChange: () => undefined,
8521
+ textAriaLabel: 'Copyable input',
8522
+ toggleAriaLabel: 'Show content',
8523
+ additionalActions: null
8524
+ };
8525
+
8526
+ const ClipboardCopyAction = (_a) => {
8527
+ var { children = null, className = '' } = _a, props = __rest$1(_a, ["children", "className"]);
8528
+ return (React__namespace.createElement("span", Object.assign({ className: css(_default$X.clipboardCopyActionsItem, className) }, props), children));
8529
+ };
8530
+ ClipboardCopyAction.displayName = 'ClipboardCopyAction';
8531
+
8532
+ var _default$V = {
8533
+ "codeBlock": "pf-c-code-block",
8534
+ "codeBlockActions": "pf-c-code-block__actions",
8535
+ "codeBlockCode": "pf-c-code-block__code",
8536
+ "codeBlockContent": "pf-c-code-block__content",
8537
+ "codeBlockHeader": "pf-c-code-block__header",
8538
+ "codeBlockPre": "pf-c-code-block__pre"
8539
+ };
8540
+
8541
+ const CodeBlock = (_a) => {
8542
+ var { children = null, className, actions = null } = _a, props = __rest$1(_a, ["children", "className", "actions"]);
8543
+ return (React__namespace.createElement("div", Object.assign({ className: css(_default$V.codeBlock, className) }, props),
8544
+ React__namespace.createElement("div", { className: css(_default$V.codeBlockHeader) },
8545
+ React__namespace.createElement("div", { className: css(_default$V.codeBlockActions) }, actions && actions)),
8546
+ React__namespace.createElement("div", { className: css(_default$V.codeBlockContent) }, children)));
8547
+ };
8548
+ CodeBlock.displayName = 'CodeBlock';
8549
+
8550
+ const CodeBlockCode = (_a) => {
8551
+ var { children = null } = _a, props = __rest$1(_a, ["children"]);
8552
+ return (React__namespace.createElement("pre", Object.assign({ className: css(_default$V.codeBlockPre) }, props),
8553
+ React__namespace.createElement("code", { className: css(_default$V.codeBlockCode) }, children)));
8554
+ };
8237
8555
  CodeBlockCode.displayName = 'CodeBlockCode';
8238
8556
 
8239
8557
  const CodeBlockAction = (_a) => {
@@ -8242,7 +8560,7 @@
8242
8560
  };
8243
8561
  CodeBlockAction.displayName = 'CodeBlockAction';
8244
8562
 
8245
- var _default$V = {
8563
+ var _default$U = {
8246
8564
  "contextSelector": "pf-c-context-selector",
8247
8565
  "contextSelectorMenu": "pf-c-context-selector__menu",
8248
8566
  "contextSelectorMenuFooter": "pf-c-context-selector__menu-footer",
@@ -8328,9 +8646,9 @@
8328
8646
  isActive, onEnter, parentRef } = _a,
8329
8647
  /* eslint-enable @typescript-eslint/no-unused-vars */
8330
8648
  props = __rest$1(_a, ["className", "toggleText", "isOpen", "onToggle", "id", "isPlain", "isText", "isActive", "onEnter", "parentRef"]);
8331
- return (React__namespace.createElement("button", Object.assign({}, props, { id: id, ref: this.toggle, className: css(_default$V.contextSelectorToggle, isActive && _default$V.modifiers.active, isPlain && _default$V.modifiers.plain, isText && _default$V.modifiers.text, className), type: "button", onClick: event => onToggle(event, !isOpen), "aria-expanded": isOpen, onKeyDown: this.onKeyDown }),
8332
- React__namespace.createElement("span", { className: css(_default$V.contextSelectorToggleText) }, toggleText),
8333
- React__namespace.createElement("span", { className: css(_default$V.contextSelectorToggleIcon) },
8649
+ return (React__namespace.createElement("button", Object.assign({}, props, { id: id, ref: this.toggle, className: css(_default$U.contextSelectorToggle, isActive && _default$U.modifiers.active, isPlain && _default$U.modifiers.plain, isText && _default$U.modifiers.text, className), type: "button", onClick: event => onToggle(event, !isOpen), "aria-expanded": isOpen, onKeyDown: this.onKeyDown }),
8650
+ React__namespace.createElement("span", { className: css(_default$U.contextSelectorToggleText) }, toggleText),
8651
+ React__namespace.createElement("span", { className: css(_default$U.contextSelectorToggleIcon) },
8334
8652
  React__namespace.createElement(CaretDownIcon$1, { "aria-hidden": true }))));
8335
8653
  }
8336
8654
  }
@@ -8356,7 +8674,7 @@
8356
8674
  this.render = () => {
8357
8675
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
8358
8676
  const _a = this.props, { className, isOpen, children } = _a, props = __rest$1(_a, ["className", "isOpen", "children"]);
8359
- return (React__namespace.createElement("ul", Object.assign({ className: css(_default$V.contextSelectorMenuList, className), hidden: !isOpen, role: "menu" }, props), this.extendChildren()));
8677
+ return (React__namespace.createElement("ul", Object.assign({ className: css(_default$U.contextSelectorMenuList, className), hidden: !isOpen, role: "menu" }, props), this.extendChildren()));
8360
8678
  };
8361
8679
  }
8362
8680
  extendChildren() {
@@ -8378,7 +8696,7 @@
8378
8696
  onSelect: (event, value) => undefined
8379
8697
  });
8380
8698
 
8381
- var _default$U = {
8699
+ var _default$T = {
8382
8700
  "formControl": "pf-c-form-control",
8383
8701
  "inputGroup": "pf-c-input-group",
8384
8702
  "inputGroupText": "pf-c-input-group__text",
@@ -8502,7 +8820,7 @@
8502
8820
  var { className = '', children } = _a, props = __rest$1(_a, ["className", "children"]);
8503
8821
  const formCtrls = [FormSelect, TextArea, TextInput].map(comp => comp.displayName);
8504
8822
  const idItem = React__namespace.Children.toArray(children).find((child) => !formCtrls.includes(child.type.displayName) && child.props.id);
8505
- return (React__namespace.createElement("div", Object.assign({ className: css(_default$U.inputGroup, className) }, props), idItem
8823
+ return (React__namespace.createElement("div", Object.assign({ className: css(_default$T.inputGroup, className) }, props), idItem
8506
8824
  ? React__namespace.Children.map(children, (child) => formCtrls.includes(child.type.displayName)
8507
8825
  ? React__namespace.cloneElement(child, { 'aria-describedby': idItem.props.id })
8508
8826
  : child)
@@ -8518,7 +8836,7 @@
8518
8836
  const InputGroupText = (_a) => {
8519
8837
  var { className = '', component = 'span', children, variant = exports.InputGroupTextVariant.default } = _a, props = __rest$1(_a, ["className", "component", "children", "variant"]);
8520
8838
  const Component = component;
8521
- return (React__namespace.createElement(Component, Object.assign({ className: css(_default$U.inputGroupText, variant === exports.InputGroupTextVariant.plain && _default$U.modifiers.plain, className) }, props), children));
8839
+ return (React__namespace.createElement(Component, Object.assign({ className: css(_default$T.inputGroupText, variant === exports.InputGroupTextVariant.plain && _default$T.modifiers.plain, className) }, props), children));
8522
8840
  };
8523
8841
  InputGroupText.displayName = 'InputGroupText';
8524
8842
 
@@ -8543,8 +8861,8 @@
8543
8861
  const screenReaderLabelId = `pf-context-selector-label-id-${newId}`;
8544
8862
  const searchButtonId = `pf-context-selector-search-button-id-${newId}`;
8545
8863
  const _a = this.props, { children, className, isOpen, isFullHeight, onToggle, onSelect, screenReaderLabel, toggleText, searchButtonAriaLabel, searchInputValue, onSearchInputChange, searchInputPlaceholder, onSearchButtonClick, menuAppendTo, ouiaId, ouiaSafe, isPlain, isText, footer, disableFocusTrap } = _a, props = __rest$1(_a, ["children", "className", "isOpen", "isFullHeight", "onToggle", "onSelect", "screenReaderLabel", "toggleText", "searchButtonAriaLabel", "searchInputValue", "onSearchInputChange", "searchInputPlaceholder", "onSearchButtonClick", "menuAppendTo", "ouiaId", "ouiaSafe", "isPlain", "isText", "footer", "disableFocusTrap"]);
8546
- const menuContainer = (React__namespace.createElement("div", { className: css(_default$V.contextSelectorMenu) }, isOpen && (React__namespace.createElement(FocusTrap, { active: !disableFocusTrap, focusTrapOptions: { clickOutsideDeactivates: true } },
8547
- React__namespace.createElement("div", { className: css(_default$V.contextSelectorMenuSearch) },
8864
+ const menuContainer = (React__namespace.createElement("div", { className: css(_default$U.contextSelectorMenu) }, isOpen && (React__namespace.createElement(FocusTrap, { active: !disableFocusTrap, focusTrapOptions: { clickOutsideDeactivates: true } },
8865
+ React__namespace.createElement("div", { className: css(_default$U.contextSelectorMenuSearch) },
8548
8866
  React__namespace.createElement(InputGroup, null,
8549
8867
  React__namespace.createElement(TextInput, { value: searchInputValue, type: "search", placeholder: searchInputPlaceholder, onChange: onSearchInputChange, onKeyPress: this.onEnterPressed, "aria-labelledby": searchButtonId }),
8550
8868
  React__namespace.createElement(Button, { variant: exports.ButtonVariant.control, "aria-label": searchButtonAriaLabel, id: searchButtonId, onClick: onSearchButtonClick },
@@ -8552,8 +8870,8 @@
8552
8870
  React__namespace.createElement(ContextSelectorContext.Provider, { value: { onSelect } },
8553
8871
  React__namespace.createElement(ContextSelectorMenuList, { isOpen: isOpen }, children)),
8554
8872
  footer))));
8555
- const popperContainer = (React__namespace.createElement("div", Object.assign({ className: css(_default$V.contextSelector, isOpen && _default$V.modifiers.expanded, className), ref: this.parentRef }, props), isOpen && menuContainer));
8556
- const mainContainer = (React__namespace.createElement("div", Object.assign({ className: css(_default$V.contextSelector, isOpen && _default$V.modifiers.expanded, isFullHeight && _default$V.modifiers.fullHeight, className), ref: this.parentRef }, getOUIAProps(ContextSelector.displayName, ouiaId !== undefined ? ouiaId : this.state.ouiaStateId, ouiaSafe), props),
8873
+ const popperContainer = (React__namespace.createElement("div", Object.assign({ className: css(_default$U.contextSelector, isOpen && _default$U.modifiers.expanded, className), ref: this.parentRef }, props), isOpen && menuContainer));
8874
+ const mainContainer = (React__namespace.createElement("div", Object.assign({ className: css(_default$U.contextSelector, isOpen && _default$U.modifiers.expanded, isFullHeight && _default$U.modifiers.fullHeight, className), ref: this.parentRef }, getOUIAProps(ContextSelector.displayName, ouiaId !== undefined ? ouiaId : this.state.ouiaStateId, ouiaSafe), props),
8557
8875
  screenReaderLabel && (React__namespace.createElement("span", { id: screenReaderLabelId, hidden: true }, screenReaderLabel)),
8558
8876
  React__namespace.createElement(ContextSelectorToggle, { onToggle: onToggle, isOpen: isOpen, toggleText: toggleText, id: toggleId, parentRef: this.parentRef.current, "aria-labelledby": `${screenReaderLabelId} ${toggleId}`, isPlain: isPlain, isText: isText }),
8559
8877
  isOpen && menuAppendTo === 'inline' && menuContainer));
@@ -8603,7 +8921,7 @@
8603
8921
  const Component = href ? 'a' : 'button';
8604
8922
  const isDisabledLink = href && isDisabled;
8605
8923
  return (React__namespace.createElement(ContextSelectorContext.Consumer, null, ({ onSelect }) => (React__namespace.createElement("li", { role: "none" },
8606
- React__namespace.createElement(Component, Object.assign({ className: css(_default$V.contextSelectorMenuListItem, isDisabledLink && _default$V.modifiers.disabled, className), ref: this.ref, onClick: event => {
8924
+ React__namespace.createElement(Component, Object.assign({ className: css(_default$U.contextSelectorMenuListItem, isDisabledLink && _default$U.modifiers.disabled, className), ref: this.ref, onClick: event => {
8607
8925
  if (!isDisabled) {
8608
8926
  onClick(event);
8609
8927
  onSelect(event, children);
@@ -8624,11 +8942,11 @@
8624
8942
 
8625
8943
  const ContextSelectorFooter = (_a) => {
8626
8944
  var { children = null, className = '' } = _a, props = __rest$1(_a, ["children", "className"]);
8627
- return (React__namespace.createElement("div", Object.assign({}, props, { className: css(_default$V.contextSelectorMenuFooter, className) }), children));
8945
+ return (React__namespace.createElement("div", Object.assign({}, props, { className: css(_default$U.contextSelectorMenuFooter, className) }), children));
8628
8946
  };
8629
8947
  ContextSelectorFooter.displayName = 'ContextSelectorFooter';
8630
8948
 
8631
- var _default$T = {
8949
+ var _default$S = {
8632
8950
  "dataList": "pf-c-data-list",
8633
8951
  "dataListAction": "pf-c-data-list__action",
8634
8952
  "dataListCell": "pf-c-data-list__cell",
@@ -8684,7 +9002,7 @@
8684
9002
  }
8685
9003
  };
8686
9004
 
8687
- var _default$S = {
9005
+ var _default$R = {
8688
9006
  "dataList": "pf-c-data-list",
8689
9007
  "dataListCell": "pf-c-data-list__cell",
8690
9008
  "dataListExpandableContent": "pf-c-data-list__expandable-content",
@@ -8707,13 +9025,13 @@
8707
9025
  };
8708
9026
 
8709
9027
  const gridBreakpointClasses = {
8710
- none: _default$S.modifiers.gridNone,
9028
+ none: _default$R.modifiers.gridNone,
8711
9029
  always: 'pf-m-grid',
8712
- sm: _default$S.modifiers.gridSm,
8713
- md: _default$S.modifiers.gridMd,
8714
- lg: _default$S.modifiers.gridLg,
8715
- xl: _default$S.modifiers.gridXl,
8716
- '2xl': _default$S.modifiers.grid_2xl
9030
+ sm: _default$R.modifiers.gridSm,
9031
+ md: _default$R.modifiers.gridMd,
9032
+ lg: _default$R.modifiers.gridLg,
9033
+ xl: _default$R.modifiers.gridXl,
9034
+ '2xl': _default$R.modifiers.grid_2xl
8717
9035
  };
8718
9036
  exports.DataListWrapModifier = void 0;
8719
9037
  (function (DataListWrapModifier) {
@@ -8763,7 +9081,7 @@
8763
9081
  this.dragStart0 = (el) => {
8764
9082
  const { onDragStart } = this.props;
8765
9083
  const draggedItemId = el.id;
8766
- el.classList.add(_default$T.modifiers.ghostRow);
9084
+ el.classList.add(_default$S.modifiers.ghostRow);
8767
9085
  el.setAttribute('aria-pressed', 'true');
8768
9086
  this.setState({
8769
9087
  draggedItemId,
@@ -8779,8 +9097,8 @@
8779
9097
  this.onDragCancel = () => {
8780
9098
  this.move(this.props.itemOrder);
8781
9099
  Array.from(this.ref.current.children).forEach(el => {
8782
- el.classList.remove(_default$T.modifiers.ghostRow);
8783
- el.classList.remove(_default$T.modifiers.dragOver);
9100
+ el.classList.remove(_default$S.modifiers.ghostRow);
9101
+ el.classList.remove(_default$S.modifiers.dragOver);
8784
9102
  el.setAttribute('aria-pressed', 'false');
8785
9103
  });
8786
9104
  this.setState({
@@ -8802,8 +9120,8 @@
8802
9120
  }
8803
9121
  };
8804
9122
  this.dragEnd0 = (el) => {
8805
- el.classList.remove(_default$T.modifiers.ghostRow);
8806
- el.classList.remove(_default$T.modifiers.dragOver);
9123
+ el.classList.remove(_default$S.modifiers.ghostRow);
9124
+ el.classList.remove(_default$S.modifiers.dragOver);
8807
9125
  el.setAttribute('aria-pressed', 'false');
8808
9126
  this.setState({
8809
9127
  draggedItemId: null,
@@ -8882,14 +9200,14 @@
8882
9200
  const nextSelection = dragItem.previousSibling;
8883
9201
  if (nextSelection) {
8884
9202
  this.dragOver0(nextSelection.id);
8885
- dragItem.querySelector(`.${_default$T.dataListItemDraggableButton}`).focus();
9203
+ dragItem.querySelector(`.${_default$S.dataListItemDraggableButton}`).focus();
8886
9204
  }
8887
9205
  }
8888
9206
  else if (evt.key === 'ArrowDown') {
8889
9207
  const nextSelection = dragItem.nextSibling;
8890
9208
  if (nextSelection) {
8891
9209
  this.dragOver0(nextSelection.id);
8892
- dragItem.querySelector(`.${_default$T.dataListItemDraggableButton}`).focus();
9210
+ dragItem.querySelector(`.${_default$S.dataListItemDraggableButton}`).focus();
8893
9211
  }
8894
9212
  }
8895
9213
  }
@@ -8939,7 +9257,7 @@
8939
9257
  drop: this.drop,
8940
9258
  dragKeyHandler: this.handleDragButtonKeys
8941
9259
  } },
8942
- React__namespace.createElement("ul", Object.assign({ className: css(_default$T.dataList, isCompact && _default$T.modifiers.compact, gridBreakpointClasses[gridBreakpoint], wrapModifier && _default$T.modifiers[wrapModifier], dragging && _default$T.modifiers.dragOver, className), style: props.style }, props, dragProps, { ref: this.ref }), children)));
9260
+ React__namespace.createElement("ul", Object.assign({ className: css(_default$S.dataList, isCompact && _default$S.modifiers.compact, gridBreakpointClasses[gridBreakpoint], wrapModifier && _default$S.modifiers[wrapModifier], dragging && _default$S.modifiers.dragOver, className), style: props.style }, props, dragProps, { ref: this.ref }), children)));
8943
9261
  }
8944
9262
  }
8945
9263
  DataList.displayName = 'DataList';
@@ -8958,13 +9276,13 @@
8958
9276
  id, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, isPlainButtonAction } = _a,
8959
9277
  /* eslint-enable @typescript-eslint/no-unused-vars */
8960
9278
  props = __rest$1(_a, ["children", "className", "visibility", "id", 'aria-label', 'aria-labelledby', "isPlainButtonAction"]);
8961
- return (React__namespace.createElement("div", Object.assign({ className: css(_default$T.dataListItemAction, formatBreakpointMods(visibility, _default$T), className) }, props), isPlainButtonAction ? React__namespace.createElement("div", { className: css(_default$T.dataListAction) }, children) : children));
9279
+ return (React__namespace.createElement("div", Object.assign({ className: css(_default$S.dataListItemAction, formatBreakpointMods(visibility, _default$S), className) }, props), isPlainButtonAction ? React__namespace.createElement("div", { className: css(_default$S.dataListAction) }, children) : children));
8962
9280
  };
8963
9281
  DataListAction.displayName = 'DataListAction';
8964
9282
 
8965
9283
  const DataListCell = (_a) => {
8966
9284
  var { children = null, className = '', width = 1, isFilled = true, alignRight = false, isIcon = false, wrapModifier = null } = _a, props = __rest$1(_a, ["children", "className", "width", "isFilled", "alignRight", "isIcon", "wrapModifier"]);
8967
- return (React__namespace.createElement("div", Object.assign({ className: css(_default$T.dataListCell, width > 1 && _default$T.modifiers[`flex_${width}`], !isFilled && _default$T.modifiers.noFill, alignRight && _default$T.modifiers.alignRight, isIcon && _default$T.modifiers.icon, className, wrapModifier && _default$T.modifiers[wrapModifier]) }, props), children));
9285
+ return (React__namespace.createElement("div", Object.assign({ className: css(_default$S.dataListCell, width > 1 && _default$S.modifiers[`flex_${width}`], !isFilled && _default$S.modifiers.noFill, alignRight && _default$S.modifiers.alignRight, isIcon && _default$S.modifiers.icon, className, wrapModifier && _default$S.modifiers[wrapModifier]) }, props), children));
8968
9286
  };
8969
9287
  DataListCell.displayName = 'DataListCell';
8970
9288
 
@@ -8972,17 +9290,17 @@
8972
9290
  var { className = '',
8973
9291
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
8974
9292
  onChange = (checked, event) => { }, isValid = true, isDisabled = false, isChecked = null, checked = null, otherControls = false } = _a, props = __rest$1(_a, ["className", "onChange", "isValid", "isDisabled", "isChecked", "checked", "otherControls"]);
8975
- const check = (React__namespace.createElement("div", { className: css(_default$T.dataListCheck) },
9293
+ const check = (React__namespace.createElement("div", { className: css(_default$S.dataListCheck) },
8976
9294
  React__namespace.createElement("input", Object.assign({}, props, { type: "checkbox", onChange: event => onChange(event.currentTarget.checked, event), "aria-invalid": !isValid, disabled: isDisabled, checked: isChecked || checked }))));
8977
9295
  return (React__namespace.createElement(React__namespace.Fragment, null,
8978
- !otherControls && React__namespace.createElement("div", { className: css(_default$T.dataListItemControl, className) }, check),
9296
+ !otherControls && React__namespace.createElement("div", { className: css(_default$S.dataListItemControl, className) }, check),
8979
9297
  otherControls && check));
8980
9298
  };
8981
9299
  DataListCheck.displayName = 'DataListCheck';
8982
9300
 
8983
9301
  const DataListControl = (_a) => {
8984
9302
  var { children, className = '' } = _a, props = __rest$1(_a, ["children", "className"]);
8985
- return (React__namespace.createElement("div", Object.assign({ className: css(_default$T.dataListItemControl, className) }, props), children));
9303
+ return (React__namespace.createElement("div", Object.assign({ className: css(_default$S.dataListItemControl, className) }, props), children));
8986
9304
  };
8987
9305
  DataListControl.displayName = 'DataListControl';
8988
9306
 
@@ -9001,8 +9319,8 @@
9001
9319
 
9002
9320
  const DataListDragButton = (_a) => {
9003
9321
  var { className = '', isDisabled = false } = _a, props = __rest$1(_a, ["className", "isDisabled"]);
9004
- return (React__namespace.createElement(DataListContext.Consumer, null, ({ dragKeyHandler }) => (React__namespace.createElement("button", Object.assign({ className: css(_default$T.dataListItemDraggableButton, isDisabled && _default$T.modifiers.disabled, className), onKeyDown: dragKeyHandler, type: "button", disabled: isDisabled }, props),
9005
- React__namespace.createElement("span", { className: css(_default$T.dataListItemDraggableIcon) },
9322
+ return (React__namespace.createElement(DataListContext.Consumer, null, ({ dragKeyHandler }) => (React__namespace.createElement("button", Object.assign({ className: css(_default$S.dataListItemDraggableButton, isDisabled && _default$S.modifiers.disabled, className), onKeyDown: dragKeyHandler, type: "button", disabled: isDisabled }, props),
9323
+ React__namespace.createElement("span", { className: css(_default$S.dataListItemDraggableIcon) },
9006
9324
  React__namespace.createElement(GripVerticalIcon$1, null))))));
9007
9325
  };
9008
9326
  DataListDragButton.displayName = 'DataListDragButton';
@@ -9032,8 +9350,8 @@
9032
9350
  let target = event.target;
9033
9351
  while (event.currentTarget !== target) {
9034
9352
  if (('onclick' in target && target.onclick) ||
9035
- target.parentNode.classList.contains(_default$T.dataListItemAction) ||
9036
- target.parentNode.classList.contains(_default$T.dataListItemControl)) {
9353
+ target.parentNode.classList.contains(_default$S.dataListItemAction) ||
9354
+ target.parentNode.classList.contains(_default$S.dataListItemControl)) {
9037
9355
  // check other event handlers are not present.
9038
9356
  return;
9039
9357
  }
@@ -9052,396 +9370,94 @@
9052
9370
  // DataListItem like we should have.
9053
9371
  // Recursively search children for the DataListDragButton and see if it's disabled...
9054
9372
  const dragButton = findDataListDragButton(children);
9055
- const dragProps = isDraggable && {
9056
- draggable: dragButton ? !dragButton.props.isDisabled : true,
9057
- onDrop: drop,
9058
- onDragEnd: dragEnd,
9059
- onDragStart: dragStart
9060
- };
9061
- return (React__namespace.createElement("li", Object.assign({ id: id, className: css(_default$T.dataListItem, isExpanded && _default$T.modifiers.expanded, isSelectable && _default$T.modifiers.selectable, selectedDataListItemId && selectedDataListItemId === id && _default$T.modifiers.selected, className), "aria-labelledby": ariaLabelledBy }, (isSelectable && { tabIndex: 0, onClick: selectDataListItem, onKeyDown }), (isSelectable && selectedDataListItemId === id && { 'aria-selected': true }), props, dragProps), React__namespace.Children.map(children, child => React__namespace.isValidElement(child) &&
9062
- React__namespace.cloneElement(child, {
9063
- rowid: ariaLabelledBy
9064
- }))));
9065
- }));
9066
- }
9067
- }
9068
- DataListItem.displayName = 'DataListItem';
9069
- DataListItem.defaultProps = {
9070
- isExpanded: false,
9071
- className: '',
9072
- id: '',
9073
- children: null,
9074
- 'aria-labelledby': ''
9075
- };
9076
-
9077
- const DataListItemCells = (_a) => {
9078
- var { className = '', dataListCells,
9079
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
9080
- rowid = '' } = _a, props = __rest$1(_a, ["className", "dataListCells", "rowid"]);
9081
- return (React__namespace.createElement("div", Object.assign({ className: css(_default$T.dataListItemContent, className) }, props), dataListCells));
9082
- };
9083
- DataListItemCells.displayName = 'DataListItemCells';
9084
-
9085
- const DataListItemRow = (_a) => {
9086
- var { children, className = '', rowid = '', wrapModifier = null } = _a, props = __rest$1(_a, ["children", "className", "rowid", "wrapModifier"]);
9087
- return (React__namespace.createElement("div", Object.assign({ className: css(_default$T.dataListItemRow, className, wrapModifier && _default$T.modifiers[wrapModifier]) }, props), React__namespace.Children.map(children, child => React__namespace.isValidElement(child) &&
9088
- React__namespace.cloneElement(child, {
9089
- rowid
9090
- }))));
9091
- };
9092
- DataListItemRow.displayName = 'DataListItemRow';
9093
-
9094
- const DataListToggle = (_a) => {
9095
- var { className = '', isExpanded = false, 'aria-controls': ariaControls = '', 'aria-label': ariaLabel = 'Details', rowid = '', id } = _a, props = __rest$1(_a, ["className", "isExpanded", 'aria-controls', 'aria-label', "rowid", "id"]);
9096
- return (React__namespace.createElement("div", Object.assign({ className: css(_default$T.dataListItemControl, className) }, props),
9097
- React__namespace.createElement("div", { className: css(_default$T.dataListToggle) },
9098
- React__namespace.createElement(Button, { id: id, variant: exports.ButtonVariant.plain, "aria-controls": ariaControls !== '' && ariaControls, "aria-label": ariaLabel, "aria-labelledby": ariaLabel !== 'Details' ? null : `${rowid} ${id}`, "aria-expanded": isExpanded },
9099
- React__namespace.createElement("div", { className: css(_default$T.dataListToggleIcon) },
9100
- React__namespace.createElement(AngleRightIcon$1, null))))));
9101
- };
9102
- DataListToggle.displayName = 'DataListToggle';
9103
-
9104
- const DataListContent = (_a) => {
9105
- var { className = '', children = null, id = '', isHidden = false, 'aria-label': ariaLabel, hasNoPadding = false,
9106
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
9107
- rowid = '' } = _a, props = __rest$1(_a, ["className", "children", "id", "isHidden", 'aria-label', "hasNoPadding", "rowid"]);
9108
- return (React__namespace.createElement("section", Object.assign({ id: id, className: css(_default$T.dataListExpandableContent, className), hidden: isHidden, "aria-label": ariaLabel }, props),
9109
- React__namespace.createElement("div", { className: css(_default$T.dataListExpandableContentBody, hasNoPadding && _default$T.modifiers.noPadding) }, children)));
9110
- };
9111
- DataListContent.displayName = 'DataListContent';
9112
-
9113
- const DataListText = (_a) => {
9114
- var { children = null, className = '', component = 'span', wrapModifier = null, tooltip: tooltipProp = '', onMouseEnter: onMouseEnterProp = () => { } } = _a, props = __rest$1(_a, ["children", "className", "component", "wrapModifier", "tooltip", "onMouseEnter"]);
9115
- const Component = component;
9116
- const [tooltip, setTooltip] = React__namespace.useState('');
9117
- const onMouseEnter = (event) => {
9118
- if (event.target.offsetWidth < event.target.scrollWidth) {
9119
- setTooltip(tooltipProp || event.target.innerHTML);
9120
- }
9121
- else {
9122
- setTooltip('');
9123
- }
9124
- onMouseEnterProp(event);
9125
- };
9126
- const text = (React__namespace.createElement(Component, Object.assign({ onMouseEnter: onMouseEnter, className: css(className, wrapModifier && _default$T.modifiers[wrapModifier], _default$T.dataListText) }, props), children));
9127
- return tooltip !== '' ? (React__namespace.createElement(Tooltip, { content: tooltip, isVisible: true }, text)) : (text);
9128
- };
9129
- DataListText.displayName = 'DataListText';
9130
-
9131
- var _default$R = {
9132
- "datePicker": "pf-c-date-picker",
9133
- "datePickerCalendar": "pf-c-date-picker__calendar",
9134
- "datePickerHelperText": "pf-c-date-picker__helper-text",
9135
- "datePickerInput": "pf-c-date-picker__input",
9136
- "formControl": "pf-c-form-control",
9137
- "modifiers": {
9138
- "error": "pf-m-error",
9139
- "alignRight": "pf-m-align-right",
9140
- "top": "pf-m-top"
9141
- }
9142
- };
9143
-
9144
- var _default$Q = {
9145
- "button": "pf-c-button",
9146
- "modifiers": {
9147
- "noPadding": "pf-m-no-padding",
9148
- "widthAuto": "pf-m-width-auto",
9149
- "top": "pf-m-top",
9150
- "topLeft": "pf-m-top-left",
9151
- "topRight": "pf-m-top-right",
9152
- "bottom": "pf-m-bottom",
9153
- "bottomLeft": "pf-m-bottom-left",
9154
- "bottomRight": "pf-m-bottom-right",
9155
- "left": "pf-m-left",
9156
- "leftTop": "pf-m-left-top",
9157
- "leftBottom": "pf-m-left-bottom",
9158
- "right": "pf-m-right",
9159
- "rightTop": "pf-m-right-top",
9160
- "rightBottom": "pf-m-right-bottom",
9161
- "danger": "pf-m-danger",
9162
- "warning": "pf-m-warning",
9163
- "success": "pf-m-success",
9164
- "default": "pf-m-default",
9165
- "info": "pf-m-info",
9166
- "icon": "pf-m-icon"
9167
- },
9168
- "popover": "pf-c-popover",
9169
- "popoverArrow": "pf-c-popover__arrow",
9170
- "popoverBody": "pf-c-popover__body",
9171
- "popoverContent": "pf-c-popover__content",
9172
- "popoverFooter": "pf-c-popover__footer",
9173
- "popoverTitle": "pf-c-popover__title",
9174
- "popoverTitleIcon": "pf-c-popover__title-icon",
9175
- "popoverTitleText": "pf-c-popover__title-text",
9176
- "title": "pf-c-title"
9177
- };
9178
-
9179
- const PopoverContext = React__namespace.createContext({});
9180
-
9181
- const PopoverContent = (_a) => {
9182
- var { className = null, children } = _a, props = __rest$1(_a, ["className", "children"]);
9183
- return (React__namespace.createElement("div", Object.assign({ className: css(_default$Q.popoverContent, className) }, props), children));
9184
- };
9185
- PopoverContent.displayName = 'PopoverContent';
9186
-
9187
- const PopoverBody = (_a) => {
9188
- var { children, id, className } = _a, props = __rest$1(_a, ["children", "id", "className"]);
9189
- return (React__namespace.createElement("div", Object.assign({ className: css(_default$Q.popoverBody, className), id: id }, props), children));
9190
- };
9191
- PopoverBody.displayName = 'PopoverBody';
9192
-
9193
- const PopoverHeaderIcon = (_a) => {
9194
- var { children, className } = _a, props = __rest$1(_a, ["children", "className"]);
9195
- return (React__namespace.createElement("span", Object.assign({ className: css(_default$Q.popoverTitleIcon, className) }, props), children));
9196
- };
9197
- PopoverHeaderIcon.displayName = 'PopoverHeaderIcon';
9198
-
9199
- const PopoverHeaderText = (_a) => {
9200
- var { children, className } = _a, props = __rest$1(_a, ["children", "className"]);
9201
- return (React__namespace.createElement("span", Object.assign({ className: css(_default$Q.popoverTitleText, className) }, props), children));
9202
- };
9203
- PopoverHeaderText.displayName = 'PopoverHeaderText';
9204
-
9205
- const PopoverHeader = (_a) => {
9206
- var { children, icon, className, titleHeadingLevel = 'h6', alertSeverityVariant, id, alertSeverityScreenReaderText } = _a, props = __rest$1(_a, ["children", "icon", "className", "titleHeadingLevel", "alertSeverityVariant", "id", "alertSeverityScreenReaderText"]);
9207
- const HeadingLevel = titleHeadingLevel;
9208
- return icon || alertSeverityVariant ? (React__namespace.createElement("header", Object.assign({ className: css('pf-c-popover__header', className), id: id }, props),
9209
- React__namespace.createElement(HeadingLevel, { className: css(_default$Q.popoverTitle, icon && _default$Q.modifiers.icon) },
9210
- icon && React__namespace.createElement(PopoverHeaderIcon, null, icon),
9211
- alertSeverityVariant && alertSeverityScreenReaderText && (React__namespace.createElement("span", { className: "pf-u-screen-reader" }, alertSeverityScreenReaderText)),
9212
- React__namespace.createElement(PopoverHeaderText, null, children)))) : (React__namespace.createElement(Title, Object.assign({ headingLevel: titleHeadingLevel, size: exports.TitleSizes.md, id: id, className: className }, props), children));
9213
- };
9214
- PopoverHeader.displayName = 'PopoverHeader';
9215
-
9216
- const PopoverFooter = (_a) => {
9217
- var { children, className = '' } = _a, props = __rest$1(_a, ["children", "className"]);
9218
- return (React__namespace.createElement("footer", Object.assign({ className: css(_default$Q.popoverFooter, className) }, props), children));
9373
+ const dragProps = isDraggable && {
9374
+ draggable: dragButton ? !dragButton.props.isDisabled : true,
9375
+ onDrop: drop,
9376
+ onDragEnd: dragEnd,
9377
+ onDragStart: dragStart
9378
+ };
9379
+ return (React__namespace.createElement("li", Object.assign({ id: id, className: css(_default$S.dataListItem, isExpanded && _default$S.modifiers.expanded, isSelectable && _default$S.modifiers.selectable, selectedDataListItemId && selectedDataListItemId === id && _default$S.modifiers.selected, className), "aria-labelledby": ariaLabelledBy }, (isSelectable && { tabIndex: 0, onClick: selectDataListItem, onKeyDown }), (isSelectable && selectedDataListItemId === id && { 'aria-selected': true }), props, dragProps), React__namespace.Children.map(children, child => React__namespace.isValidElement(child) &&
9380
+ React__namespace.cloneElement(child, {
9381
+ rowid: ariaLabelledBy
9382
+ }))));
9383
+ }));
9384
+ }
9385
+ }
9386
+ DataListItem.displayName = 'DataListItem';
9387
+ DataListItem.defaultProps = {
9388
+ isExpanded: false,
9389
+ className: '',
9390
+ id: '',
9391
+ children: null,
9392
+ 'aria-labelledby': ''
9219
9393
  };
9220
- PopoverFooter.displayName = 'PopoverFooter';
9221
9394
 
9222
- const PopoverCloseButton = (_a) => {
9223
- var { onClose = () => undefined } = _a, props = __rest$1(_a, ["onClose"]);
9224
- const [closeButtonElement, setCloseButtonElement] = React__namespace.useState(null);
9225
- React__namespace.useEffect(() => {
9226
- closeButtonElement && closeButtonElement.addEventListener('click', onClose, false);
9227
- return () => {
9228
- closeButtonElement && closeButtonElement.removeEventListener('click', onClose, false);
9229
- };
9230
- }, [closeButtonElement]);
9231
- return (React__namespace.createElement(FindRefWrapper, { onFoundRef: (foundRef) => setCloseButtonElement(foundRef) },
9232
- React__namespace.createElement(Button, Object.assign({ variant: "plain", "aria-label": true }, props, { style: { pointerEvents: 'auto' } }),
9233
- React__namespace.createElement(TimesIcon$1, null))));
9395
+ const DataListItemCells = (_a) => {
9396
+ var { className = '', dataListCells,
9397
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
9398
+ rowid = '' } = _a, props = __rest$1(_a, ["className", "dataListCells", "rowid"]);
9399
+ return (React__namespace.createElement("div", Object.assign({ className: css(_default$S.dataListItemContent, className) }, props), dataListCells));
9234
9400
  };
9235
- PopoverCloseButton.displayName = 'PopoverCloseButton';
9401
+ DataListItemCells.displayName = 'DataListItemCells';
9236
9402
 
9237
- const PopoverArrow = (_a) => {
9238
- var { className = '' } = _a, props = __rest$1(_a, ["className"]);
9239
- return React__namespace.createElement("div", Object.assign({ className: css(_default$Q.popoverArrow, className) }, props));
9403
+ const DataListItemRow = (_a) => {
9404
+ var { children, className = '', rowid = '', wrapModifier = null } = _a, props = __rest$1(_a, ["children", "className", "rowid", "wrapModifier"]);
9405
+ return (React__namespace.createElement("div", Object.assign({ className: css(_default$S.dataListItemRow, className, wrapModifier && _default$S.modifiers[wrapModifier]) }, props), React__namespace.Children.map(children, child => React__namespace.isValidElement(child) &&
9406
+ React__namespace.cloneElement(child, {
9407
+ rowid
9408
+ }))));
9240
9409
  };
9241
- PopoverArrow.displayName = 'PopoverArrow';
9410
+ DataListItemRow.displayName = 'DataListItemRow';
9242
9411
 
9243
- const c_popover_MaxWidth = {
9244
- "name": "--pf-c-popover--MaxWidth",
9245
- "value": "none",
9246
- "var": "var(--pf-c-popover--MaxWidth)"
9412
+ const DataListToggle = (_a) => {
9413
+ var { className = '', isExpanded = false, 'aria-controls': ariaControls = '', 'aria-label': ariaLabel = 'Details', rowid = '', id } = _a, props = __rest$1(_a, ["className", "isExpanded", 'aria-controls', 'aria-label', "rowid", "id"]);
9414
+ return (React__namespace.createElement("div", Object.assign({ className: css(_default$S.dataListItemControl, className) }, props),
9415
+ React__namespace.createElement("div", { className: css(_default$S.dataListToggle) },
9416
+ React__namespace.createElement(Button, { id: id, variant: exports.ButtonVariant.plain, "aria-controls": ariaControls !== '' && ariaControls, "aria-label": ariaLabel, "aria-labelledby": ariaLabel !== 'Details' ? null : `${rowid} ${id}`, "aria-expanded": isExpanded },
9417
+ React__namespace.createElement("div", { className: css(_default$S.dataListToggleIcon) },
9418
+ React__namespace.createElement(AngleRightIcon$1, null))))));
9247
9419
  };
9248
- var popoverMaxWidth = c_popover_MaxWidth;
9420
+ DataListToggle.displayName = 'DataListToggle';
9249
9421
 
9250
- const c_popover_MinWidth = {
9251
- "name": "--pf-c-popover--MinWidth",
9252
- "value": "auto",
9253
- "var": "var(--pf-c-popover--MinWidth)"
9422
+ const DataListContent = (_a) => {
9423
+ var { className = '', children = null, id = '', isHidden = false, 'aria-label': ariaLabel, hasNoPadding = false,
9424
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
9425
+ rowid = '' } = _a, props = __rest$1(_a, ["className", "children", "id", "isHidden", 'aria-label', "hasNoPadding", "rowid"]);
9426
+ return (React__namespace.createElement("section", Object.assign({ id: id, className: css(_default$S.dataListExpandableContent, className), hidden: isHidden, "aria-label": ariaLabel }, props),
9427
+ React__namespace.createElement("div", { className: css(_default$S.dataListExpandableContentBody, hasNoPadding && _default$S.modifiers.noPadding) }, children)));
9254
9428
  };
9255
- var popoverMinWidth = c_popover_MinWidth;
9429
+ DataListContent.displayName = 'DataListContent';
9256
9430
 
9257
- exports.PopoverPosition = void 0;
9258
- (function (PopoverPosition) {
9259
- PopoverPosition["auto"] = "auto";
9260
- PopoverPosition["top"] = "top";
9261
- PopoverPosition["bottom"] = "bottom";
9262
- PopoverPosition["left"] = "left";
9263
- PopoverPosition["right"] = "right";
9264
- PopoverPosition["topStart"] = "top-start";
9265
- PopoverPosition["topEnd"] = "top-end";
9266
- PopoverPosition["bottomStart"] = "bottom-start";
9267
- PopoverPosition["bottomEnd"] = "bottom-end";
9268
- PopoverPosition["leftStart"] = "left-start";
9269
- PopoverPosition["leftEnd"] = "left-end";
9270
- PopoverPosition["rightStart"] = "right-start";
9271
- PopoverPosition["rightEnd"] = "right-end";
9272
- })(exports.PopoverPosition || (exports.PopoverPosition = {}));
9273
- const alertStyle = {
9274
- default: _default$Q.modifiers.default,
9275
- info: _default$Q.modifiers.info,
9276
- success: _default$Q.modifiers.success,
9277
- warning: _default$Q.modifiers.warning,
9278
- danger: _default$Q.modifiers.danger
9279
- };
9280
- const Popover = (_a) => {
9281
- 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,
9282
- // For every initial starting position, there are 3 escape positions
9283
- 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"]);
9284
- {
9285
- boundary !== undefined &&
9286
- 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.');
9287
- tippyProps !== undefined && console.warn('The Popover tippyProps prop has been deprecated and is no longer used.');
9288
- }
9289
- // could make this a prop in the future (true | false | 'toggle')
9290
- // const hideOnClick = true;
9291
- const uniqueId = id || getUniqueId();
9292
- const triggerManually = isVisible !== null;
9293
- const [visible, setVisible] = React__namespace.useState(false);
9294
- const [opacity, setOpacity] = React__namespace.useState(0);
9295
- const [focusTrapActive, setFocusTrapActive] = React__namespace.useState(Boolean(propWithFocusTrap));
9296
- const transitionTimerRef = React__namespace.useRef(null);
9297
- const showTimerRef = React__namespace.useRef(null);
9298
- const hideTimerRef = React__namespace.useRef(null);
9299
- React__namespace.useEffect(() => {
9300
- onMount();
9301
- }, []);
9302
- React__namespace.useEffect(() => {
9303
- if (triggerManually) {
9304
- if (isVisible) {
9305
- show();
9306
- }
9307
- else {
9308
- hide();
9309
- }
9310
- }
9311
- }, [isVisible, triggerManually]);
9312
- const show = (withFocusTrap) => {
9313
- onShow();
9314
- if (transitionTimerRef.current) {
9315
- clearTimeout(transitionTimerRef.current);
9316
- }
9317
- if (hideTimerRef.current) {
9318
- clearTimeout(hideTimerRef.current);
9319
- }
9320
- showTimerRef.current = setTimeout(() => {
9321
- setVisible(true);
9322
- setOpacity(1);
9323
- propWithFocusTrap !== false && withFocusTrap && setFocusTrapActive(true);
9324
- onShown();
9325
- }, 0);
9326
- };
9327
- const hide = () => {
9328
- onHide();
9329
- if (showTimerRef.current) {
9330
- clearTimeout(showTimerRef.current);
9331
- }
9332
- hideTimerRef.current = setTimeout(() => {
9333
- setVisible(false);
9334
- setOpacity(0);
9335
- setFocusTrapActive(false);
9336
- transitionTimerRef.current = setTimeout(() => {
9337
- onHidden();
9338
- }, animationDuration);
9339
- }, 0);
9340
- };
9341
- const positionModifiers = {
9342
- top: _default$Q.modifiers.top,
9343
- bottom: _default$Q.modifiers.bottom,
9344
- left: _default$Q.modifiers.left,
9345
- right: _default$Q.modifiers.right,
9346
- 'top-start': _default$Q.modifiers.topLeft,
9347
- 'top-end': _default$Q.modifiers.topRight,
9348
- 'bottom-start': _default$Q.modifiers.bottomLeft,
9349
- 'bottom-end': _default$Q.modifiers.bottomRight,
9350
- 'left-start': _default$Q.modifiers.leftTop,
9351
- 'left-end': _default$Q.modifiers.leftBottom,
9352
- 'right-start': _default$Q.modifiers.rightTop,
9353
- 'right-end': _default$Q.modifiers.rightBottom
9354
- };
9355
- const hasCustomMinWidth = minWidth !== popoverMinWidth.value;
9356
- const hasCustomMaxWidth = maxWidth !== popoverMaxWidth.value;
9357
- const onDocumentKeyDown = (event) => {
9358
- if (event.keyCode === KEY_CODES.ESCAPE_KEY && visible) {
9359
- if (triggerManually) {
9360
- shouldClose(null, hide, event);
9361
- }
9362
- else {
9363
- hide();
9364
- }
9365
- }
9366
- };
9367
- const onDocumentClick = (event, triggerElement, popperElement) => {
9368
- if (hideOnOutsideClick && visible) {
9369
- // check if we clicked within the popper, if so don't do anything
9370
- const isChild = popperElement && popperElement.contains(event.target);
9371
- if (isChild) {
9372
- // clicked within the popper
9373
- return;
9374
- }
9375
- if (triggerManually) {
9376
- shouldClose(null, hide, event);
9377
- }
9378
- else {
9379
- hide();
9380
- }
9381
- }
9382
- };
9383
- const onTriggerClick = (event) => {
9384
- if (triggerManually) {
9385
- if (visible) {
9386
- shouldClose(null, hide, event);
9387
- }
9388
- else {
9389
- shouldOpen(show, event);
9390
- }
9391
- }
9392
- else {
9393
- if (visible) {
9394
- hide();
9395
- }
9396
- else {
9397
- show(true);
9398
- }
9399
- }
9400
- };
9401
- const onContentMouseDown = () => {
9402
- if (focusTrapActive) {
9403
- setFocusTrapActive(false);
9404
- }
9405
- };
9406
- const closePopover = (event) => {
9407
- event.stopPropagation();
9408
- if (triggerManually) {
9409
- shouldClose(null, hide, event);
9431
+ const DataListText = (_a) => {
9432
+ var { children = null, className = '', component = 'span', wrapModifier = null, tooltip: tooltipProp = '', onMouseEnter: onMouseEnterProp = () => { } } = _a, props = __rest$1(_a, ["children", "className", "component", "wrapModifier", "tooltip", "onMouseEnter"]);
9433
+ const Component = component;
9434
+ const [tooltip, setTooltip] = React__namespace.useState('');
9435
+ const onMouseEnter = (event) => {
9436
+ if (event.target.offsetWidth < event.target.scrollWidth) {
9437
+ setTooltip(tooltipProp || event.target.innerHTML);
9410
9438
  }
9411
9439
  else {
9412
- hide();
9440
+ setTooltip('');
9413
9441
  }
9442
+ onMouseEnterProp(event);
9414
9443
  };
9415
- const content = (React__namespace.createElement(FocusTrap, Object.assign({ active: focusTrapActive, focusTrapOptions: {
9416
- returnFocusOnDeactivate: true,
9417
- clickOutsideDeactivates: true,
9418
- fallbackFocus: () => {
9419
- // If the popover's trigger is focused but scrolled out of view,
9420
- // FocusTrap will throw an error when the Enter button is used on the trigger.
9421
- // That is because the Popover is hidden when its trigger is out of view.
9422
- // Provide a fallback in that case.
9423
- let node = null;
9424
- if (document && document.activeElement) {
9425
- node = document.activeElement;
9426
- }
9427
- return node;
9428
- }
9429
- }, preventScrollOnDeactivate: true, className: css(_default$Q.popover, alertSeverityVariant && alertStyle[alertSeverityVariant], hasNoPadding && _default$Q.modifiers.noPadding, hasAutoWidth && _default$Q.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: {
9430
- minWidth: hasCustomMinWidth ? minWidth : null,
9431
- maxWidth: hasCustomMaxWidth ? maxWidth : null,
9432
- opacity,
9433
- transition: getOpacityTransition(animationDuration)
9434
- } }, rest),
9435
- React__namespace.createElement(PopoverArrow, null),
9436
- React__namespace.createElement(PopoverContent, null,
9437
- showClose && React__namespace.createElement(PopoverCloseButton, { onClose: closePopover, "aria-label": closeBtnAriaLabel }),
9438
- 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)),
9439
- React__namespace.createElement(PopoverBody, { id: `popover-${uniqueId}-body` }, typeof bodyContent === 'function' ? bodyContent(hide) : bodyContent),
9440
- footerContent && (React__namespace.createElement(PopoverFooter, { id: `popover-${uniqueId}-footer` }, typeof footerContent === 'function' ? footerContent(hide) : footerContent)))));
9441
- return (React__namespace.createElement(PopoverContext.Provider, { value: { headerComponent } },
9442
- React__namespace.createElement(Popper, { trigger: children, reference: reference, popper: content, popperMatchesTriggerWidth: false, appendTo: appendTo, isVisible: visible, positionModifiers: positionModifiers, distance: distance, placement: position, onTriggerClick: onTriggerClick, onDocumentClick: onDocumentClick, onDocumentKeyDown: onDocumentKeyDown, enableFlip: enableFlip, zIndex: zIndex, flipBehavior: flipBehavior })));
9444
+ const text = (React__namespace.createElement(Component, Object.assign({ onMouseEnter: onMouseEnter, className: css(className, wrapModifier && _default$S.modifiers[wrapModifier], _default$S.dataListText) }, props), children));
9445
+ return tooltip !== '' ? (React__namespace.createElement(Tooltip, { content: tooltip, isVisible: true }, text)) : (text);
9446
+ };
9447
+ DataListText.displayName = 'DataListText';
9448
+
9449
+ var _default$Q = {
9450
+ "datePicker": "pf-c-date-picker",
9451
+ "datePickerCalendar": "pf-c-date-picker__calendar",
9452
+ "datePickerHelperText": "pf-c-date-picker__helper-text",
9453
+ "datePickerInput": "pf-c-date-picker__input",
9454
+ "formControl": "pf-c-form-control",
9455
+ "modifiers": {
9456
+ "error": "pf-m-error",
9457
+ "alignRight": "pf-m-align-right",
9458
+ "top": "pf-m-top"
9459
+ }
9443
9460
  };
9444
- Popover.displayName = 'Popover';
9445
9461
 
9446
9462
  const OutlinedCalendarAltIconConfig = {
9447
9463
  name: 'OutlinedCalendarAltIcon',
@@ -9527,7 +9543,7 @@
9527
9543
  setCalendarOpen: (isOpen) => setPopoverOpen(isOpen),
9528
9544
  toggleCalendar: () => setPopoverOpen(prev => !prev)
9529
9545
  }), [setPopoverOpen]);
9530
- return (React__namespace.createElement("div", Object.assign({ className: css(_default$R.datePicker, className), style: style }, props),
9546
+ return (React__namespace.createElement("div", Object.assign({ className: css(_default$Q.datePicker, className), style: style }, props),
9531
9547
  React__namespace.createElement(Popover, Object.assign({ position: "bottom", bodyContent: React__namespace.createElement(CalendarMonth, { date: valueDate, onChange: onDateClick, locale: locale,
9532
9548
  // Use truthy values of strings
9533
9549
  validators: validators.map(validator => (date) => !validator(date)), onSelectToggle: open => setSelectOpen(open), monthFormat: monthFormat, weekdayFormat: weekdayFormat, longWeekdayFormat: longWeekdayFormat, dayFormat: dayFormat, weekStart: weekStart, rangeStart: rangeStart }), showClose: false, isVisible: popoverOpen, shouldClose: (_1, _2, event) => {
@@ -9543,13 +9559,13 @@
9543
9559
  setPopoverOpen(false);
9544
9560
  return true;
9545
9561
  }, withFocusTrap: true, hasNoPadding: true, hasAutoWidth: true, appendTo: appendTo }, popoverProps),
9546
- React__namespace.createElement("div", { className: _default$R.datePickerInput },
9562
+ React__namespace.createElement("div", { className: _default$Q.datePickerInput },
9547
9563
  React__namespace.createElement(InputGroup, null,
9548
9564
  React__namespace.createElement(TextInput, Object.assign({ isDisabled: isDisabled, "aria-label": ariaLabel, placeholder: placeholder, validated: errorText ? 'error' : 'default', value: value, onChange: onTextInput, onBlur: onInputBlur, onKeyPress: onKeyPress }, inputProps)),
9549
9565
  React__namespace.createElement("button", { ref: buttonRef, className: css(_default$1k.button, _default$1k.modifiers.control), "aria-label": buttonAriaLabel, type: "button", onClick: () => setPopoverOpen(!popoverOpen), disabled: isDisabled },
9550
9566
  React__namespace.createElement(OutlinedCalendarAltIcon$1, null))))),
9551
- helperText && React__namespace.createElement("div", { className: _default$R.datePickerHelperText }, helperText),
9552
- errorText.trim() && React__namespace.createElement("div", { className: css(_default$R.datePickerHelperText, _default$R.modifiers.error) }, errorText)));
9567
+ helperText && React__namespace.createElement("div", { className: _default$Q.datePickerHelperText }, helperText),
9568
+ errorText.trim() && React__namespace.createElement("div", { className: css(_default$Q.datePickerHelperText, _default$Q.modifiers.error) }, errorText)));
9553
9569
  };
9554
9570
  const DatePicker = React__namespace.forwardRef(DatePickerBase);
9555
9571
  DatePicker.displayName = 'DatePicker';
@@ -18483,13 +18499,13 @@
18483
18499
  React__namespace.createElement(MenuContent, { maxMenuHeight: "200px" },
18484
18500
  React__namespace.createElement(MenuList, { "aria-labelledby": `${randomId}-input` }, options.map((option, index) => (React__namespace.createElement(MenuItem, { onClick: this.onSelect, key: option, id: `${randomId}-option-${index}` }, option)))))));
18485
18501
  const textInput = (React__namespace.createElement(TextInput, Object.assign({ className: css(_default$1b.formControl), id: `${randomId}-input`, "aria-label": ariaLabel, validated: isInvalid ? 'error' : 'default', placeholder: placeholder, value: timeState || '', type: "text", iconVariant: "clock", onClick: this.onInputFocus, onFocus: this.onInputFocus, onChange: this.onInputChange, onBlur: this.onBlur, autoComplete: "off", isDisabled: isDisabled, ref: this.inputRef }, inputProps)));
18486
- return (React__namespace.createElement("div", { className: css(_default$R.datePicker, className) },
18487
- React__namespace.createElement("div", Object.assign({ className: css(_default$R.datePickerInput), style: style }, props),
18502
+ return (React__namespace.createElement("div", { className: css(_default$Q.datePicker, className) },
18503
+ React__namespace.createElement("div", Object.assign({ className: css(_default$Q.datePickerInput), style: style }, props),
18488
18504
  React__namespace.createElement(InputGroup, null,
18489
18505
  React__namespace.createElement("div", { id: randomId, ref: this.parentRef },
18490
18506
  React__namespace.createElement("div", { ref: this.toggleRef, style: { paddingLeft: '0' } }, menuAppendTo !== 'inline' ? (React__namespace.createElement(Popper, { appendTo: this.parentRef.current, trigger: textInput, popper: menuContainer, isVisible: isOpen })) : (textInput)),
18491
18507
  isOpen && menuAppendTo === 'inline' && menuContainer)),
18492
- isInvalid && (React__namespace.createElement("div", { className: css(_default$R.datePickerHelperText, _default$R.modifiers.error) }, !isValidFormat ? invalidFormatErrorMessage : invalidMinMaxErrorMessage)))));
18508
+ isInvalid && (React__namespace.createElement("div", { className: css(_default$Q.datePickerHelperText, _default$Q.modifiers.error) }, !isValidFormat ? invalidFormatErrorMessage : invalidMinMaxErrorMessage)))));
18493
18509
  }
18494
18510
  }
18495
18511
  TimePicker.displayName = 'TimePicker';
@@ -20105,7 +20121,7 @@
20105
20121
  TextInputGroup.displayName = 'TextInputGroup';
20106
20122
 
20107
20123
  const TextInputGroupMain = (_a) => {
20108
- var { children, className, icon, type = 'text', onChange = () => undefined, onFocus, onBlur, 'aria-label': ariaLabel = 'Type to filter', value: inputValue, placeholder: inputPlaceHolder } = _a, props = __rest$1(_a, ["children", "className", "icon", "type", "onChange", "onFocus", "onBlur", 'aria-label', "value", "placeholder"]);
20124
+ var { children, className, icon, type = 'text', hint, onChange = () => undefined, onFocus, onBlur, 'aria-label': ariaLabel = 'Type to filter', value: inputValue, placeholder: inputPlaceHolder } = _a, props = __rest$1(_a, ["children", "className", "icon", "type", "hint", "onChange", "onFocus", "onBlur", 'aria-label', "value", "placeholder"]);
20109
20125
  const { isDisabled } = React__namespace.useContext(TextInputGroupContext);
20110
20126
  const handleChange = (event) => {
20111
20127
  onChange(event.currentTarget.value, event);
@@ -20113,6 +20129,7 @@
20113
20129
  return (React__namespace.createElement("div", Object.assign({ className: css(_default$8.textInputGroupMain, icon && _default$8.modifiers.icon, className) }, props),
20114
20130
  children,
20115
20131
  React__namespace.createElement("span", { className: css(_default$8.textInputGroupText) },
20132
+ hint && (React__namespace.createElement("input", { className: css(_default$8.textInputGroupTextInput, _default$8.modifiers.hint), type: "text", disabled: true, "aria-hidden": "true", value: hint })),
20116
20133
  icon && React__namespace.createElement("span", { className: css(_default$8.textInputGroupIcon) }, icon),
20117
20134
  React__namespace.createElement("input", { type: type, className: css(_default$8.textInputGroupTextInput), "aria-label": ariaLabel, disabled: isDisabled, onChange: handleChange, onFocus: onFocus, onBlur: onBlur, value: inputValue || '', placeholder: inputPlaceHolder }))));
20118
20135
  };