@patternfly/react-table 4.90.1 → 4.90.2

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 (28) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/esm/components/Table/base/provider.d.ts +3 -3
  3. package/dist/esm/components/Table/base/types.d.ts +3 -3
  4. package/dist/esm/components/TableComposable/TableComposable.d.ts +10 -1
  5. package/dist/esm/components/TableComposable/TableComposable.d.ts.map +1 -1
  6. package/dist/esm/components/TableComposable/TableComposable.js +23 -2
  7. package/dist/esm/components/TableComposable/TableComposable.js.map +1 -1
  8. package/dist/esm/components/TableComposable/Tr.d.ts +3 -1
  9. package/dist/esm/components/TableComposable/Tr.d.ts.map +1 -1
  10. package/dist/esm/components/TableComposable/Tr.js +18 -2
  11. package/dist/esm/components/TableComposable/Tr.js.map +1 -1
  12. package/dist/js/components/Table/base/provider.d.ts +3 -3
  13. package/dist/js/components/Table/base/types.d.ts +3 -3
  14. package/dist/js/components/TableComposable/TableComposable.d.ts +10 -1
  15. package/dist/js/components/TableComposable/TableComposable.d.ts.map +1 -1
  16. package/dist/js/components/TableComposable/TableComposable.js +24 -3
  17. package/dist/js/components/TableComposable/TableComposable.js.map +1 -1
  18. package/dist/js/components/TableComposable/Tr.d.ts +3 -1
  19. package/dist/js/components/TableComposable/Tr.d.ts.map +1 -1
  20. package/dist/js/components/TableComposable/Tr.js +18 -2
  21. package/dist/js/components/TableComposable/Tr.js.map +1 -1
  22. package/dist/umd/react-table.css +70 -70
  23. package/dist/umd/react-table.js +49 -11
  24. package/dist/umd/react-table.min.js +5 -5
  25. package/package.json +6 -6
  26. package/src/components/TableComposable/TableComposable.tsx +67 -22
  27. package/src/components/TableComposable/Tr.tsx +45 -20
  28. package/src/components/TableComposable/examples/ComposableTableHoverable.tsx +2 -1
@@ -13650,6 +13650,76 @@ button.pf-c-breadcrumb__link {
13650
13650
  transform: translate(-50%, -50%);
13651
13651
  }
13652
13652
 
13653
+ .pf-c-hint {
13654
+ --pf-c-hint--GridRowGap: var(--pf-global--spacer--md);
13655
+ --pf-c-hint--PaddingTop: var(--pf-global--spacer--lg);
13656
+ --pf-c-hint--PaddingRight: var(--pf-global--spacer--lg);
13657
+ --pf-c-hint--PaddingBottom: var(--pf-global--spacer--lg);
13658
+ --pf-c-hint--PaddingLeft: var(--pf-global--spacer--lg);
13659
+ --pf-c-hint--BackgroundColor: var(--pf-global--palette--blue-50);
13660
+ --pf-c-hint--BorderColor: var(--pf-global--palette--blue-100);
13661
+ --pf-c-hint--BorderWidth: var(--pf-global--BorderWidth--sm);
13662
+ --pf-c-hint--BoxShadow: var(--pf-global--BoxShadow--sm);
13663
+ --pf-c-hint--Color: var(--pf-global--Color--100);
13664
+ --pf-c-hint__title--FontSize: var(--pf-global--FontSize--lg);
13665
+ --pf-c-hint__body--FontSize: var(--pf-global--FontSize--md);
13666
+ --pf-c-hint__footer--child--MarginRight: var(--pf-global--spacer--md);
13667
+ --pf-c-hint__actions--MarginLeft: var(--pf-global--spacer--2xl);
13668
+ --pf-c-hint__actions--c-dropdown--MarginTop: calc(var(--pf-global--spacer--form-element) * -1);
13669
+ display: grid;
13670
+ grid-template-columns: 1fr auto;
13671
+ grid-row-gap: var(--pf-c-hint--GridRowGap);
13672
+ padding: var(--pf-c-hint--PaddingTop) var(--pf-c-hint--PaddingRight) var(--pf-c-hint--PaddingBottom) var(--pf-c-hint--PaddingLeft);
13673
+ color: var(--pf-c-hint--Color);
13674
+ background-color: var(--pf-c-hint--BackgroundColor);
13675
+ border: var(--pf-c-hint--BorderWidth) solid var(--pf-c-hint--BorderColor);
13676
+ box-shadow: var(--pf-c-hint--BoxShadow);
13677
+ }
13678
+
13679
+ .pf-c-hint .pf-c-button.pf-m-link.pf-m-inline {
13680
+ text-align: left;
13681
+ white-space: normal;
13682
+ }
13683
+
13684
+ .pf-c-hint__actions {
13685
+ display: inline-grid;
13686
+ grid-auto-flow: column;
13687
+ margin-left: var(--pf-c-hint__actions--MarginLeft);
13688
+ text-align: right;
13689
+ grid-column: 2;
13690
+ grid-row: 1;
13691
+ }
13692
+
13693
+ .pf-c-hint__actions .pf-c-dropdown .pf-c-dropdown__toggle.pf-m-plain {
13694
+ margin-top: var(--pf-c-hint__actions--c-dropdown--MarginTop);
13695
+ }
13696
+
13697
+ .pf-c-hint__actions + .pf-c-hint__body {
13698
+ grid-column: 1;
13699
+ }
13700
+
13701
+ .pf-c-hint__title {
13702
+ font-size: var(--pf-c-hint__title--FontSize);
13703
+ }
13704
+
13705
+ .pf-c-hint__body {
13706
+ grid-column: 1/-1;
13707
+ font-size: var(--pf-c-hint__body--FontSize);
13708
+ }
13709
+
13710
+ .pf-c-hint__footer {
13711
+ grid-column: 1/-1;
13712
+ }
13713
+
13714
+ .pf-c-hint__footer > :not(:last-child) {
13715
+ margin-right: var(--pf-c-hint__footer--child--MarginRight);
13716
+ }
13717
+
13718
+ :where(.pf-theme-dark) .pf-c-hint {
13719
+ --pf-c-hint--BackgroundColor: var(--pf-global--BackgroundColor--400);
13720
+ --pf-c-hint--BorderColor: var(--pf-global--BorderColor--300);
13721
+ }
13722
+
13653
13723
  .pf-c-helper-text {
13654
13724
  --pf-c-helper-text--Gap: var(--pf-global--spacer--xs);
13655
13725
  --pf-c-helper-text--FontSize: var(--pf-global--FontSize--sm);
@@ -13729,76 +13799,6 @@ button.pf-c-breadcrumb__link {
13729
13799
  --pf-c-helper-text__item-text--m-success--Color: var(--pf-global--success-color--100);
13730
13800
  }
13731
13801
 
13732
- .pf-c-hint {
13733
- --pf-c-hint--GridRowGap: var(--pf-global--spacer--md);
13734
- --pf-c-hint--PaddingTop: var(--pf-global--spacer--lg);
13735
- --pf-c-hint--PaddingRight: var(--pf-global--spacer--lg);
13736
- --pf-c-hint--PaddingBottom: var(--pf-global--spacer--lg);
13737
- --pf-c-hint--PaddingLeft: var(--pf-global--spacer--lg);
13738
- --pf-c-hint--BackgroundColor: var(--pf-global--palette--blue-50);
13739
- --pf-c-hint--BorderColor: var(--pf-global--palette--blue-100);
13740
- --pf-c-hint--BorderWidth: var(--pf-global--BorderWidth--sm);
13741
- --pf-c-hint--BoxShadow: var(--pf-global--BoxShadow--sm);
13742
- --pf-c-hint--Color: var(--pf-global--Color--100);
13743
- --pf-c-hint__title--FontSize: var(--pf-global--FontSize--lg);
13744
- --pf-c-hint__body--FontSize: var(--pf-global--FontSize--md);
13745
- --pf-c-hint__footer--child--MarginRight: var(--pf-global--spacer--md);
13746
- --pf-c-hint__actions--MarginLeft: var(--pf-global--spacer--2xl);
13747
- --pf-c-hint__actions--c-dropdown--MarginTop: calc(var(--pf-global--spacer--form-element) * -1);
13748
- display: grid;
13749
- grid-template-columns: 1fr auto;
13750
- grid-row-gap: var(--pf-c-hint--GridRowGap);
13751
- padding: var(--pf-c-hint--PaddingTop) var(--pf-c-hint--PaddingRight) var(--pf-c-hint--PaddingBottom) var(--pf-c-hint--PaddingLeft);
13752
- color: var(--pf-c-hint--Color);
13753
- background-color: var(--pf-c-hint--BackgroundColor);
13754
- border: var(--pf-c-hint--BorderWidth) solid var(--pf-c-hint--BorderColor);
13755
- box-shadow: var(--pf-c-hint--BoxShadow);
13756
- }
13757
-
13758
- .pf-c-hint .pf-c-button.pf-m-link.pf-m-inline {
13759
- text-align: left;
13760
- white-space: normal;
13761
- }
13762
-
13763
- .pf-c-hint__actions {
13764
- display: inline-grid;
13765
- grid-auto-flow: column;
13766
- margin-left: var(--pf-c-hint__actions--MarginLeft);
13767
- text-align: right;
13768
- grid-column: 2;
13769
- grid-row: 1;
13770
- }
13771
-
13772
- .pf-c-hint__actions .pf-c-dropdown .pf-c-dropdown__toggle.pf-m-plain {
13773
- margin-top: var(--pf-c-hint__actions--c-dropdown--MarginTop);
13774
- }
13775
-
13776
- .pf-c-hint__actions + .pf-c-hint__body {
13777
- grid-column: 1;
13778
- }
13779
-
13780
- .pf-c-hint__title {
13781
- font-size: var(--pf-c-hint__title--FontSize);
13782
- }
13783
-
13784
- .pf-c-hint__body {
13785
- grid-column: 1/-1;
13786
- font-size: var(--pf-c-hint__body--FontSize);
13787
- }
13788
-
13789
- .pf-c-hint__footer {
13790
- grid-column: 1/-1;
13791
- }
13792
-
13793
- .pf-c-hint__footer > :not(:last-child) {
13794
- margin-right: var(--pf-c-hint__footer--child--MarginRight);
13795
- }
13796
-
13797
- :where(.pf-theme-dark) .pf-c-hint {
13798
- --pf-c-hint--BackgroundColor: var(--pf-global--BackgroundColor--400);
13799
- --pf-c-hint--BorderColor: var(--pf-global--BorderColor--300);
13800
- }
13801
-
13802
13802
  .pf-c-input-group {
13803
13803
  --pf-global--Color--100: var(--pf-global--Color--dark-100);
13804
13804
  --pf-global--Color--200: var(--pf-global--Color--dark-200);
@@ -6814,7 +6814,7 @@
6814
6814
  });
6815
6815
  }
6816
6816
  render() {
6817
- const _a = this.props, { children, chipGroupProps, chipGroupComponent, className, customContent, variant, direction, onSelect, onClear, onBlur, toggleId, isOpen, isGrouped, isPlain, isDisabled, hasPlaceholderStyle, validated, selections: selectionsProp, typeAheadAriaLabel, clearSelectionsAriaLabel, toggleAriaLabel, removeSelectionAriaLabel, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, placeholderText, width, maxHeight, toggleIcon, ouiaId, ouiaSafe, hasInlineFilter, isCheckboxSelectionBadgeHidden, inlineFilterPlaceholderText,
6817
+ const _a = this.props, { children, chipGroupProps, chipGroupComponent, className, customContent, variant, direction, onSelect, onClear, onBlur, toggleId, isOpen, isGrouped, isPlain, isDisabled, hasPlaceholderStyle, validated, selections: selectionsProp, typeAheadAriaLabel, typeAheadAriaDescribedby, clearSelectionsAriaLabel, toggleAriaLabel, removeSelectionAriaLabel, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, placeholderText, width, maxHeight, toggleIcon, ouiaId, ouiaSafe, hasInlineFilter, isCheckboxSelectionBadgeHidden, inlineFilterPlaceholderText,
6818
6818
  /* eslint-disable @typescript-eslint/no-unused-vars */
6819
6819
  onFilter,
6820
6820
  /* eslint-disable @typescript-eslint/no-unused-vars */
@@ -6824,7 +6824,7 @@
6824
6824
  /* eslint-enable @typescript-eslint/no-unused-vars */
6825
6825
  menuAppendTo, favorites, onFavorite,
6826
6826
  /* eslint-disable @typescript-eslint/no-unused-vars */
6827
- favoritesLabel, footer, loadingVariant, isCreateSelectOptionObject, shouldResetOnSelect, isFlipEnabled } = _a, props = __rest$1(_a, ["children", "chipGroupProps", "chipGroupComponent", "className", "customContent", "variant", "direction", "onSelect", "onClear", "onBlur", "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", "shouldResetOnSelect", "isFlipEnabled"]);
6827
+ favoritesLabel, footer, loadingVariant, isCreateSelectOptionObject, shouldResetOnSelect, isFlipEnabled } = _a, props = __rest$1(_a, ["children", "chipGroupProps", "chipGroupComponent", "className", "customContent", "variant", "direction", "onSelect", "onClear", "onBlur", "toggleId", "isOpen", "isGrouped", "isPlain", "isDisabled", "hasPlaceholderStyle", "validated", "selections", "typeAheadAriaLabel", "typeAheadAriaDescribedby", "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", "shouldResetOnSelect", "isFlipEnabled"]);
6828
6828
  const { focusFirstOption: openedOnEnter, typeaheadCurrIndex, typeaheadInputValue, typeaheadFilteredChildren, favoritesGroup } = this.state;
6829
6829
  const selectToggleId = toggleId || `pf-select-toggle-id-${currentId++}`;
6830
6830
  const selections = Array.isArray(selectionsProp) ? selectionsProp : [selectionsProp];
@@ -6998,8 +6998,8 @@
6998
6998
  " ",
6999
6999
  innerMenu,
7000
7000
  " ") : innerMenu;
7001
- const popperContainer = (React__namespace.createElement("div", Object.assign({ className: css(styles$6.select, isOpen && styles$6.modifiers.expanded, validated === ValidatedOptions.success && styles$6.modifiers.success, validated === ValidatedOptions.warning && styles$6.modifiers.warning, validated === ValidatedOptions.error && styles$6.modifiers.invalid, direction === SelectDirection.up && styles$6.modifiers.top, className) }, (width && { style: { width } }), (validated !== ValidatedOptions.default && { 'aria-describedby': ariaDescribedby }), (validated !== ValidatedOptions.default && { 'aria-invalid': ariaInvalid })), isOpen && menuContainer));
7002
- const mainContainer = (React__namespace.createElement("div", Object.assign({ className: css(styles$6.select, isOpen && styles$6.modifiers.expanded, validated === ValidatedOptions.success && styles$6.modifiers.success, validated === ValidatedOptions.warning && styles$6.modifiers.warning, validated === ValidatedOptions.error && styles$6.modifiers.invalid, direction === SelectDirection.up && styles$6.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 })),
7001
+ const popperContainer = (React__namespace.createElement("div", Object.assign({ className: css(styles$6.select, isOpen && styles$6.modifiers.expanded, validated === ValidatedOptions.success && styles$6.modifiers.success, validated === ValidatedOptions.warning && styles$6.modifiers.warning, validated === ValidatedOptions.error && styles$6.modifiers.invalid, direction === SelectDirection.up && styles$6.modifiers.top, className) }, (width && { style: { width } }), (ariaDescribedby && { 'aria-describedby': ariaDescribedby }), (validated !== ValidatedOptions.default && { 'aria-invalid': ariaInvalid })), isOpen && menuContainer));
7002
+ const mainContainer = (React__namespace.createElement("div", Object.assign({ className: css(styles$6.select, isOpen && styles$6.modifiers.expanded, validated === ValidatedOptions.success && styles$6.modifiers.success, validated === ValidatedOptions.warning && styles$6.modifiers.warning, validated === ValidatedOptions.error && styles$6.modifiers.invalid, direction === SelectDirection.up && styles$6.modifiers.top, className), ref: this.parentRef }, getOUIAProps(Select.displayName, ouiaId !== undefined ? ouiaId : this.state.ouiaStateId, ouiaSafe), (width && { style: { width } }), (ariaDescribedby && { 'aria-describedby': ariaDescribedby }), (validated !== ValidatedOptions.default && { 'aria-invalid': ariaInvalid })),
7003
7003
  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, onBlur: onBlur, 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 }),
7004
7004
  customContent && (React__namespace.createElement("div", { className: css(styles$6.selectToggleWrapper) },
7005
7005
  toggleIcon && React__namespace.createElement("span", { className: css(styles$6.selectToggleIcon) }, toggleIcon),
@@ -7019,15 +7019,15 @@
7019
7019
  variant === SelectVariant.typeahead && !customContent && (React__namespace.createElement(React__namespace.Fragment, null,
7020
7020
  React__namespace.createElement("div", { className: css(styles$6.selectToggleWrapper) },
7021
7021
  toggleIcon && React__namespace.createElement("span", { className: css(styles$6.selectToggleIcon) }, toggleIcon),
7022
- React__namespace.createElement("input", { className: css(formStyles$1.formControl, styles$6.selectToggleTypeahead), "aria-activedescendant": typeaheadActiveChild && typeaheadActiveChild.id, id: `${selectToggleId}-select-typeahead`, "aria-label": typeAheadAriaLabel, placeholder: placeholderText, value: typeaheadInputValue !== null
7022
+ React__namespace.createElement("input", Object.assign({ className: css(formStyles$1.formControl, styles$6.selectToggleTypeahead), "aria-activedescendant": typeaheadActiveChild && typeaheadActiveChild.id, id: `${selectToggleId}-select-typeahead`, "aria-label": typeAheadAriaLabel }, (typeAheadAriaDescribedby && { 'aria-describedby': typeAheadAriaDescribedby }), { placeholder: placeholderText, value: typeaheadInputValue !== null
7023
7023
  ? typeaheadInputValue
7024
- : this.getDisplay(selections[0], 'text') || '', type: "text", onClick: this.onClick, onChange: this.onChange, autoComplete: inputAutoComplete, disabled: isDisabled, ref: this.inputRef })),
7024
+ : this.getDisplay(selections[0], 'text') || '', type: "text", onClick: this.onClick, onChange: this.onChange, autoComplete: inputAutoComplete, disabled: isDisabled, ref: this.inputRef }))),
7025
7025
  hasOnClear && (selections[0] || typeaheadInputValue) && clearBtn)),
7026
7026
  variant === SelectVariant.typeaheadMulti && !customContent && (React__namespace.createElement(React__namespace.Fragment, null,
7027
7027
  React__namespace.createElement("div", { className: css(styles$6.selectToggleWrapper) },
7028
7028
  toggleIcon && React__namespace.createElement("span", { className: css(styles$6.selectToggleIcon) }, toggleIcon),
7029
7029
  selections && Array.isArray(selections) && selections.length > 0 && selectedChips,
7030
- React__namespace.createElement("input", { className: css(formStyles$1.formControl, styles$6.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 })),
7030
+ React__namespace.createElement("input", Object.assign({ className: css(formStyles$1.formControl, styles$6.selectToggleTypeahead), "aria-activedescendant": typeaheadActiveChild && typeaheadActiveChild.id, id: `${selectToggleId}-select-multi-typeahead-typeahead`, "aria-label": typeAheadAriaLabel, "aria-invalid": validated === ValidatedOptions.error }, (typeAheadAriaDescribedby && { 'aria-describedby': typeAheadAriaDescribedby }), { placeholder: placeholderText, value: typeaheadInputValue !== null ? typeaheadInputValue : '', type: "text", onChange: this.onChange, onClick: this.onClick, autoComplete: inputAutoComplete, disabled: isDisabled, ref: this.inputRef }))),
7031
7031
  hasOnClear && ((selections && selections.length > 0) || typeaheadInputValue) && clearBtn)),
7032
7032
  validated === ValidatedOptions.success && (React__namespace.createElement("span", { className: css(styles$6.selectToggleStatusIcon) },
7033
7033
  React__namespace.createElement(CheckCircleIcon$1, { "aria-hidden": "true" }))),
@@ -7071,6 +7071,7 @@
7071
7071
  'aria-describedby': '',
7072
7072
  'aria-invalid': false,
7073
7073
  typeAheadAriaLabel: '',
7074
+ typeAheadAriaDescribedby: '',
7074
7075
  clearSelectionsAriaLabel: 'Clear all',
7075
7076
  toggleAriaLabel: 'Options menu',
7076
7077
  removeSelectionAriaLabel: 'Remove',
@@ -7817,12 +7818,17 @@
7817
7818
  TableVariant["compact"] = "compact";
7818
7819
  })(exports.TableVariant || (exports.TableVariant = {}));
7819
7820
 
7821
+ const TableComposableContext = React__namespace.createContext({
7822
+ registerSelectableRow: () => { }
7823
+ });
7820
7824
  const TableComposableBase = (_a) => {
7821
7825
  var _b, _c;
7822
7826
  var { children, className, variant, borders = true, isStickyHeader = false, gridBreakPoint = exports.TableGridBreakpoint.gridMd, 'aria-label': ariaLabel, role = 'grid', innerRef, ouiaId, ouiaSafe = true, isTreeTable = false, isNested = false, isStriped = false, isExpandable = false,
7823
7827
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
7824
- nestedHeaderColumnSpans } = _a, props = __rest$2(_a, ["children", "className", "variant", "borders", "isStickyHeader", "gridBreakPoint", 'aria-label', "role", "innerRef", "ouiaId", "ouiaSafe", "isTreeTable", "isNested", "isStriped", "isExpandable", "nestedHeaderColumnSpans"]);
7828
+ nestedHeaderColumnSpans, hasSelectableRowCaption, selectableRowCaptionText } = _a, props = __rest$2(_a, ["children", "className", "variant", "borders", "isStickyHeader", "gridBreakPoint", 'aria-label', "role", "innerRef", "ouiaId", "ouiaSafe", "isTreeTable", "isNested", "isStriped", "isExpandable", "nestedHeaderColumnSpans", "hasSelectableRowCaption", "selectableRowCaptionText"]);
7825
7829
  const tableRef = innerRef || React__namespace.useRef(null);
7830
+ const [hasSelectableRows, setHasSelectableRows] = React__namespace.useState(false);
7831
+ const [tableCaption, setTableCaption] = React__namespace.useState();
7826
7832
  React__namespace.useEffect(() => {
7827
7833
  document.addEventListener('keydown', handleKeys);
7828
7834
  // sets up roving tab-index to tree tables only
@@ -7834,6 +7840,16 @@
7834
7840
  document.removeEventListener('keydown', handleKeys);
7835
7841
  };
7836
7842
  }, [tableRef, tableRef.current]);
7843
+ React__namespace.useEffect(() => {
7844
+ if (selectableRowCaptionText) {
7845
+ setTableCaption(React__namespace.createElement("caption", null,
7846
+ selectableRowCaptionText,
7847
+ React__namespace.createElement("div", { className: "pf-screen-reader" }, "This table has selectable rows. It can be navigated by row using tab, and each row can be selected using space or enter.")));
7848
+ }
7849
+ else {
7850
+ setTableCaption(React__namespace.createElement("caption", { className: "pf-screen-reader" }, "This table has selectable rows. It can be navigated by row using tab, and each row can be selected using space or enter."));
7851
+ }
7852
+ }, [selectableRowCaptionText]);
7837
7853
  const ouiaProps = useOUIAProps('Table', ouiaId, ouiaSafe);
7838
7854
  const grid = (_b = stylesGrid.modifiers) === null || _b === void 0 ? void 0 : _b[toCamel(gridBreakPoint || '').replace(/-?2xl/, '_2xl')];
7839
7855
  const breakPointPrefix = `treeView${gridBreakPoint.charAt(0).toUpperCase() + gridBreakPoint.slice(1)}`;
@@ -7854,7 +7870,13 @@
7854
7870
  const getFocusableElement = (element) => element.querySelectorAll('button:not(:disabled), input:not(:disabled), a:not(:disabled)')[0];
7855
7871
  handleArrows(event, rows, (element) => element === activeElement.closest('tr'), getFocusableElement, ['button', 'input', 'a'], undefined, false, true, false);
7856
7872
  };
7857
- return (React__namespace.createElement("table", Object.assign({ "aria-label": ariaLabel, role: role, className: css(className, styles$1.table, isTreeTable ? treeGrid : grid, styles$1.modifiers[variant], !borders && styles$1.modifiers.noBorderRows, isStickyHeader && styles$1.modifiers.stickyHeader, isTreeTable && stylesTreeView.modifiers.treeView, isStriped && styles$1.modifiers.striped, isExpandable && styles$1.modifiers.expandable, isNested && 'pf-m-nested'), ref: tableRef }, (isTreeTable && { role: 'treegrid' }), ouiaProps, props), children));
7873
+ const registerSelectableRow = () => {
7874
+ !hasSelectableRows && setHasSelectableRows(true);
7875
+ };
7876
+ return (React__namespace.createElement(TableComposableContext.Provider, { value: { registerSelectableRow } },
7877
+ React__namespace.createElement("table", Object.assign({ "aria-label": ariaLabel, role: role, className: css(className, styles$1.table, isTreeTable ? treeGrid : grid, styles$1.modifiers[variant], !borders && styles$1.modifiers.noBorderRows, isStickyHeader && styles$1.modifiers.stickyHeader, isTreeTable && stylesTreeView.modifiers.treeView, isStriped && styles$1.modifiers.striped, isExpandable && styles$1.modifiers.expandable, isNested && 'pf-m-nested'), ref: tableRef }, (isTreeTable && { role: 'treegrid' }), ouiaProps, props),
7878
+ hasSelectableRowCaption && hasSelectableRows && tableCaption,
7879
+ children)));
7858
7880
  };
7859
7881
  const TableComposable = React__namespace.forwardRef((props, ref) => (React__namespace.createElement(TableComposableBase, Object.assign({}, props, { innerRef: ref }))));
7860
7882
  TableComposable.displayName = 'TableComposable';
@@ -7874,8 +7896,9 @@
7874
7896
  Tbody.displayName = 'Tbody';
7875
7897
 
7876
7898
  const TrBase = (_a) => {
7877
- var { children, className, isExpanded, isEditable, isHidden = false, isHoverable = false, isRowSelected = false, isStriped = false, innerRef, ouiaId, ouiaSafe = true, resetOffset = false, onRowClick } = _a, props = __rest$2(_a, ["children", "className", "isExpanded", "isEditable", "isHidden", "isHoverable", "isRowSelected", "isStriped", "innerRef", "ouiaId", "ouiaSafe", "resetOffset", "onRowClick"]);
7899
+ var { children, className, isExpanded, isEditable, isHidden = false, isHoverable = false, isRowSelected = false, isStriped = false, innerRef, ouiaId, ouiaSafe = true, resetOffset = false, onRowClick, isSelectable, 'aria-label': passedAriaLabel } = _a, props = __rest$2(_a, ["children", "className", "isExpanded", "isEditable", "isHidden", "isHoverable", "isRowSelected", "isStriped", "innerRef", "ouiaId", "ouiaSafe", "resetOffset", "onRowClick", "isSelectable", 'aria-label']);
7878
7900
  const ouiaProps = useOUIAProps('TableRow', ouiaId, ouiaSafe);
7901
+ const [computedAriaLabel, setComputedAriaLabel] = React__namespace.useState('');
7879
7902
  let onKeyDown = null;
7880
7903
  if (onRowClick) {
7881
7904
  onKeyDown = (e) => {
@@ -7885,7 +7908,21 @@
7885
7908
  }
7886
7909
  };
7887
7910
  }
7888
- return (React__namespace.createElement("tr", Object.assign({ className: css(className, isExpanded !== undefined && styles$1.tableExpandableRow, isExpanded && styles$1.modifiers.expanded, isEditable && inlineStyles.modifiers.inlineEditable, isHoverable && styles$1.modifiers.hoverable, isRowSelected && styles$1.modifiers.selected, isStriped && styles$1.modifiers.striped, resetOffset && styles$1.modifiers.firstCellOffsetReset), hidden: isHidden || (isExpanded !== undefined && !isExpanded) }, (isHoverable && { tabIndex: 0 }), { ref: innerRef }, (onRowClick && { onClick: onRowClick, onKeyDown }), ouiaProps, props), children));
7911
+ const rowIsHidden = isHidden || (isExpanded !== undefined && !isExpanded);
7912
+ const { registerSelectableRow } = React__namespace.useContext(TableComposableContext);
7913
+ React__namespace.useEffect(() => {
7914
+ if (isSelectable && !rowIsHidden) {
7915
+ setComputedAriaLabel(`${isRowSelected ? 'Selected' : 'Unselected'}, selectable row.`);
7916
+ registerSelectableRow();
7917
+ }
7918
+ else {
7919
+ setComputedAriaLabel(undefined);
7920
+ }
7921
+ }, [isRowSelected, isSelectable, registerSelectableRow, rowIsHidden]);
7922
+ const ariaLabel = passedAriaLabel || computedAriaLabel;
7923
+ return (React__namespace.createElement(React__namespace.Fragment, null,
7924
+ isSelectable && React__namespace.createElement("output", { className: "pf-screen-reader" }, ariaLabel),
7925
+ React__namespace.createElement("tr", Object.assign({ className: css(className, isExpanded !== undefined && styles$1.tableExpandableRow, isExpanded && styles$1.modifiers.expanded, isEditable && inlineStyles.modifiers.inlineEditable, isHoverable && styles$1.modifiers.hoverable, isRowSelected && styles$1.modifiers.selected, isStriped && styles$1.modifiers.striped, resetOffset && styles$1.modifiers.firstCellOffsetReset), hidden: rowIsHidden }, (isHoverable && { tabIndex: 0 }), { "aria-label": ariaLabel, ref: innerRef }, (onRowClick && { onClick: onRowClick, onKeyDown }), ouiaProps, props), children)));
7889
7926
  };
7890
7927
  const Tr = React__namespace.forwardRef((props, ref) => (React__namespace.createElement(TrBase, Object.assign({}, props, { innerRef: ref }))));
7891
7928
  Tr.displayName = 'Tr';
@@ -13328,6 +13365,7 @@
13328
13365
  exports.Table = Table;
13329
13366
  exports.TableBody = TableBody;
13330
13367
  exports.TableComposable = TableComposable;
13368
+ exports.TableComposableContext = TableComposableContext;
13331
13369
  exports.TableContext = TableContext;
13332
13370
  exports.TableHeader = TableHeader;
13333
13371
  exports.TableText = TableText;