@patternfly/react-table 4.44.16 → 4.47.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.
@@ -4358,6 +4358,11 @@
4358
4358
 
4359
4359
  var CaretDownIcon$1 = CaretDownIcon;
4360
4360
 
4361
+ const buttonVariantStyles = {
4362
+ default: '',
4363
+ primary: _default$e.modifiers.primary,
4364
+ secondary: _default$e.modifiers.secondary
4365
+ };
4361
4366
  class Toggle extends React__namespace.Component {
4362
4367
  constructor() {
4363
4368
  super(...arguments);
@@ -4416,12 +4421,12 @@
4416
4421
  };
4417
4422
  }
4418
4423
  render() {
4419
- const _a = this.props, { className, children, isOpen, isDisabled, isPlain, isPrimary, isSplitButton, onToggle, 'aria-haspopup': ariaHasPopup,
4424
+ const _a = this.props, { className, children, isOpen, isDisabled, isPlain, isPrimary, isSplitButton, toggleVariant, onToggle, 'aria-haspopup': ariaHasPopup,
4420
4425
  /* eslint-disable @typescript-eslint/no-unused-vars */
4421
4426
  isActive, bubbleEvent, onEnter, parentRef, getMenuRef,
4422
4427
  /* eslint-enable @typescript-eslint/no-unused-vars */
4423
- id, type } = _a, props = __rest$1(_a, ["className", "children", "isOpen", "isDisabled", "isPlain", "isPrimary", "isSplitButton", "onToggle", 'aria-haspopup', "isActive", "bubbleEvent", "onEnter", "parentRef", "getMenuRef", "id", "type"]);
4424
- return (React__namespace.createElement(DropdownContext.Consumer, null, ({ toggleClass }) => (React__namespace.createElement("button", Object.assign({}, props, { id: id, ref: this.buttonRef, className: css(isSplitButton ? _default$e.dropdownToggleButton : toggleClass || _default$e.dropdownToggle, isActive && _default$e.modifiers.active, isPlain && _default$e.modifiers.plain, isPrimary && _default$e.modifiers.primary, className), type: type || 'button', onClick: event => onToggle(!isOpen, event), "aria-expanded": isOpen, "aria-haspopup": ariaHasPopup, onKeyDown: event => this.onKeyDown(event), disabled: isDisabled }), children))));
4428
+ id, type } = _a, props = __rest$1(_a, ["className", "children", "isOpen", "isDisabled", "isPlain", "isPrimary", "isSplitButton", "toggleVariant", "onToggle", 'aria-haspopup', "isActive", "bubbleEvent", "onEnter", "parentRef", "getMenuRef", "id", "type"]);
4429
+ return (React__namespace.createElement(DropdownContext.Consumer, null, ({ toggleClass }) => (React__namespace.createElement("button", Object.assign({}, props, { id: id, ref: this.buttonRef, className: css(isSplitButton ? _default$e.dropdownToggleButton : toggleClass || _default$e.dropdownToggle, isActive && _default$e.modifiers.active, isPlain && _default$e.modifiers.plain, isPrimary && _default$e.modifiers.primary, buttonVariantStyles[toggleVariant], className), type: type || 'button', onClick: event => onToggle(!isOpen, event), "aria-expanded": isOpen, "aria-haspopup": ariaHasPopup, onKeyDown: event => this.onKeyDown(event), disabled: isDisabled }), children))));
4425
4430
  }
4426
4431
  }
4427
4432
  Toggle.displayName = 'Toggle';
@@ -5561,13 +5566,10 @@
5561
5566
  onToggle(isExpanded);
5562
5567
  };
5563
5568
  this.onClose = () => {
5564
- this.setState({
5565
- focusFirstOption: false,
5566
- typeaheadInputValue: null,
5567
- typeaheadFilteredChildren: React__namespace.Children.toArray(this.props.children),
5568
- typeaheadCurrIndex: -1,
5569
- tabbedIntoFavoritesMenu: false
5570
- });
5569
+ const { isInputFilterPersisted } = this.props;
5570
+ this.setState(Object.assign(Object.assign({ focusFirstOption: false, typeaheadInputValue: null }, (!isInputFilterPersisted && {
5571
+ typeaheadFilteredChildren: React__namespace.Children.toArray(this.props.children)
5572
+ })), { typeaheadCurrIndex: -1, tabbedIntoFavoritesMenu: false }));
5571
5573
  };
5572
5574
  this.onChange = (e) => {
5573
5575
  if (e.target.value.toString() !== '' && !this.props.isOpen) {
@@ -5922,11 +5924,11 @@
5922
5924
  /* eslint-disable @typescript-eslint/no-unused-vars */
5923
5925
  onTypeaheadInputChanged, onCreateOption, isCreatable, onToggle, createText, noResultsFoundText, customBadgeText, inputIdPrefix,
5924
5926
  /* eslint-disable @typescript-eslint/no-unused-vars */
5925
- isInputValuePersisted,
5927
+ isInputValuePersisted, isInputFilterPersisted,
5926
5928
  /* eslint-enable @typescript-eslint/no-unused-vars */
5927
5929
  menuAppendTo, favorites, onFavorite,
5928
5930
  /* eslint-disable @typescript-eslint/no-unused-vars */
5929
- 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", "menuAppendTo", "favorites", "onFavorite", "favoritesLabel", "footer", "loadingVariant", "isCreateSelectOptionObject"]);
5931
+ 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"]);
5930
5932
  const { focusFirstOption: openedOnEnter, typeaheadCurrIndex, typeaheadInputValue, typeaheadFilteredChildren, favoritesGroup } = this.state;
5931
5933
  const selectToggleId = toggleId || `pf-select-toggle-id-${currentId++}`;
5932
5934
  const selections = Array.isArray(selectionsProp) ? selectionsProp : [selectionsProp];
@@ -6170,6 +6172,7 @@
6170
6172
  ouiaSafe: true,
6171
6173
  chipGroupComponent: null,
6172
6174
  isInputValuePersisted: false,
6175
+ isInputFilterPersisted: false,
6173
6176
  isCreateSelectOptionObject: false
6174
6177
  };
6175
6178
 
@@ -6460,26 +6463,6 @@
6460
6463
  }
6461
6464
  }
6462
6465
  };
6463
- const onTriggerEnter = (event) => {
6464
- if (event.keyCode === KEY_CODES.ENTER) {
6465
- if (!visible) {
6466
- if (triggerManually) {
6467
- shouldOpen(show, event);
6468
- }
6469
- else {
6470
- show(true);
6471
- }
6472
- }
6473
- else {
6474
- if (triggerManually) {
6475
- shouldClose(null, hide, event);
6476
- }
6477
- else {
6478
- hide();
6479
- }
6480
- }
6481
- }
6482
- };
6483
6466
  const onTriggerClick = (event) => {
6484
6467
  if (triggerManually) {
6485
6468
  if (visible) {
@@ -6494,7 +6477,7 @@
6494
6477
  hide();
6495
6478
  }
6496
6479
  else {
6497
- show();
6480
+ show(true);
6498
6481
  }
6499
6482
  }
6500
6483
  };
@@ -6539,7 +6522,7 @@
6539
6522
  React__namespace.createElement(PopoverBody, { id: `popover-${uniqueId}-body` }, typeof bodyContent === 'function' ? bodyContent(hide) : bodyContent),
6540
6523
  footerContent && (React__namespace.createElement(PopoverFooter, { id: `popover-${uniqueId}-footer` }, typeof footerContent === 'function' ? footerContent(hide) : footerContent)))));
6541
6524
  return (React__namespace.createElement(PopoverContext.Provider, { value: { headerComponent } },
6542
- React__namespace.createElement(Popper, { trigger: children, reference: reference, popper: content, popperMatchesTriggerWidth: false, appendTo: appendTo, isVisible: visible, positionModifiers: positionModifiers, distance: distance, placement: position, onTriggerClick: onTriggerClick, onTriggerEnter: onTriggerEnter, onDocumentClick: onDocumentClick, onDocumentKeyDown: onDocumentKeyDown, enableFlip: enableFlip, zIndex: zIndex, flipBehavior: flipBehavior })));
6525
+ 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 })));
6543
6526
  };
6544
6527
  Popover.displayName = 'Popover';
6545
6528