@patternfly/react-table 4.61.6 → 4.61.10

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 (27) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/esm/components/Table/base/provider.d.ts +1 -1
  3. package/dist/esm/components/Table/base/types.d.ts +1 -1
  4. package/dist/esm/components/Table/utils/decorators/cellActions.js +1 -1
  5. package/dist/esm/components/Table/utils/decorators/cellActions.js.map +1 -1
  6. package/dist/esm/components/TableComposable/Td.d.ts +3 -1
  7. package/dist/esm/components/TableComposable/Td.d.ts.map +1 -1
  8. package/dist/esm/components/TableComposable/Td.js +2 -2
  9. package/dist/esm/components/TableComposable/Td.js.map +1 -1
  10. package/dist/js/components/Table/base/provider.d.ts +1 -1
  11. package/dist/js/components/Table/base/types.d.ts +1 -1
  12. package/dist/js/components/Table/utils/decorators/cellActions.js +1 -1
  13. package/dist/js/components/Table/utils/decorators/cellActions.js.map +1 -1
  14. package/dist/js/components/TableComposable/Td.d.ts +3 -1
  15. package/dist/js/components/TableComposable/Td.d.ts.map +1 -1
  16. package/dist/js/components/TableComposable/Td.js +2 -2
  17. package/dist/js/components/TableComposable/Td.js.map +1 -1
  18. package/dist/umd/react-table.css +227 -167
  19. package/dist/umd/react-table.js +249 -61
  20. package/dist/umd/react-table.min.css +561 -501
  21. package/dist/umd/react-table.min.js +3 -3
  22. package/package.json +6 -6
  23. package/src/components/Table/__snapshots__/Table.test.tsx.snap +0 -76
  24. package/src/components/Table/examples/LegacyTableActions.tsx +32 -43
  25. package/src/components/Table/utils/decorators/cellActions.tsx +1 -1
  26. package/src/components/TableComposable/Td.tsx +4 -0
  27. package/src/components/TableComposable/examples/ComposableTableActions.tsx +25 -20
@@ -1076,6 +1076,18 @@
1076
1076
  }
1077
1077
  }
1078
1078
  }
1079
+ /** This function returns a list of tabbable items in a container
1080
+ *
1081
+ * @param {any} containerRef to the container
1082
+ * @param {string} tababbleSelectors CSS selector string of tabbable items
1083
+ */
1084
+ function findTabbableElements(containerRef, tababbleSelectors) {
1085
+ const tabbable = containerRef.current.querySelectorAll(tababbleSelectors);
1086
+ const list = Array.prototype.filter.call(tabbable, function (item) {
1087
+ return item.tabIndex >= '0';
1088
+ });
1089
+ return list;
1090
+ }
1079
1091
  /** This function is a helper for keyboard navigation through dropdowns.
1080
1092
  *
1081
1093
  * @param {number} index The index of the element you're on
@@ -1113,13 +1125,32 @@
1113
1125
  * @param {object} mods The modifiers object
1114
1126
  * @param {any} styles The appropriate styles object for the component
1115
1127
  */
1116
- const formatBreakpointMods = (mods, styles, stylePrefix = '') => Object.entries(mods || {})
1117
- .map(([breakpoint, mod]) => `${stylePrefix}${mod}${breakpoint !== 'default' ? `-on-${breakpoint}` : ''}`)
1118
- .map(toCamel$1)
1119
- .map(mod => mod.replace(/-?(\dxl)/gi, (_res, group) => `_${group}`))
1120
- .map(modifierKey => styles.modifiers[modifierKey])
1121
- .filter(Boolean)
1122
- .join(' ');
1128
+ const formatBreakpointMods = (mods, styles, stylePrefix = '', breakpoint) => {
1129
+ if (!mods) {
1130
+ return '';
1131
+ }
1132
+ if (breakpoint) {
1133
+ if (breakpoint in mods) {
1134
+ return styles.modifiers[toCamel$1(`${stylePrefix}${mods[breakpoint]}`)];
1135
+ }
1136
+ // the current breakpoint is not specified in mods, so we try to find the next nearest
1137
+ const breakpointsOrder = ['2xl', 'xl', 'lg', 'md', 'sm', 'default'];
1138
+ const breakpointsIndex = breakpointsOrder.indexOf(breakpoint);
1139
+ for (let i = breakpointsIndex; i < breakpointsOrder.length; i++) {
1140
+ if (breakpointsOrder[i] in mods) {
1141
+ return styles.modifiers[toCamel$1(`${stylePrefix}${mods[breakpointsOrder[i]]}`)];
1142
+ }
1143
+ }
1144
+ return '';
1145
+ }
1146
+ return Object.entries(mods || {})
1147
+ .map(([breakpoint, mod]) => `${stylePrefix}${mod}${breakpoint !== 'default' ? `-on-${breakpoint}` : ''}`)
1148
+ .map(toCamel$1)
1149
+ .map(mod => mod.replace(/-?(\dxl)/gi, (_res, group) => `_${group}`))
1150
+ .map(modifierKey => styles.modifiers[modifierKey])
1151
+ .filter(Boolean)
1152
+ .join(' ');
1153
+ };
1123
1154
  const camelize$1 = (s) => s
1124
1155
  .toUpperCase()
1125
1156
  .replace('-', '')
@@ -4841,6 +4872,7 @@
4841
4872
  ArrowLeft: 'ArrowLeft',
4842
4873
  ArrowRight: 'ArrowRight'
4843
4874
  };
4875
+ const SelectFooterTabbableItems = 'input, button, select, textarea, a[href]';
4844
4876
 
4845
4877
  class SelectOption extends React__namespace.Component {
4846
4878
  constructor() {
@@ -4866,7 +4898,12 @@
4866
4898
  event.stopPropagation();
4867
4899
  }
4868
4900
  else {
4869
- keyHandler(index, innerIndex, 'tab');
4901
+ if (event.shiftKey) {
4902
+ keyHandler(index, innerIndex, 'up');
4903
+ }
4904
+ else {
4905
+ keyHandler(index, innerIndex, 'tab');
4906
+ }
4870
4907
  }
4871
4908
  }
4872
4909
  event.preventDefault();
@@ -5103,7 +5140,8 @@
5103
5140
  isChecked: this.checkForValue(option.props.value, checked),
5104
5141
  sendRef,
5105
5142
  keyHandler,
5106
- index: index++
5143
+ index: index++,
5144
+ isLastOptionBeforeFooter
5107
5145
  })))) : null
5108
5146
  });
5109
5147
  });
@@ -5186,26 +5224,19 @@
5186
5224
  onClose();
5187
5225
  }
5188
5226
  };
5189
- this.findTabbableFooterElements = () => {
5190
- const tabbable = this.props.footerRef.current.querySelectorAll('input, button, select, textarea, a[href]');
5191
- const list = Array.prototype.filter.call(tabbable, function (item) {
5192
- return item.tabIndex >= '0';
5193
- });
5194
- return list;
5195
- };
5196
5227
  this.handleGlobalKeys = (event) => {
5197
- const { parentRef, menuRef, hasFooter, isOpen, variant, onToggle, onClose } = this.props;
5228
+ const { parentRef, menuRef, hasFooter, footerRef, isOpen, variant, onToggle, onClose, moveFocusToLastMenuItem } = this.props;
5198
5229
  const escFromToggle = parentRef && parentRef.current && parentRef.current.contains(event.target);
5199
5230
  const escFromWithinMenu = menuRef && menuRef.current && menuRef.current.contains && menuRef.current.contains(event.target);
5200
5231
  if (isOpen &&
5201
5232
  event.key === KeyTypes.Tab &&
5202
5233
  (variant === SelectVariant.typeahead || variant === SelectVariant.typeaheadMulti)) {
5203
- this.props.handleTypeaheadKeys('tab');
5234
+ this.props.handleTypeaheadKeys('tab', event.shiftKey);
5204
5235
  event.preventDefault();
5205
5236
  return;
5206
5237
  }
5207
5238
  if (isOpen && event.key === KeyTypes.Tab && hasFooter) {
5208
- const tabbableItems = this.findTabbableFooterElements();
5239
+ const tabbableItems = findTabbableElements(footerRef, SelectFooterTabbableItems);
5209
5240
  // If no tabbable item in footer close select
5210
5241
  if (tabbableItems.length <= 0) {
5211
5242
  onToggle(false);
@@ -5214,14 +5245,30 @@
5214
5245
  return;
5215
5246
  }
5216
5247
  else {
5217
- // if current element is not in footer, tab to first tabbable element in footer
5218
- const currentElementIndex = tabbableItems.findIndex(item => item === document.activeElement);
5248
+ // if current element is not in footer, tab to first tabbable element in footer, or close if shift clicked
5249
+ const currentElementIndex = tabbableItems.findIndex((item) => item === document.activeElement);
5219
5250
  if (currentElementIndex === -1) {
5220
- tabbableItems[0].focus();
5221
- return;
5251
+ if (event.shiftKey) {
5252
+ if (variant !== 'checkbox') {
5253
+ // only close non checkbox variation on shift clicked
5254
+ onToggle(false);
5255
+ onClose();
5256
+ this.toggle.current.focus();
5257
+ }
5258
+ }
5259
+ else {
5260
+ // tab to footer
5261
+ tabbableItems[0].focus();
5262
+ return;
5263
+ }
5222
5264
  }
5223
5265
  // Current element is in footer.
5224
5266
  if (event.shiftKey) {
5267
+ // Move focus back to menuif current tab index is 0
5268
+ if (currentElementIndex === 0) {
5269
+ moveFocusToLastMenuItem();
5270
+ event.preventDefault();
5271
+ }
5225
5272
  return;
5226
5273
  }
5227
5274
  // Tab to next element in footer or close if there are none
@@ -5295,7 +5342,7 @@
5295
5342
  }
5296
5343
  render() {
5297
5344
  /* eslint-disable @typescript-eslint/no-unused-vars */
5298
- 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"]);
5345
+ 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"]);
5299
5346
  /* eslint-enable @typescript-eslint/no-unused-vars */
5300
5347
  const isTypeahead = variant === SelectVariant.typeahead || variant === SelectVariant.typeaheadMulti || hasClearButton;
5301
5348
  const toggleProps = {
@@ -5758,9 +5805,37 @@
5758
5805
  typeaheadInputValue
5759
5806
  }));
5760
5807
  };
5761
- this.handleTypeaheadKeys = (position) => {
5808
+ this.switchFocusToFavoriteMenu = () => {
5809
+ const { typeaheadCurrIndex, typeaheadStoredIndex } = this.state;
5810
+ let indexForFocus = 0;
5811
+ if (typeaheadCurrIndex !== -1) {
5812
+ indexForFocus = typeaheadCurrIndex;
5813
+ }
5814
+ else if (typeaheadStoredIndex !== -1) {
5815
+ indexForFocus = typeaheadStoredIndex;
5816
+ }
5817
+ if (this.refCollection[indexForFocus] !== null && this.refCollection[indexForFocus][0] !== null) {
5818
+ this.refCollection[indexForFocus][0].focus();
5819
+ }
5820
+ else {
5821
+ this.clearRef.current.focus();
5822
+ }
5823
+ this.setState({
5824
+ tabbedIntoFavoritesMenu: true,
5825
+ typeaheadCurrIndex: -1
5826
+ });
5827
+ };
5828
+ this.moveFocusToLastMenuItem = () => {
5829
+ const refCollectionLen = this.refCollection.length;
5830
+ if (refCollectionLen > 0 &&
5831
+ this.refCollection[refCollectionLen - 1] !== null &&
5832
+ this.refCollection[refCollectionLen - 1][0] !== null) {
5833
+ this.refCollection[refCollectionLen - 1][0].focus();
5834
+ }
5835
+ };
5836
+ this.handleTypeaheadKeys = (position, shiftKey = false) => {
5762
5837
  const { isOpen, onFavorite } = this.props;
5763
- const { typeaheadCurrIndex, tabbedIntoFavoritesMenu, typeaheadStoredIndex } = this.state;
5838
+ const { typeaheadCurrIndex, tabbedIntoFavoritesMenu } = this.state;
5764
5839
  const typeaheadActiveChild = this.getTypeaheadActiveChild(typeaheadCurrIndex);
5765
5840
  if (isOpen) {
5766
5841
  if (position === 'enter') {
@@ -5778,32 +5853,127 @@
5778
5853
  }
5779
5854
  else if (position === 'tab') {
5780
5855
  if (onFavorite) {
5856
+ // if the input has focus, tab to the first item or the last item that was previously focused.
5781
5857
  if (this.inputRef.current === document.activeElement) {
5782
- let indexForFocus = 0;
5783
- if (typeaheadCurrIndex !== -1) {
5784
- indexForFocus = typeaheadCurrIndex;
5785
- }
5786
- else if (typeaheadStoredIndex !== -1) {
5787
- indexForFocus = typeaheadStoredIndex;
5788
- }
5789
- if (this.refCollection[indexForFocus] !== null && this.refCollection[indexForFocus][0] !== null) {
5790
- this.refCollection[indexForFocus][0].focus();
5858
+ // If shift is also clicked and there is a footer, tab to the last item in tabbable footer
5859
+ if (this.props.footer && shiftKey) {
5860
+ const tabbableItems = findTabbableElements(this.footerRef, SelectFooterTabbableItems);
5861
+ if (tabbableItems.length > 0) {
5862
+ if (tabbableItems[tabbableItems.length - 1]) {
5863
+ tabbableItems[tabbableItems.length - 1].focus();
5864
+ }
5865
+ }
5791
5866
  }
5792
5867
  else {
5793
- this.clearRef.current.focus();
5868
+ this.switchFocusToFavoriteMenu();
5794
5869
  }
5795
- this.setState({
5796
- tabbedIntoFavoritesMenu: true,
5797
- typeaheadCurrIndex: -1
5798
- });
5799
5870
  }
5800
5871
  else {
5801
- this.inputRef.current.focus();
5802
- this.setState({ tabbedIntoFavoritesMenu: false });
5872
+ // focus is on menu or footer
5873
+ if (this.props.footer) {
5874
+ let tabbedIntoMenu = false;
5875
+ const tabbableItems = findTabbableElements(this.footerRef, SelectFooterTabbableItems);
5876
+ if (tabbableItems.length > 0) {
5877
+ // if current element is not in footer, tab to first tabbable element in footer,
5878
+ // if shift was clicked, tab to input since focus is on menu
5879
+ const currentElementIndex = tabbableItems.findIndex((item) => item === document.activeElement);
5880
+ if (currentElementIndex === -1) {
5881
+ if (shiftKey) {
5882
+ // currently in menu, shift back to input
5883
+ this.inputRef.current.focus();
5884
+ }
5885
+ else {
5886
+ // currently in menu, tab to first tabbable item in footer
5887
+ tabbableItems[0].focus();
5888
+ }
5889
+ }
5890
+ else {
5891
+ // already in footer
5892
+ if (shiftKey) {
5893
+ // shift to previous item
5894
+ if (currentElementIndex === 0) {
5895
+ // on first footer item, shift back to menu
5896
+ this.switchFocusToFavoriteMenu();
5897
+ tabbedIntoMenu = true;
5898
+ }
5899
+ else {
5900
+ // shift to previous footer item
5901
+ tabbableItems[currentElementIndex - 1].focus();
5902
+ }
5903
+ }
5904
+ else {
5905
+ // tab to next tabbable item in footer or to input.
5906
+ if (tabbableItems[currentElementIndex + 1]) {
5907
+ tabbableItems[currentElementIndex + 1].focus();
5908
+ }
5909
+ else {
5910
+ this.inputRef.current.focus();
5911
+ }
5912
+ }
5913
+ }
5914
+ }
5915
+ else {
5916
+ // no tabbable items in footer, tab to input
5917
+ this.inputRef.current.focus();
5918
+ tabbedIntoMenu = false;
5919
+ }
5920
+ this.setState({ tabbedIntoFavoritesMenu: tabbedIntoMenu });
5921
+ }
5922
+ else {
5923
+ this.inputRef.current.focus();
5924
+ this.setState({ tabbedIntoFavoritesMenu: false });
5925
+ }
5803
5926
  }
5804
5927
  }
5805
5928
  else {
5806
- this.onToggle(false);
5929
+ // Close if there is no footer
5930
+ if (!this.props.footer) {
5931
+ this.onToggle(false);
5932
+ }
5933
+ else {
5934
+ // has footer
5935
+ const tabbableItems = findTabbableElements(this.footerRef, SelectFooterTabbableItems);
5936
+ const currentElementIndex = tabbableItems.findIndex((item) => item === document.activeElement);
5937
+ if (this.inputRef.current === document.activeElement) {
5938
+ if (shiftKey) {
5939
+ // close toggle if shift key and tab on input
5940
+ this.onToggle(false);
5941
+ }
5942
+ else {
5943
+ // tab to first tabbable item in footer
5944
+ if (tabbableItems[0]) {
5945
+ tabbableItems[0].focus();
5946
+ }
5947
+ else {
5948
+ this.onToggle(false);
5949
+ }
5950
+ }
5951
+ }
5952
+ else {
5953
+ // focus is in footer
5954
+ if (shiftKey) {
5955
+ if (currentElementIndex === 0) {
5956
+ // shift tab back to input
5957
+ this.inputRef.current.focus();
5958
+ }
5959
+ else {
5960
+ // shift to previous footer item
5961
+ tabbableItems[currentElementIndex - 1].focus();
5962
+ }
5963
+ }
5964
+ else {
5965
+ // tab to next footer item or close tab if last item
5966
+ if (tabbableItems[currentElementIndex + 1]) {
5967
+ tabbableItems[currentElementIndex + 1].focus();
5968
+ }
5969
+ else {
5970
+ // no next item, close toggle
5971
+ this.onToggle(false);
5972
+ this.inputRef.current.focus();
5973
+ }
5974
+ }
5975
+ }
5976
+ }
5807
5977
  }
5808
5978
  }
5809
5979
  else if (!tabbedIntoFavoritesMenu) {
@@ -5960,13 +6130,13 @@
5960
6130
  /* eslint-disable @typescript-eslint/no-unused-vars */
5961
6131
  onFilter,
5962
6132
  /* eslint-disable @typescript-eslint/no-unused-vars */
5963
- onTypeaheadInputChanged, onCreateOption, isCreatable, onToggle, createText, noResultsFoundText, customBadgeText, inputIdPrefix,
6133
+ onTypeaheadInputChanged, onCreateOption, isCreatable, onToggle, createText, noResultsFoundText, customBadgeText, inputIdPrefix, inputAutoComplete,
5964
6134
  /* eslint-disable @typescript-eslint/no-unused-vars */
5965
6135
  isInputValuePersisted, isInputFilterPersisted,
5966
6136
  /* eslint-enable @typescript-eslint/no-unused-vars */
5967
6137
  menuAppendTo, favorites, onFavorite,
5968
6138
  /* eslint-disable @typescript-eslint/no-unused-vars */
5969
- 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"]);
6139
+ 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"]);
5970
6140
  const { focusFirstOption: openedOnEnter, typeaheadCurrIndex, typeaheadInputValue, typeaheadFilteredChildren, favoritesGroup } = this.state;
5971
6141
  const selectToggleId = toggleId || `pf-select-toggle-id-${currentId++}`;
5972
6142
  const selections = Array.isArray(selectionsProp) ? selectionsProp : [selectionsProp];
@@ -6004,11 +6174,11 @@
6004
6174
  if (isOpen) {
6005
6175
  if (renderableItems.find(item => { var _a; return ((_a = item) === null || _a === void 0 ? void 0 : _a.key) === 'loading'; }) === undefined) {
6006
6176
  if (loadingVariant === 'spinner') {
6007
- renderableItems.push(React__namespace.createElement(SelectOption, { isLoading: true, key: "loading", value: "loading", isGrouped: true },
6177
+ renderableItems.push(React__namespace.createElement(SelectOption, { isLoading: true, key: "loading", value: "loading" },
6008
6178
  React__namespace.createElement(Spinner, { size: "lg" })));
6009
6179
  }
6010
6180
  else if (loadingVariant === null || loadingVariant === void 0 ? void 0 : loadingVariant.text) {
6011
- 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 }));
6181
+ 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 }));
6012
6182
  }
6013
6183
  }
6014
6184
  }
@@ -6047,6 +6217,23 @@
6047
6217
  this.handleMenuKeys(0, 0, 'right');
6048
6218
  event.preventDefault();
6049
6219
  }
6220
+ else if (event.key === KeyTypes.Tab && variant !== SelectVariant.checkbox && this.props.footer) {
6221
+ // tab to footer or close menu if shift key
6222
+ if (event.shiftKey) {
6223
+ this.onToggle(false);
6224
+ }
6225
+ else {
6226
+ const tabbableItems = findTabbableElements(this.footerRef, SelectFooterTabbableItems);
6227
+ if (tabbableItems.length > 0) {
6228
+ tabbableItems[0].focus();
6229
+ event.stopPropagation();
6230
+ event.preventDefault();
6231
+ }
6232
+ else {
6233
+ this.onToggle(false);
6234
+ }
6235
+ }
6236
+ }
6050
6237
  else if (event.key === KeyTypes.Tab && variant === SelectVariant.checkbox) {
6051
6238
  // More modal-like experience for checkboxes
6052
6239
  // Let SelectOption handle this
@@ -6059,7 +6246,7 @@
6059
6246
  event.stopPropagation();
6060
6247
  event.preventDefault();
6061
6248
  }
6062
- }, ref: this.filterRef, autoComplete: "never" })),
6249
+ }, ref: this.filterRef, autoComplete: inputAutoComplete })),
6063
6250
  React__namespace.createElement(Divider, { key: "inline-filter-divider" })));
6064
6251
  renderableItems = [filterBox, ...typeaheadFilteredChildren].map((option, index) => React__namespace.cloneElement(option, { key: index }));
6065
6252
  }
@@ -6121,7 +6308,7 @@
6121
6308
  " ") : innerMenu;
6122
6309
  const popperContainer = (React__namespace.createElement("div", Object.assign({ className: css(_default$b.select, isOpen && _default$b.modifiers.expanded, validated === ValidatedOptions.success && _default$b.modifiers.success, validated === ValidatedOptions.warning && _default$b.modifiers.warning, validated === ValidatedOptions.error && _default$b.modifiers.invalid, direction === SelectDirection.up && _default$b.modifiers.top, className) }, (width && { style: { width } }), (validated !== ValidatedOptions.default && { 'aria-describedby': ariaDescribedby }), (validated !== ValidatedOptions.default && { 'aria-invalid': ariaInvalid })), isOpen && menuContainer));
6123
6310
  const mainContainer = (React__namespace.createElement("div", Object.assign({ className: css(_default$b.select, isOpen && _default$b.modifiers.expanded, validated === ValidatedOptions.success && _default$b.modifiers.success, validated === ValidatedOptions.warning && _default$b.modifiers.warning, validated === ValidatedOptions.error && _default$b.modifiers.invalid, direction === SelectDirection.up && _default$b.modifiers.top, className), ref: this.parentRef }, getOUIAProps(Select.displayName, ouiaId !== undefined ? ouiaId : this.state.ouiaStateId, ouiaSafe), (width && { style: { width } }), (validated !== ValidatedOptions.default && { 'aria-describedby': ariaDescribedby }), (validated !== ValidatedOptions.default && { 'aria-invalid': ariaInvalid })),
6124
- 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 }),
6311
+ 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 }),
6125
6312
  customContent && (React__namespace.createElement("div", { className: css(_default$b.selectToggleWrapper) },
6126
6313
  toggleIcon && React__namespace.createElement("span", { className: css(_default$b.selectToggleIcon) }, toggleIcon),
6127
6314
  React__namespace.createElement("span", { className: css(_default$b.selectToggleText) }, placeholderText))),
@@ -6142,13 +6329,13 @@
6142
6329
  toggleIcon && React__namespace.createElement("span", { className: css(_default$b.selectToggleIcon) }, toggleIcon),
6143
6330
  React__namespace.createElement("input", { className: css(_default$f.formControl, _default$b.selectToggleTypeahead), "aria-activedescendant": typeaheadActiveChild && typeaheadActiveChild.id, id: `${selectToggleId}-select-typeahead`, "aria-label": typeAheadAriaLabel, placeholder: placeholderText, value: typeaheadInputValue !== null
6144
6331
  ? typeaheadInputValue
6145
- : this.getDisplay(selections[0], 'text') || '', type: "text", onClick: this.onClick, onChange: this.onChange, autoComplete: "never", disabled: isDisabled, ref: this.inputRef })),
6332
+ : this.getDisplay(selections[0], 'text') || '', type: "text", onClick: this.onClick, onChange: this.onChange, autoComplete: inputAutoComplete, disabled: isDisabled, ref: this.inputRef })),
6146
6333
  hasOnClear && (selections[0] || typeaheadInputValue) && clearBtn)),
6147
6334
  variant === SelectVariant.typeaheadMulti && !customContent && (React__namespace.createElement(React__namespace.Fragment, null,
6148
6335
  React__namespace.createElement("div", { className: css(_default$b.selectToggleWrapper) },
6149
6336
  toggleIcon && React__namespace.createElement("span", { className: css(_default$b.selectToggleIcon) }, toggleIcon),
6150
6337
  selections && Array.isArray(selections) && selections.length > 0 && selectedChips,
6151
- React__namespace.createElement("input", { className: css(_default$f.formControl, _default$b.selectToggleTypeahead), "aria-activedescendant": typeaheadActiveChild && typeaheadActiveChild.id, id: `${selectToggleId}-select-multi-typeahead-typeahead`, "aria-label": typeAheadAriaLabel, "aria-invalid": validated === ValidatedOptions.error, placeholder: placeholderText, value: typeaheadInputValue !== null ? typeaheadInputValue : '', type: "text", onChange: this.onChange, onClick: this.onClick, autoComplete: "never", disabled: isDisabled, ref: this.inputRef })),
6338
+ React__namespace.createElement("input", { className: css(_default$f.formControl, _default$b.selectToggleTypeahead), "aria-activedescendant": typeaheadActiveChild && typeaheadActiveChild.id, id: `${selectToggleId}-select-multi-typeahead-typeahead`, "aria-label": typeAheadAriaLabel, "aria-invalid": validated === ValidatedOptions.error, placeholder: placeholderText, value: typeaheadInputValue !== null ? typeaheadInputValue : '', type: "text", onChange: this.onChange, onClick: this.onClick, autoComplete: inputAutoComplete, disabled: isDisabled, ref: this.inputRef })),
6152
6339
  hasOnClear && ((selections && selections.length > 0) || typeaheadInputValue) && clearBtn)),
6153
6340
  validated === ValidatedOptions.success && (React__namespace.createElement("span", { className: css(_default$b.selectToggleStatusIcon) },
6154
6341
  React__namespace.createElement(CheckCircleIcon$1, { "aria-hidden": "true" }))),
@@ -6204,6 +6391,7 @@
6204
6391
  inlineFilterPlaceholderText: null,
6205
6392
  customBadgeText: null,
6206
6393
  inputIdPrefix: '',
6394
+ inputAutoComplete: navigator.userAgent.match('Chrome') ? getUniqueId('pf-no-autocomplete') : 'off',
6207
6395
  menuAppendTo: 'inline',
6208
6396
  favorites: [],
6209
6397
  favoritesLabel: 'Favorites',
@@ -6623,6 +6811,13 @@
6623
6811
  };
6624
6812
  EmptyState.displayName = 'EmptyState';
6625
6813
 
6814
+ const Bullseye = (_a) => {
6815
+ var { children = null, className = '', component = 'div' } = _a, props = __rest$1(_a, ["children", "className", "component"]);
6816
+ const Component = component;
6817
+ return (React__namespace.createElement(Component, Object.assign({ className: css(_default$k.bullseye, className) }, props), children));
6818
+ };
6819
+ Bullseye.displayName = 'Bullseye';
6820
+
6626
6821
  var _default$4 = {
6627
6822
  "button": "pf-c-button",
6628
6823
  "inlineEdit": "pf-c-inline-edit",
@@ -6646,13 +6841,6 @@
6646
6841
  }
6647
6842
  };
6648
6843
 
6649
- const Bullseye = (_a) => {
6650
- var { children = null, className = '', component = 'div' } = _a, props = __rest$1(_a, ["children", "className", "component"]);
6651
- const Component = component;
6652
- return (React__namespace.createElement(Component, Object.assign({ className: css(_default$k.bullseye, className) }, props), children));
6653
- };
6654
- Bullseye.displayName = 'Bullseye';
6655
-
6656
6844
  var _default$3 = {
6657
6845
  "button": "pf-c-button",
6658
6846
  "modifiers": {
@@ -10001,7 +10189,7 @@
10001
10189
  children: (React__namespace.createElement(ActionsColumn, { items: resolvedActions, dropdownPosition: dropdownPosition, dropdownDirection: dropdownDirection, isDisabled: resolvedIsDisabled, rowData: rowData, extraData: extraData, actionsToggle: actionsToggle }, label))
10002
10190
  }
10003
10191
  : {};
10004
- return Object.assign({ className: css(_default$3.tableAction), style: { width: 'auto', paddingRight: 0 }, isVisible: true }, renderProps);
10192
+ return Object.assign({ className: css(_default$3.tableAction), style: { paddingRight: 0 }, isVisible: true }, renderProps);
10005
10193
  };
10006
10194
 
10007
10195
  const CollapseColumn = (_a) => {
@@ -10178,7 +10366,7 @@
10178
10366
  };
10179
10367
 
10180
10368
  const TdBase = (_a) => {
10181
- var { children, className, component = 'td', dataLabel, textCenter = false, modifier, select = null, actions = null, expand = null, treeRow: treeRowProp = null, compoundExpand: compoundExpandProp = null, noPadding, width, visibility, innerRef, favorites = null, draggableRow: draggableRowProp = null } = _a, props = __rest$2(_a, ["children", "className", "component", "dataLabel", "textCenter", "modifier", "select", "actions", "expand", "treeRow", "compoundExpand", "noPadding", "width", "visibility", "innerRef", "favorites", "draggableRow"]);
10369
+ var { children, className, isActionCell = false, component = 'td', dataLabel, textCenter = false, modifier, select = null, actions = null, expand = null, treeRow: treeRowProp = null, compoundExpand: compoundExpandProp = null, noPadding, width, visibility, innerRef, favorites = null, draggableRow: draggableRowProp = null } = _a, props = __rest$2(_a, ["children", "className", "isActionCell", "component", "dataLabel", "textCenter", "modifier", "select", "actions", "expand", "treeRow", "compoundExpand", "noPadding", "width", "visibility", "innerRef", "favorites", "draggableRow"]);
10182
10370
  const selectParams = select
10183
10371
  ? selectable(children, {
10184
10372
  rowIndex: select.rowIndex,
@@ -10280,7 +10468,7 @@
10280
10468
  isVisible = null, children: mergedChildren = null, className: mergedClassName = '', component: MergedComponent = component } = merged, mergedProps = __rest$2(merged, ["isVisible", "children", "className", "component"]);
10281
10469
  const treeTableTitleCell = (className && className.includes('pf-c-table__tree-view-title-cell')) ||
10282
10470
  (mergedClassName && mergedClassName.includes('pf-c-table__tree-view-title-cell'));
10283
- return (React__namespace.createElement(MergedComponent, Object.assign({}, (!treeTableTitleCell && { 'data-label': dataLabel }), { className: css(className, textCenter && _default$3.modifiers.center, noPadding && _default$3.modifiers.noPadding, _default$3.modifiers[modifier], draggableParams && _default$3.tableDraggable, mergedClassName), ref: innerRef }, mergedProps, props), mergedChildren || children));
10471
+ return (React__namespace.createElement(MergedComponent, Object.assign({}, (!treeTableTitleCell && { 'data-label': dataLabel }), { className: css(className, isActionCell && _default$3.tableAction, textCenter && _default$3.modifiers.center, noPadding && _default$3.modifiers.noPadding, _default$3.modifiers[modifier], draggableParams && _default$3.tableDraggable, mergedClassName), ref: innerRef }, mergedProps, props), mergedChildren || children));
10284
10472
  };
10285
10473
  const Td = React__namespace.forwardRef((props, ref) => (React__namespace.createElement(TdBase, Object.assign({}, props, { innerRef: ref }))));
10286
10474
  Td.displayName = 'Td';