@patternfly/react-core 4.192.8 → 4.192.12

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 (67) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/esm/components/Select/Select.d.ts +5 -1
  3. package/dist/esm/components/Select/Select.d.ts.map +1 -1
  4. package/dist/esm/components/Select/Select.js +171 -28
  5. package/dist/esm/components/Select/Select.js.map +1 -1
  6. package/dist/esm/components/Select/SelectMenu.d.ts.map +1 -1
  7. package/dist/esm/components/Select/SelectMenu.js +2 -1
  8. package/dist/esm/components/Select/SelectMenu.js.map +1 -1
  9. package/dist/esm/components/Select/SelectOption.d.ts.map +1 -1
  10. package/dist/esm/components/Select/SelectOption.js +6 -1
  11. package/dist/esm/components/Select/SelectOption.js.map +1 -1
  12. package/dist/esm/components/Select/SelectToggle.d.ts +3 -2
  13. package/dist/esm/components/Select/SelectToggle.d.ts.map +1 -1
  14. package/dist/esm/components/Select/SelectToggle.js +26 -16
  15. package/dist/esm/components/Select/SelectToggle.js.map +1 -1
  16. package/dist/esm/components/Select/selectConstants.d.ts +1 -0
  17. package/dist/esm/components/Select/selectConstants.d.ts.map +1 -1
  18. package/dist/esm/components/Select/selectConstants.js +1 -0
  19. package/dist/esm/components/Select/selectConstants.js.map +1 -1
  20. package/dist/esm/components/Tabs/Tabs.d.ts +2 -5
  21. package/dist/esm/components/Tabs/Tabs.d.ts.map +1 -1
  22. package/dist/esm/components/Tabs/Tabs.js +3 -3
  23. package/dist/esm/components/Tabs/Tabs.js.map +1 -1
  24. package/dist/esm/helpers/util.d.ts +6 -0
  25. package/dist/esm/helpers/util.d.ts.map +1 -1
  26. package/dist/esm/helpers/util.js +12 -0
  27. package/dist/esm/helpers/util.js.map +1 -1
  28. package/dist/js/components/Select/Select.d.ts +5 -1
  29. package/dist/js/components/Select/Select.d.ts.map +1 -1
  30. package/dist/js/components/Select/Select.js +170 -27
  31. package/dist/js/components/Select/Select.js.map +1 -1
  32. package/dist/js/components/Select/SelectMenu.d.ts.map +1 -1
  33. package/dist/js/components/Select/SelectMenu.js +2 -1
  34. package/dist/js/components/Select/SelectMenu.js.map +1 -1
  35. package/dist/js/components/Select/SelectOption.d.ts.map +1 -1
  36. package/dist/js/components/Select/SelectOption.js +6 -1
  37. package/dist/js/components/Select/SelectOption.js.map +1 -1
  38. package/dist/js/components/Select/SelectToggle.d.ts +3 -2
  39. package/dist/js/components/Select/SelectToggle.d.ts.map +1 -1
  40. package/dist/js/components/Select/SelectToggle.js +25 -15
  41. package/dist/js/components/Select/SelectToggle.js.map +1 -1
  42. package/dist/js/components/Select/selectConstants.d.ts +1 -0
  43. package/dist/js/components/Select/selectConstants.d.ts.map +1 -1
  44. package/dist/js/components/Select/selectConstants.js +2 -1
  45. package/dist/js/components/Select/selectConstants.js.map +1 -1
  46. package/dist/js/components/Tabs/Tabs.d.ts +2 -5
  47. package/dist/js/components/Tabs/Tabs.d.ts.map +1 -1
  48. package/dist/js/components/Tabs/Tabs.js +3 -3
  49. package/dist/js/components/Tabs/Tabs.js.map +1 -1
  50. package/dist/js/helpers/util.d.ts +6 -0
  51. package/dist/js/helpers/util.d.ts.map +1 -1
  52. package/dist/js/helpers/util.js +14 -1
  53. package/dist/js/helpers/util.js.map +1 -1
  54. package/dist/umd/react-core.css +64 -6
  55. package/dist/umd/react-core.js +218 -47
  56. package/dist/umd/react-core.min.css +78 -20
  57. package/dist/umd/react-core.min.js +3 -3
  58. package/package.json +6 -6
  59. package/src/components/Select/Select.tsx +166 -26
  60. package/src/components/Select/SelectMenu.tsx +2 -1
  61. package/src/components/Select/SelectOption.tsx +5 -1
  62. package/src/components/Select/SelectToggle.tsx +38 -17
  63. package/src/components/Select/__tests__/__snapshots__/Select.test.tsx.snap +74 -24
  64. package/src/components/Select/examples/Select.md +5 -1
  65. package/src/components/Select/selectConstants.tsx +2 -0
  66. package/src/components/Tabs/Tabs.tsx +6 -9
  67. package/src/helpers/util.ts +13 -0
@@ -1132,6 +1132,18 @@
1132
1132
  }
1133
1133
  }
1134
1134
  }
1135
+ /** This function returns a list of tabbable items in a container
1136
+ *
1137
+ * @param {any} containerRef to the container
1138
+ * @param {string} tababbleSelectors CSS selector string of tabbable items
1139
+ */
1140
+ function findTabbableElements(containerRef, tababbleSelectors) {
1141
+ const tabbable = containerRef.current.querySelectorAll(tababbleSelectors);
1142
+ const list = Array.prototype.filter.call(tabbable, function (item) {
1143
+ return item.tabIndex >= '0';
1144
+ });
1145
+ return list;
1146
+ }
1135
1147
  /** This function is a helper for keyboard navigation through dropdowns.
1136
1148
  *
1137
1149
  * @param {number} index The index of the element you're on
@@ -6061,6 +6073,7 @@
6061
6073
  ArrowLeft: 'ArrowLeft',
6062
6074
  ArrowRight: 'ArrowRight'
6063
6075
  };
6076
+ const SelectFooterTabbableItems = 'input, button, select, textarea, a[href]';
6064
6077
 
6065
6078
  class SelectOption extends React__namespace.Component {
6066
6079
  constructor() {
@@ -6086,7 +6099,12 @@
6086
6099
  event.stopPropagation();
6087
6100
  }
6088
6101
  else {
6089
- keyHandler(index, innerIndex, 'tab');
6102
+ if (event.shiftKey) {
6103
+ keyHandler(index, innerIndex, 'up');
6104
+ }
6105
+ else {
6106
+ keyHandler(index, innerIndex, 'tab');
6107
+ }
6090
6108
  }
6091
6109
  }
6092
6110
  event.preventDefault();
@@ -6323,7 +6341,8 @@
6323
6341
  isChecked: this.checkForValue(option.props.value, checked),
6324
6342
  sendRef,
6325
6343
  keyHandler,
6326
- index: index++
6344
+ index: index++,
6345
+ isLastOptionBeforeFooter
6327
6346
  })))) : null
6328
6347
  });
6329
6348
  });
@@ -6406,26 +6425,19 @@
6406
6425
  onClose();
6407
6426
  }
6408
6427
  };
6409
- this.findTabbableFooterElements = () => {
6410
- const tabbable = this.props.footerRef.current.querySelectorAll('input, button, select, textarea, a[href]');
6411
- const list = Array.prototype.filter.call(tabbable, function (item) {
6412
- return item.tabIndex >= '0';
6413
- });
6414
- return list;
6415
- };
6416
6428
  this.handleGlobalKeys = (event) => {
6417
- const { parentRef, menuRef, hasFooter, isOpen, variant, onToggle, onClose } = this.props;
6429
+ const { parentRef, menuRef, hasFooter, footerRef, isOpen, variant, onToggle, onClose, moveFocusToLastMenuItem } = this.props;
6418
6430
  const escFromToggle = parentRef && parentRef.current && parentRef.current.contains(event.target);
6419
6431
  const escFromWithinMenu = menuRef && menuRef.current && menuRef.current.contains && menuRef.current.contains(event.target);
6420
6432
  if (isOpen &&
6421
6433
  event.key === KeyTypes.Tab &&
6422
6434
  (variant === exports.SelectVariant.typeahead || variant === exports.SelectVariant.typeaheadMulti)) {
6423
- this.props.handleTypeaheadKeys('tab');
6435
+ this.props.handleTypeaheadKeys('tab', event.shiftKey);
6424
6436
  event.preventDefault();
6425
6437
  return;
6426
6438
  }
6427
6439
  if (isOpen && event.key === KeyTypes.Tab && hasFooter) {
6428
- const tabbableItems = this.findTabbableFooterElements();
6440
+ const tabbableItems = findTabbableElements(footerRef, SelectFooterTabbableItems);
6429
6441
  // If no tabbable item in footer close select
6430
6442
  if (tabbableItems.length <= 0) {
6431
6443
  onToggle(false);
@@ -6434,14 +6446,30 @@
6434
6446
  return;
6435
6447
  }
6436
6448
  else {
6437
- // if current element is not in footer, tab to first tabbable element in footer
6438
- const currentElementIndex = tabbableItems.findIndex(item => item === document.activeElement);
6449
+ // if current element is not in footer, tab to first tabbable element in footer, or close if shift clicked
6450
+ const currentElementIndex = tabbableItems.findIndex((item) => item === document.activeElement);
6439
6451
  if (currentElementIndex === -1) {
6440
- tabbableItems[0].focus();
6441
- return;
6452
+ if (event.shiftKey) {
6453
+ if (variant !== 'checkbox') {
6454
+ // only close non checkbox variation on shift clicked
6455
+ onToggle(false);
6456
+ onClose();
6457
+ this.toggle.current.focus();
6458
+ }
6459
+ }
6460
+ else {
6461
+ // tab to footer
6462
+ tabbableItems[0].focus();
6463
+ return;
6464
+ }
6442
6465
  }
6443
6466
  // Current element is in footer.
6444
6467
  if (event.shiftKey) {
6468
+ // Move focus back to menuif current tab index is 0
6469
+ if (currentElementIndex === 0) {
6470
+ moveFocusToLastMenuItem();
6471
+ event.preventDefault();
6472
+ }
6445
6473
  return;
6446
6474
  }
6447
6475
  // Tab to next element in footer or close if there are none
@@ -6515,7 +6543,7 @@
6515
6543
  }
6516
6544
  render() {
6517
6545
  /* eslint-disable @typescript-eslint/no-unused-vars */
6518
- const _a = this.props, { className, children, isOpen, isActive, isPlain, isDisabled, hasPlaceholderStyle, variant, onToggle, onEnter, onClose, onClickTypeaheadToggleButton, handleTypeaheadKeys, parentRef, menuRef, id, type, hasClearButton, 'aria-labelledby': ariaLabelledBy, 'aria-label': ariaLabel, hasFooter, footerRef } = _a, props = __rest$1(_a, ["className", "children", "isOpen", "isActive", "isPlain", "isDisabled", "hasPlaceholderStyle", "variant", "onToggle", "onEnter", "onClose", "onClickTypeaheadToggleButton", "handleTypeaheadKeys", "parentRef", "menuRef", "id", "type", "hasClearButton", 'aria-labelledby', 'aria-label', "hasFooter", "footerRef"]);
6546
+ const _a = this.props, { className, children, isOpen, isActive, isPlain, isDisabled, hasPlaceholderStyle, variant, onToggle, onEnter, onClose, onClickTypeaheadToggleButton, handleTypeaheadKeys, moveFocusToLastMenuItem, parentRef, menuRef, id, type, hasClearButton, 'aria-labelledby': ariaLabelledBy, 'aria-label': ariaLabel, hasFooter, footerRef } = _a, props = __rest$1(_a, ["className", "children", "isOpen", "isActive", "isPlain", "isDisabled", "hasPlaceholderStyle", "variant", "onToggle", "onEnter", "onClose", "onClickTypeaheadToggleButton", "handleTypeaheadKeys", "moveFocusToLastMenuItem", "parentRef", "menuRef", "id", "type", "hasClearButton", 'aria-labelledby', 'aria-label', "hasFooter", "footerRef"]);
6519
6547
  /* eslint-enable @typescript-eslint/no-unused-vars */
6520
6548
  const isTypeahead = variant === exports.SelectVariant.typeahead || variant === exports.SelectVariant.typeaheadMulti || hasClearButton;
6521
6549
  const toggleProps = {
@@ -6978,9 +7006,37 @@
6978
7006
  typeaheadInputValue
6979
7007
  }));
6980
7008
  };
6981
- this.handleTypeaheadKeys = (position) => {
7009
+ this.switchFocusToFavoriteMenu = () => {
7010
+ const { typeaheadCurrIndex, typeaheadStoredIndex } = this.state;
7011
+ let indexForFocus = 0;
7012
+ if (typeaheadCurrIndex !== -1) {
7013
+ indexForFocus = typeaheadCurrIndex;
7014
+ }
7015
+ else if (typeaheadStoredIndex !== -1) {
7016
+ indexForFocus = typeaheadStoredIndex;
7017
+ }
7018
+ if (this.refCollection[indexForFocus] !== null && this.refCollection[indexForFocus][0] !== null) {
7019
+ this.refCollection[indexForFocus][0].focus();
7020
+ }
7021
+ else {
7022
+ this.clearRef.current.focus();
7023
+ }
7024
+ this.setState({
7025
+ tabbedIntoFavoritesMenu: true,
7026
+ typeaheadCurrIndex: -1
7027
+ });
7028
+ };
7029
+ this.moveFocusToLastMenuItem = () => {
7030
+ const refCollectionLen = this.refCollection.length;
7031
+ if (refCollectionLen > 0 &&
7032
+ this.refCollection[refCollectionLen - 1] !== null &&
7033
+ this.refCollection[refCollectionLen - 1][0] !== null) {
7034
+ this.refCollection[refCollectionLen - 1][0].focus();
7035
+ }
7036
+ };
7037
+ this.handleTypeaheadKeys = (position, shiftKey = false) => {
6982
7038
  const { isOpen, onFavorite } = this.props;
6983
- const { typeaheadCurrIndex, tabbedIntoFavoritesMenu, typeaheadStoredIndex } = this.state;
7039
+ const { typeaheadCurrIndex, tabbedIntoFavoritesMenu } = this.state;
6984
7040
  const typeaheadActiveChild = this.getTypeaheadActiveChild(typeaheadCurrIndex);
6985
7041
  if (isOpen) {
6986
7042
  if (position === 'enter') {
@@ -6998,32 +7054,127 @@
6998
7054
  }
6999
7055
  else if (position === 'tab') {
7000
7056
  if (onFavorite) {
7057
+ // if the input has focus, tab to the first item or the last item that was previously focused.
7001
7058
  if (this.inputRef.current === document.activeElement) {
7002
- let indexForFocus = 0;
7003
- if (typeaheadCurrIndex !== -1) {
7004
- indexForFocus = typeaheadCurrIndex;
7005
- }
7006
- else if (typeaheadStoredIndex !== -1) {
7007
- indexForFocus = typeaheadStoredIndex;
7008
- }
7009
- if (this.refCollection[indexForFocus] !== null && this.refCollection[indexForFocus][0] !== null) {
7010
- this.refCollection[indexForFocus][0].focus();
7059
+ // If shift is also clicked and there is a footer, tab to the last item in tabbable footer
7060
+ if (this.props.footer && shiftKey) {
7061
+ const tabbableItems = findTabbableElements(this.footerRef, SelectFooterTabbableItems);
7062
+ if (tabbableItems.length > 0) {
7063
+ if (tabbableItems[tabbableItems.length - 1]) {
7064
+ tabbableItems[tabbableItems.length - 1].focus();
7065
+ }
7066
+ }
7011
7067
  }
7012
7068
  else {
7013
- this.clearRef.current.focus();
7069
+ this.switchFocusToFavoriteMenu();
7014
7070
  }
7015
- this.setState({
7016
- tabbedIntoFavoritesMenu: true,
7017
- typeaheadCurrIndex: -1
7018
- });
7019
7071
  }
7020
7072
  else {
7021
- this.inputRef.current.focus();
7022
- this.setState({ tabbedIntoFavoritesMenu: false });
7073
+ // focus is on menu or footer
7074
+ if (this.props.footer) {
7075
+ let tabbedIntoMenu = false;
7076
+ const tabbableItems = findTabbableElements(this.footerRef, SelectFooterTabbableItems);
7077
+ if (tabbableItems.length > 0) {
7078
+ // if current element is not in footer, tab to first tabbable element in footer,
7079
+ // if shift was clicked, tab to input since focus is on menu
7080
+ const currentElementIndex = tabbableItems.findIndex((item) => item === document.activeElement);
7081
+ if (currentElementIndex === -1) {
7082
+ if (shiftKey) {
7083
+ // currently in menu, shift back to input
7084
+ this.inputRef.current.focus();
7085
+ }
7086
+ else {
7087
+ // currently in menu, tab to first tabbable item in footer
7088
+ tabbableItems[0].focus();
7089
+ }
7090
+ }
7091
+ else {
7092
+ // already in footer
7093
+ if (shiftKey) {
7094
+ // shift to previous item
7095
+ if (currentElementIndex === 0) {
7096
+ // on first footer item, shift back to menu
7097
+ this.switchFocusToFavoriteMenu();
7098
+ tabbedIntoMenu = true;
7099
+ }
7100
+ else {
7101
+ // shift to previous footer item
7102
+ tabbableItems[currentElementIndex - 1].focus();
7103
+ }
7104
+ }
7105
+ else {
7106
+ // tab to next tabbable item in footer or to input.
7107
+ if (tabbableItems[currentElementIndex + 1]) {
7108
+ tabbableItems[currentElementIndex + 1].focus();
7109
+ }
7110
+ else {
7111
+ this.inputRef.current.focus();
7112
+ }
7113
+ }
7114
+ }
7115
+ }
7116
+ else {
7117
+ // no tabbable items in footer, tab to input
7118
+ this.inputRef.current.focus();
7119
+ tabbedIntoMenu = false;
7120
+ }
7121
+ this.setState({ tabbedIntoFavoritesMenu: tabbedIntoMenu });
7122
+ }
7123
+ else {
7124
+ this.inputRef.current.focus();
7125
+ this.setState({ tabbedIntoFavoritesMenu: false });
7126
+ }
7023
7127
  }
7024
7128
  }
7025
7129
  else {
7026
- this.onToggle(false);
7130
+ // Close if there is no footer
7131
+ if (!this.props.footer) {
7132
+ this.onToggle(false);
7133
+ }
7134
+ else {
7135
+ // has footer
7136
+ const tabbableItems = findTabbableElements(this.footerRef, SelectFooterTabbableItems);
7137
+ const currentElementIndex = tabbableItems.findIndex((item) => item === document.activeElement);
7138
+ if (this.inputRef.current === document.activeElement) {
7139
+ if (shiftKey) {
7140
+ // close toggle if shift key and tab on input
7141
+ this.onToggle(false);
7142
+ }
7143
+ else {
7144
+ // tab to first tabbable item in footer
7145
+ if (tabbableItems[0]) {
7146
+ tabbableItems[0].focus();
7147
+ }
7148
+ else {
7149
+ this.onToggle(false);
7150
+ }
7151
+ }
7152
+ }
7153
+ else {
7154
+ // focus is in footer
7155
+ if (shiftKey) {
7156
+ if (currentElementIndex === 0) {
7157
+ // shift tab back to input
7158
+ this.inputRef.current.focus();
7159
+ }
7160
+ else {
7161
+ // shift to previous footer item
7162
+ tabbableItems[currentElementIndex - 1].focus();
7163
+ }
7164
+ }
7165
+ else {
7166
+ // tab to next footer item or close tab if last item
7167
+ if (tabbableItems[currentElementIndex + 1]) {
7168
+ tabbableItems[currentElementIndex + 1].focus();
7169
+ }
7170
+ else {
7171
+ // no next item, close toggle
7172
+ this.onToggle(false);
7173
+ this.inputRef.current.focus();
7174
+ }
7175
+ }
7176
+ }
7177
+ }
7027
7178
  }
7028
7179
  }
7029
7180
  else if (!tabbedIntoFavoritesMenu) {
@@ -7180,13 +7331,13 @@
7180
7331
  /* eslint-disable @typescript-eslint/no-unused-vars */
7181
7332
  onFilter,
7182
7333
  /* eslint-disable @typescript-eslint/no-unused-vars */
7183
- onTypeaheadInputChanged, onCreateOption, isCreatable, onToggle, createText, noResultsFoundText, customBadgeText, inputIdPrefix,
7334
+ onTypeaheadInputChanged, onCreateOption, isCreatable, onToggle, createText, noResultsFoundText, customBadgeText, inputIdPrefix, inputAutoComplete,
7184
7335
  /* eslint-disable @typescript-eslint/no-unused-vars */
7185
7336
  isInputValuePersisted, isInputFilterPersisted,
7186
7337
  /* eslint-enable @typescript-eslint/no-unused-vars */
7187
7338
  menuAppendTo, favorites, onFavorite,
7188
7339
  /* eslint-disable @typescript-eslint/no-unused-vars */
7189
- favoritesLabel, footer, loadingVariant, isCreateSelectOptionObject } = _a, props = __rest$1(_a, ["children", "chipGroupProps", "chipGroupComponent", "className", "customContent", "variant", "direction", "onSelect", "onClear", "toggleId", "isOpen", "isGrouped", "isPlain", "isDisabled", "hasPlaceholderStyle", "validated", "selections", "typeAheadAriaLabel", "clearSelectionsAriaLabel", "toggleAriaLabel", "removeSelectionAriaLabel", 'aria-label', 'aria-labelledby', 'aria-describedby', 'aria-invalid', "placeholderText", "width", "maxHeight", "toggleIcon", "ouiaId", "ouiaSafe", "hasInlineFilter", "isCheckboxSelectionBadgeHidden", "inlineFilterPlaceholderText", "onFilter", "onTypeaheadInputChanged", "onCreateOption", "isCreatable", "onToggle", "createText", "noResultsFoundText", "customBadgeText", "inputIdPrefix", "isInputValuePersisted", "isInputFilterPersisted", "menuAppendTo", "favorites", "onFavorite", "favoritesLabel", "footer", "loadingVariant", "isCreateSelectOptionObject"]);
7340
+ favoritesLabel, footer, loadingVariant, isCreateSelectOptionObject } = _a, props = __rest$1(_a, ["children", "chipGroupProps", "chipGroupComponent", "className", "customContent", "variant", "direction", "onSelect", "onClear", "toggleId", "isOpen", "isGrouped", "isPlain", "isDisabled", "hasPlaceholderStyle", "validated", "selections", "typeAheadAriaLabel", "clearSelectionsAriaLabel", "toggleAriaLabel", "removeSelectionAriaLabel", 'aria-label', 'aria-labelledby', 'aria-describedby', 'aria-invalid', "placeholderText", "width", "maxHeight", "toggleIcon", "ouiaId", "ouiaSafe", "hasInlineFilter", "isCheckboxSelectionBadgeHidden", "inlineFilterPlaceholderText", "onFilter", "onTypeaheadInputChanged", "onCreateOption", "isCreatable", "onToggle", "createText", "noResultsFoundText", "customBadgeText", "inputIdPrefix", "inputAutoComplete", "isInputValuePersisted", "isInputFilterPersisted", "menuAppendTo", "favorites", "onFavorite", "favoritesLabel", "footer", "loadingVariant", "isCreateSelectOptionObject"]);
7190
7341
  const { focusFirstOption: openedOnEnter, typeaheadCurrIndex, typeaheadInputValue, typeaheadFilteredChildren, favoritesGroup } = this.state;
7191
7342
  const selectToggleId = toggleId || `pf-select-toggle-id-${currentId$1++}`;
7192
7343
  const selections = Array.isArray(selectionsProp) ? selectionsProp : [selectionsProp];
@@ -7224,11 +7375,11 @@
7224
7375
  if (isOpen) {
7225
7376
  if (renderableItems.find(item => { var _a; return ((_a = item) === null || _a === void 0 ? void 0 : _a.key) === 'loading'; }) === undefined) {
7226
7377
  if (loadingVariant === 'spinner') {
7227
- renderableItems.push(React__namespace.createElement(SelectOption, { isLoading: true, key: "loading", value: "loading", isGrouped: true },
7378
+ renderableItems.push(React__namespace.createElement(SelectOption, { isLoading: true, key: "loading", value: "loading" },
7228
7379
  React__namespace.createElement(Spinner, { size: "lg" })));
7229
7380
  }
7230
7381
  else if (loadingVariant === null || loadingVariant === void 0 ? void 0 : loadingVariant.text) {
7231
- renderableItems.push(React__namespace.createElement(SelectOption, { isLoad: true, key: "loading", value: loadingVariant.text, isGrouped: true, setViewMoreNextIndex: this.setVieMoreNextIndex, onClick: loadingVariant === null || loadingVariant === void 0 ? void 0 : loadingVariant.onClick }));
7382
+ renderableItems.push(React__namespace.createElement(SelectOption, { isLoad: true, key: "loading", value: loadingVariant.text, setViewMoreNextIndex: this.setVieMoreNextIndex, onClick: loadingVariant === null || loadingVariant === void 0 ? void 0 : loadingVariant.onClick }));
7232
7383
  }
7233
7384
  }
7234
7385
  }
@@ -7267,6 +7418,23 @@
7267
7418
  this.handleMenuKeys(0, 0, 'right');
7268
7419
  event.preventDefault();
7269
7420
  }
7421
+ else if (event.key === KeyTypes.Tab && variant !== exports.SelectVariant.checkbox && this.props.footer) {
7422
+ // tab to footer or close menu if shift key
7423
+ if (event.shiftKey) {
7424
+ this.onToggle(false);
7425
+ }
7426
+ else {
7427
+ const tabbableItems = findTabbableElements(this.footerRef, SelectFooterTabbableItems);
7428
+ if (tabbableItems.length > 0) {
7429
+ tabbableItems[0].focus();
7430
+ event.stopPropagation();
7431
+ event.preventDefault();
7432
+ }
7433
+ else {
7434
+ this.onToggle(false);
7435
+ }
7436
+ }
7437
+ }
7270
7438
  else if (event.key === KeyTypes.Tab && variant === exports.SelectVariant.checkbox) {
7271
7439
  // More modal-like experience for checkboxes
7272
7440
  // Let SelectOption handle this
@@ -7279,7 +7447,7 @@
7279
7447
  event.stopPropagation();
7280
7448
  event.preventDefault();
7281
7449
  }
7282
- }, ref: this.filterRef, autoComplete: "never" })),
7450
+ }, ref: this.filterRef, autoComplete: inputAutoComplete })),
7283
7451
  React__namespace.createElement(Divider, { key: "inline-filter-divider" })));
7284
7452
  renderableItems = [filterBox, ...typeaheadFilteredChildren].map((option, index) => React__namespace.cloneElement(option, { key: index }));
7285
7453
  }
@@ -7341,7 +7509,7 @@
7341
7509
  " ") : innerMenu;
7342
7510
  const popperContainer = (React__namespace.createElement("div", Object.assign({ className: css(_default$12.select, isOpen && _default$12.modifiers.expanded, validated === exports.ValidatedOptions.success && _default$12.modifiers.success, validated === exports.ValidatedOptions.warning && _default$12.modifiers.warning, validated === exports.ValidatedOptions.error && _default$12.modifiers.invalid, direction === exports.SelectDirection.up && _default$12.modifiers.top, className) }, (width && { style: { width } }), (validated !== exports.ValidatedOptions.default && { 'aria-describedby': ariaDescribedby }), (validated !== exports.ValidatedOptions.default && { 'aria-invalid': ariaInvalid })), isOpen && menuContainer));
7343
7511
  const mainContainer = (React__namespace.createElement("div", Object.assign({ className: css(_default$12.select, isOpen && _default$12.modifiers.expanded, validated === exports.ValidatedOptions.success && _default$12.modifiers.success, validated === exports.ValidatedOptions.warning && _default$12.modifiers.warning, validated === exports.ValidatedOptions.error && _default$12.modifiers.invalid, direction === exports.SelectDirection.up && _default$12.modifiers.top, className), ref: this.parentRef }, getOUIAProps(Select.displayName, ouiaId !== undefined ? ouiaId : this.state.ouiaStateId, ouiaSafe), (width && { style: { width } }), (validated !== exports.ValidatedOptions.default && { 'aria-describedby': ariaDescribedby }), (validated !== exports.ValidatedOptions.default && { 'aria-invalid': ariaInvalid })),
7344
- React__namespace.createElement(SelectToggle, Object.assign({ id: selectToggleId, parentRef: this.parentRef, menuRef: this.menuComponentRef }, (footer && { footerRef: this.footerRef }), { isOpen: isOpen, isPlain: isPlain, hasPlaceholderStyle: hasPlaceholderStyle && (!selections.length || selections[0] === null || isSelectedPlaceholder), onToggle: this.onToggle, onEnter: this.onEnter, onClose: this.onClose, variant: variant, "aria-labelledby": `${ariaLabelledBy || ''} ${selectToggleId}`, "aria-label": toggleAriaLabel, handleTypeaheadKeys: this.handleTypeaheadKeys, isDisabled: isDisabled, hasClearButton: hasOnClear, hasFooter: footer !== undefined, onClickTypeaheadToggleButton: this.onClickTypeaheadToggleButton }),
7512
+ React__namespace.createElement(SelectToggle, Object.assign({ id: selectToggleId, parentRef: this.parentRef, menuRef: this.menuComponentRef }, (footer && { footerRef: this.footerRef }), { isOpen: isOpen, isPlain: isPlain, hasPlaceholderStyle: hasPlaceholderStyle && (!selections.length || selections[0] === null || isSelectedPlaceholder), onToggle: this.onToggle, onEnter: this.onEnter, onClose: this.onClose, variant: variant, "aria-labelledby": `${ariaLabelledBy || ''} ${selectToggleId}`, "aria-label": toggleAriaLabel, handleTypeaheadKeys: this.handleTypeaheadKeys, moveFocusToLastMenuItem: this.moveFocusToLastMenuItem, isDisabled: isDisabled, hasClearButton: hasOnClear, hasFooter: footer !== undefined, onClickTypeaheadToggleButton: this.onClickTypeaheadToggleButton }),
7345
7513
  customContent && (React__namespace.createElement("div", { className: css(_default$12.selectToggleWrapper) },
7346
7514
  toggleIcon && React__namespace.createElement("span", { className: css(_default$12.selectToggleIcon) }, toggleIcon),
7347
7515
  React__namespace.createElement("span", { className: css(_default$12.selectToggleText) }, placeholderText))),
@@ -7362,13 +7530,13 @@
7362
7530
  toggleIcon && React__namespace.createElement("span", { className: css(_default$12.selectToggleIcon) }, toggleIcon),
7363
7531
  React__namespace.createElement("input", { className: css(_default$1b.formControl, _default$12.selectToggleTypeahead), "aria-activedescendant": typeaheadActiveChild && typeaheadActiveChild.id, id: `${selectToggleId}-select-typeahead`, "aria-label": typeAheadAriaLabel, placeholder: placeholderText, value: typeaheadInputValue !== null
7364
7532
  ? typeaheadInputValue
7365
- : this.getDisplay(selections[0], 'text') || '', type: "text", onClick: this.onClick, onChange: this.onChange, autoComplete: "never", disabled: isDisabled, ref: this.inputRef })),
7533
+ : this.getDisplay(selections[0], 'text') || '', type: "text", onClick: this.onClick, onChange: this.onChange, autoComplete: inputAutoComplete, disabled: isDisabled, ref: this.inputRef })),
7366
7534
  hasOnClear && (selections[0] || typeaheadInputValue) && clearBtn)),
7367
7535
  variant === exports.SelectVariant.typeaheadMulti && !customContent && (React__namespace.createElement(React__namespace.Fragment, null,
7368
7536
  React__namespace.createElement("div", { className: css(_default$12.selectToggleWrapper) },
7369
7537
  toggleIcon && React__namespace.createElement("span", { className: css(_default$12.selectToggleIcon) }, toggleIcon),
7370
7538
  selections && Array.isArray(selections) && selections.length > 0 && selectedChips,
7371
- React__namespace.createElement("input", { className: css(_default$1b.formControl, _default$12.selectToggleTypeahead), "aria-activedescendant": typeaheadActiveChild && typeaheadActiveChild.id, id: `${selectToggleId}-select-multi-typeahead-typeahead`, "aria-label": typeAheadAriaLabel, "aria-invalid": validated === exports.ValidatedOptions.error, placeholder: placeholderText, value: typeaheadInputValue !== null ? typeaheadInputValue : '', type: "text", onChange: this.onChange, onClick: this.onClick, autoComplete: "never", disabled: isDisabled, ref: this.inputRef })),
7539
+ React__namespace.createElement("input", { className: css(_default$1b.formControl, _default$12.selectToggleTypeahead), "aria-activedescendant": typeaheadActiveChild && typeaheadActiveChild.id, id: `${selectToggleId}-select-multi-typeahead-typeahead`, "aria-label": typeAheadAriaLabel, "aria-invalid": validated === exports.ValidatedOptions.error, placeholder: placeholderText, value: typeaheadInputValue !== null ? typeaheadInputValue : '', type: "text", onChange: this.onChange, onClick: this.onClick, autoComplete: inputAutoComplete, disabled: isDisabled, ref: this.inputRef })),
7372
7540
  hasOnClear && ((selections && selections.length > 0) || typeaheadInputValue) && clearBtn)),
7373
7541
  validated === exports.ValidatedOptions.success && (React__namespace.createElement("span", { className: css(_default$12.selectToggleStatusIcon) },
7374
7542
  React__namespace.createElement(CheckCircleIcon$1, { "aria-hidden": "true" }))),
@@ -7424,6 +7592,7 @@
7424
7592
  inlineFilterPlaceholderText: null,
7425
7593
  customBadgeText: null,
7426
7594
  inputIdPrefix: '',
7595
+ inputAutoComplete: navigator.userAgent.match('Chrome') ? getUniqueId('pf-no-autocomplete') : 'off',
7427
7596
  menuAppendTo: 'inline',
7428
7597
  favorites: [],
7429
7598
  favoritesLabel: 'Favorites',
@@ -17726,8 +17895,8 @@
17726
17895
  // process any tab content sections outside of the component
17727
17896
  if (tabContentRef) {
17728
17897
  React__namespace.Children.toArray(this.props.children)
17729
- .filter((child) => React__namespace.isValidElement(child))
17730
- .filter(({ props }) => props.tabContentRef && props.tabContentRef.current)
17898
+ .map(child => child)
17899
+ .filter(child => child.props && child.props.tabContentRef && child.props.tabContentRef.current)
17731
17900
  .forEach(child => (child.props.tabContentRef.current.hidden = true));
17732
17901
  // most recently selected tabContent
17733
17902
  if (tabContentRef.current) {
@@ -17770,7 +17939,7 @@
17770
17939
  const _a = this.props, { className, children, activeKey, defaultActiveKey, id, isFilled, isSecondary, isVertical, isBox, leftScrollAriaLabel, rightScrollAriaLabel, 'aria-label': ariaLabel, component, ouiaId, ouiaSafe, mountOnEnter, unmountOnExit, usePageInsets, inset, variant, expandable, isExpanded, defaultIsExpanded, toggleText, toggleAriaLabel, onToggle } = _a, props = __rest$1(_a, ["className", "children", "activeKey", "defaultActiveKey", "id", "isFilled", "isSecondary", "isVertical", "isBox", "leftScrollAriaLabel", "rightScrollAriaLabel", 'aria-label', "component", "ouiaId", "ouiaSafe", "mountOnEnter", "unmountOnExit", "usePageInsets", "inset", "variant", "expandable", "isExpanded", "defaultIsExpanded", "toggleText", "toggleAriaLabel", "onToggle"]);
17771
17940
  const { showScrollButtons, disableLeftScrollButton, disableRightScrollButton, shownKeys, uncontrolledActiveKey, uncontrolledIsExpandedLocal } = this.state;
17772
17941
  const filteredChildren = React__namespace.Children.toArray(children)
17773
- .filter((child) => React__namespace.isValidElement(child))
17942
+ .filter(Boolean)
17774
17943
  .filter(child => !child.props.isHidden);
17775
17944
  const uniqueId = id || getUniqueId();
17776
17945
  const Component = component === exports.TabsComponent.nav ? 'nav' : 'div';
@@ -21152,6 +21321,7 @@
21152
21321
  exports.Select = Select;
21153
21322
  exports.SelectConsumer = SelectConsumer;
21154
21323
  exports.SelectContext = SelectContext;
21324
+ exports.SelectFooterTabbableItems = SelectFooterTabbableItems;
21155
21325
  exports.SelectGroup = SelectGroup;
21156
21326
  exports.SelectOption = SelectOption;
21157
21327
  exports.SelectProvider = SelectProvider;
@@ -21227,6 +21397,7 @@
21227
21397
  exports.clipboardCopyFunc = clipboardCopyFunc;
21228
21398
  exports.debounce = debounce$1;
21229
21399
  exports.fillTemplate = fillTemplate;
21400
+ exports.findTabbableElements = findTabbableElements;
21230
21401
  exports.formatBreakpointMods = formatBreakpointMods;
21231
21402
  exports.getBreakpoint = getBreakpoint;
21232
21403
  exports.getDefaultOUIAId = getDefaultOUIAId;