@patternfly/react-table 4.83.5 → 4.85.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,39 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 4.85.1 (2022-05-23)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **Select:** allow enter to create when there is a single option ([#7444](https://github.com/patternfly/patternfly-react/issues/7444)) ([e1ae6a9](https://github.com/patternfly/patternfly-react/commit/e1ae6a9aa7dee0f8107905ec1d47463fce950ff3))
12
+
13
+
14
+
15
+
16
+
17
+ # 4.85.0 (2022-05-19)
18
+
19
+
20
+ ### Features
21
+
22
+ * **table:** update sortable demo to align with core ([#7292](https://github.com/patternfly/patternfly-react/issues/7292)) ([6891764](https://github.com/patternfly/patternfly-react/commit/6891764f2507c775005878f6e74cc5c8e44a6c68))
23
+
24
+
25
+
26
+
27
+
28
+ # 4.84.0 (2022-05-19)
29
+
30
+
31
+ ### Features
32
+
33
+ * **Menu:** Added support for checkbox menu ([#7368](https://github.com/patternfly/patternfly-react/issues/7368)) ([8c2d1dc](https://github.com/patternfly/patternfly-react/commit/8c2d1dc23dbe5c28a8c1ecf79eb34ea911da386f))
34
+
35
+
36
+
37
+
38
+
6
39
  ## 4.83.5 (2022-05-18)
7
40
 
8
41
 
@@ -5905,12 +5905,12 @@
5905
5905
  }
5906
5906
  };
5907
5907
  this.handleTypeaheadKeys = (position, shiftKey = false) => {
5908
- const { isOpen, onFavorite } = this.props;
5908
+ const { isOpen, onFavorite, isCreatable } = this.props;
5909
5909
  const { typeaheadCurrIndex, tabbedIntoFavoritesMenu } = this.state;
5910
5910
  const typeaheadActiveChild = this.getTypeaheadActiveChild(typeaheadCurrIndex);
5911
5911
  if (isOpen) {
5912
5912
  if (position === 'enter') {
5913
- if (typeaheadCurrIndex !== -1 && // do not allow selection without moving to an initial option
5913
+ if ((typeaheadCurrIndex !== -1 || (isCreatable && this.refCollection.length === 1)) && // do not allow selection without moving to an initial option unless it is a single create option
5914
5914
  (typeaheadActiveChild || (this.refCollection[0] && this.refCollection[0][0]))) {
5915
5915
  if (typeaheadActiveChild) {
5916
5916
  if (!typeaheadActiveChild.classList.contains('pf-m-load')) {
@@ -6514,7 +6514,7 @@
6514
6514
  };
6515
6515
  }
6516
6516
  render() {
6517
- const _a = this.props, { 'aria-label': ariaLabel, className, onChange, isValid, isDisabled, isChecked, label, checked, defaultChecked, description, body, ouiaId, ouiaSafe } = _a, props = __rest$1(_a, ['aria-label', "className", "onChange", "isValid", "isDisabled", "isChecked", "label", "checked", "defaultChecked", "description", "body", "ouiaId", "ouiaSafe"]);
6517
+ const _a = this.props, { 'aria-label': ariaLabel, className, onChange, isValid, isDisabled, isChecked, label, checked, defaultChecked, description, body, ouiaId, ouiaSafe, component: Component } = _a, props = __rest$1(_a, ['aria-label', "className", "onChange", "isValid", "isDisabled", "isChecked", "label", "checked", "defaultChecked", "description", "body", "ouiaId", "ouiaSafe", "component"]);
6518
6518
  if (!props.id) {
6519
6519
  // eslint-disable-next-line no-console
6520
6520
  console.error('Checkbox:', 'id is required to make input accessible');
@@ -6530,7 +6530,7 @@
6530
6530
  checkedProps.defaultChecked = defaultChecked;
6531
6531
  }
6532
6532
  checkedProps.checked = checkedProps.checked === null ? false : checkedProps.checked;
6533
- return (React__namespace.createElement("div", { className: css(checkStyles.check, !label && checkStyles.modifiers.standalone, className) },
6533
+ return (React__namespace.createElement(Component, { className: css(checkStyles.check, !label && checkStyles.modifiers.standalone, className) },
6534
6534
  React__namespace.createElement("input", Object.assign({}, props, { className: css(checkStyles.checkInput), type: "checkbox", onChange: this.handleChange, "aria-invalid": !isValid, "aria-label": ariaLabel, disabled: isDisabled, ref: elem => elem && (elem.indeterminate = isChecked === null) }, checkedProps, getOUIAProps(Checkbox.displayName, ouiaId !== undefined ? ouiaId : this.state.ouiaStateId, ouiaSafe))),
6535
6535
  label && (React__namespace.createElement("label", { className: css(checkStyles.checkLabel, isDisabled && checkStyles.modifiers.disabled), htmlFor: props.id }, label)),
6536
6536
  description && React__namespace.createElement("span", { className: css(checkStyles.checkDescription) }, description),
@@ -6544,7 +6544,8 @@
6544
6544
  isDisabled: false,
6545
6545
  isChecked: false,
6546
6546
  onChange: defaultOnChange,
6547
- ouiaSafe: true
6547
+ ouiaSafe: true,
6548
+ component: 'div'
6548
6549
  };
6549
6550
 
6550
6551
  Promise.resolve().then(function () { return popover; });