@patternfly/react-table 4.101.13 → 4.102.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
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.102.0 (2022-08-19)
7
+
8
+
9
+ ### Features
10
+
11
+ * **ExpandableSection:** add truncated variant ([#7852](https://github.com/patternfly/patternfly-react/issues/7852)) ([f628cdf](https://github.com/patternfly/patternfly-react/commit/f628cdf571d71addfc04e69728be73895e261094))
12
+
13
+
14
+
15
+
16
+
6
17
  ## 4.101.13 (2022-08-19)
7
18
 
8
19
  **Note:** Version bump only for package @patternfly/react-table
@@ -4260,11 +4260,12 @@
4260
4260
 
4261
4261
  .pf-c-scroll-outer-wrapper {
4262
4262
  --pf-c-scroll-outer-wrapper--MinHeight: 25rem;
4263
+ --pf-c-scroll-outer-wrapper--MaxHeight: 100%;
4263
4264
  display: flex;
4264
4265
  flex-direction: column;
4265
4266
  max-width: 100%;
4266
4267
  min-height: var(--pf-c-scroll-outer-wrapper--MinHeight);
4267
- max-height: 100%;
4268
+ max-height: var(--pf-c-scroll-outer-wrapper--MaxHeight);
4268
4269
  overflow: hidden;
4269
4270
  }
4270
4271
 
@@ -8253,89 +8254,6 @@ button.pf-c-breadcrumb__link {
8253
8254
  --pf-c-chip--m-draggable--BackgroundColor: var(--pf-global--palette--black-600);
8254
8255
  }
8255
8256
 
8256
- .pf-c-chip-group {
8257
- --pf-global--Color--100: var(--pf-global--Color--dark-100);
8258
- --pf-global--Color--200: var(--pf-global--Color--dark-200);
8259
- --pf-global--BorderColor--100: var(--pf-global--BorderColor--dark-100);
8260
- --pf-global--primary-color--100: var(--pf-global--primary-color--dark-100);
8261
- --pf-global--link--Color: var(--pf-global--link--Color--dark);
8262
- --pf-global--link--Color--hover: var(--pf-global--link--Color--dark--hover);
8263
- --pf-global--BackgroundColor--100: var(--pf-global--BackgroundColor--light-100);
8264
- }
8265
-
8266
- .pf-c-chip-group {
8267
- color: var(--pf-global--Color--100);
8268
- --pf-c-chip-group__list--MarginBottom: calc(var(--pf-global--spacer--xs) * -1);
8269
- --pf-c-chip-group__list--MarginRight: calc(var(--pf-global--spacer--xs) * -1);
8270
- --pf-c-chip-group--m-category--PaddingTop: var(--pf-global--spacer--xs);
8271
- --pf-c-chip-group--m-category--PaddingRight: var(--pf-global--spacer--xs);
8272
- --pf-c-chip-group--m-category--PaddingBottom: var(--pf-global--spacer--xs);
8273
- --pf-c-chip-group--m-category--PaddingLeft: var(--pf-global--spacer--sm);
8274
- --pf-c-chip-group--m-category--BorderRadius: var(--pf-global--BorderRadius--sm);
8275
- --pf-c-chip-group--m-category--BackgroundColor: var(--pf-global--BackgroundColor--200);
8276
- --pf-c-chip-group__label--MarginRight: var(--pf-global--spacer--sm);
8277
- --pf-c-chip-group__label--FontSize: var(--pf-global--FontSize--sm);
8278
- --pf-c-chip-group__label--MaxWidth: 18ch;
8279
- --pf-c-chip-group__close--MarginTop: calc(var(--pf-global--spacer--xs) * -1);
8280
- --pf-c-chip-group__close--MarginBottom: calc(var(--pf-global--spacer--xs) * -1);
8281
- --pf-c-chip-group__list-item--MarginRight: var(--pf-global--spacer--xs);
8282
- --pf-c-chip-group__list-item--MarginBottom: var(--pf-global--spacer--xs);
8283
- max-width: 100%;
8284
- }
8285
-
8286
- .pf-c-chip-group.pf-m-category {
8287
- padding-top: var(--pf-c-chip-group--m-category--PaddingTop);
8288
- padding-right: var(--pf-c-chip-group--m-category--PaddingRight);
8289
- padding-bottom: var(--pf-c-chip-group--m-category--PaddingBottom);
8290
- padding-left: var(--pf-c-chip-group--m-category--PaddingLeft);
8291
- background-color: var(--pf-c-chip-group--m-category--BackgroundColor);
8292
- border-radius: var(--pf-c-chip-group--m-category--BorderRadius);
8293
- }
8294
-
8295
- .pf-c-chip-group__main {
8296
- display: flex;
8297
- flex: 1;
8298
- flex-wrap: wrap;
8299
- align-items: baseline;
8300
- min-width: 0;
8301
- }
8302
-
8303
- .pf-c-chip-group__list {
8304
- margin-right: var(--pf-c-chip-group__list--MarginRight);
8305
- margin-bottom: var(--pf-c-chip-group__list--MarginBottom);
8306
- }
8307
-
8308
- .pf-c-chip-group,
8309
- .pf-c-chip-group__list {
8310
- display: inline-flex;
8311
- flex-wrap: wrap;
8312
- align-items: center;
8313
- min-width: 0;
8314
- }
8315
-
8316
- .pf-c-chip-group__list-item {
8317
- display: inline-flex;
8318
- min-width: 0;
8319
- margin-right: var(--pf-c-chip-group__list-item--MarginRight);
8320
- margin-bottom: var(--pf-c-chip-group__list-item--MarginBottom);
8321
- }
8322
-
8323
- .pf-c-chip-group__label {
8324
- overflow: hidden;
8325
- text-overflow: ellipsis;
8326
- white-space: nowrap;
8327
- max-width: var(--pf-c-chip-group__label--MaxWidth);
8328
- margin-right: var(--pf-c-chip-group__label--MarginRight);
8329
- font-size: var(--pf-c-chip-group__label--FontSize);
8330
- }
8331
-
8332
- .pf-c-chip-group__close {
8333
- display: flex;
8334
- align-self: flex-start;
8335
- margin-top: var(--pf-c-chip-group__close--MarginTop);
8336
- margin-bottom: var(--pf-c-chip-group__close--MarginBottom);
8337
- }
8338
-
8339
8257
  .pf-c-clipboard-copy {
8340
8258
  --pf-c-clipboard-copy__toggle-icon--Transition: .2s ease-in 0s;
8341
8259
  --pf-c-clipboard-copy--m-expanded__toggle-icon--Rotate: 90deg;
@@ -8446,6 +8364,89 @@ button.pf-c-breadcrumb__link {
8446
8364
  border: 0;
8447
8365
  }
8448
8366
 
8367
+ .pf-c-chip-group {
8368
+ --pf-global--Color--100: var(--pf-global--Color--dark-100);
8369
+ --pf-global--Color--200: var(--pf-global--Color--dark-200);
8370
+ --pf-global--BorderColor--100: var(--pf-global--BorderColor--dark-100);
8371
+ --pf-global--primary-color--100: var(--pf-global--primary-color--dark-100);
8372
+ --pf-global--link--Color: var(--pf-global--link--Color--dark);
8373
+ --pf-global--link--Color--hover: var(--pf-global--link--Color--dark--hover);
8374
+ --pf-global--BackgroundColor--100: var(--pf-global--BackgroundColor--light-100);
8375
+ }
8376
+
8377
+ .pf-c-chip-group {
8378
+ color: var(--pf-global--Color--100);
8379
+ --pf-c-chip-group__list--MarginBottom: calc(var(--pf-global--spacer--xs) * -1);
8380
+ --pf-c-chip-group__list--MarginRight: calc(var(--pf-global--spacer--xs) * -1);
8381
+ --pf-c-chip-group--m-category--PaddingTop: var(--pf-global--spacer--xs);
8382
+ --pf-c-chip-group--m-category--PaddingRight: var(--pf-global--spacer--xs);
8383
+ --pf-c-chip-group--m-category--PaddingBottom: var(--pf-global--spacer--xs);
8384
+ --pf-c-chip-group--m-category--PaddingLeft: var(--pf-global--spacer--sm);
8385
+ --pf-c-chip-group--m-category--BorderRadius: var(--pf-global--BorderRadius--sm);
8386
+ --pf-c-chip-group--m-category--BackgroundColor: var(--pf-global--BackgroundColor--200);
8387
+ --pf-c-chip-group__label--MarginRight: var(--pf-global--spacer--sm);
8388
+ --pf-c-chip-group__label--FontSize: var(--pf-global--FontSize--sm);
8389
+ --pf-c-chip-group__label--MaxWidth: 18ch;
8390
+ --pf-c-chip-group__close--MarginTop: calc(var(--pf-global--spacer--xs) * -1);
8391
+ --pf-c-chip-group__close--MarginBottom: calc(var(--pf-global--spacer--xs) * -1);
8392
+ --pf-c-chip-group__list-item--MarginRight: var(--pf-global--spacer--xs);
8393
+ --pf-c-chip-group__list-item--MarginBottom: var(--pf-global--spacer--xs);
8394
+ max-width: 100%;
8395
+ }
8396
+
8397
+ .pf-c-chip-group.pf-m-category {
8398
+ padding-top: var(--pf-c-chip-group--m-category--PaddingTop);
8399
+ padding-right: var(--pf-c-chip-group--m-category--PaddingRight);
8400
+ padding-bottom: var(--pf-c-chip-group--m-category--PaddingBottom);
8401
+ padding-left: var(--pf-c-chip-group--m-category--PaddingLeft);
8402
+ background-color: var(--pf-c-chip-group--m-category--BackgroundColor);
8403
+ border-radius: var(--pf-c-chip-group--m-category--BorderRadius);
8404
+ }
8405
+
8406
+ .pf-c-chip-group__main {
8407
+ display: flex;
8408
+ flex: 1;
8409
+ flex-wrap: wrap;
8410
+ align-items: baseline;
8411
+ min-width: 0;
8412
+ }
8413
+
8414
+ .pf-c-chip-group__list {
8415
+ margin-right: var(--pf-c-chip-group__list--MarginRight);
8416
+ margin-bottom: var(--pf-c-chip-group__list--MarginBottom);
8417
+ }
8418
+
8419
+ .pf-c-chip-group,
8420
+ .pf-c-chip-group__list {
8421
+ display: inline-flex;
8422
+ flex-wrap: wrap;
8423
+ align-items: center;
8424
+ min-width: 0;
8425
+ }
8426
+
8427
+ .pf-c-chip-group__list-item {
8428
+ display: inline-flex;
8429
+ min-width: 0;
8430
+ margin-right: var(--pf-c-chip-group__list-item--MarginRight);
8431
+ margin-bottom: var(--pf-c-chip-group__list-item--MarginBottom);
8432
+ }
8433
+
8434
+ .pf-c-chip-group__label {
8435
+ overflow: hidden;
8436
+ text-overflow: ellipsis;
8437
+ white-space: nowrap;
8438
+ max-width: var(--pf-c-chip-group__label--MaxWidth);
8439
+ margin-right: var(--pf-c-chip-group__label--MarginRight);
8440
+ font-size: var(--pf-c-chip-group__label--FontSize);
8441
+ }
8442
+
8443
+ .pf-c-chip-group__close {
8444
+ display: flex;
8445
+ align-self: flex-start;
8446
+ margin-top: var(--pf-c-chip-group__close--MarginTop);
8447
+ margin-bottom: var(--pf-c-chip-group__close--MarginBottom);
8448
+ }
8449
+
8449
8450
  .pf-c-code-block {
8450
8451
  --pf-c-code-block--BackgroundColor: var(--pf-global--BackgroundColor--200);
8451
8452
  --pf-c-code-block__header--BorderBottomWidth: var(--pf-global--BorderWidth--sm);
@@ -31689,6 +31690,25 @@ label.pf-c-tree-view__node-text {
31689
31690
  margin-right: var(--pf-l-level--m-gutter--MarginRight);
31690
31691
  }
31691
31692
 
31693
+ .pf-l-split {
31694
+ --pf-l-split--m-gutter--MarginRight: var(--pf-global--gutter);
31695
+ display: flex;
31696
+ padding: 0;
31697
+ margin: 0;
31698
+ }
31699
+
31700
+ .pf-l-split.pf-m-wrap {
31701
+ flex-wrap: wrap;
31702
+ }
31703
+
31704
+ .pf-l-split__item.pf-m-fill {
31705
+ flex-grow: 1;
31706
+ }
31707
+
31708
+ .pf-l-split.pf-m-gutter > *:not(:last-child) {
31709
+ margin-right: var(--pf-l-split--m-gutter--MarginRight);
31710
+ }
31711
+
31692
31712
  .pf-l-stack {
31693
31713
  --pf-l-stack--m-gutter--MarginBottom: var(--pf-global--gutter);
31694
31714
  display: flex;
@@ -31764,25 +31784,6 @@ label.pf-c-tree-view__node-text {
31764
31784
  --pf-c-alert-group__overflow-button--BoxShadow: var(--pf-c-alert-group__overflow-button--active--BoxShadow);
31765
31785
  }
31766
31786
 
31767
- .pf-l-split {
31768
- --pf-l-split--m-gutter--MarginRight: var(--pf-global--gutter);
31769
- display: flex;
31770
- padding: 0;
31771
- margin: 0;
31772
- }
31773
-
31774
- .pf-l-split.pf-m-wrap {
31775
- flex-wrap: wrap;
31776
- }
31777
-
31778
- .pf-l-split__item.pf-m-fill {
31779
- flex-grow: 1;
31780
- }
31781
-
31782
- .pf-l-split.pf-m-gutter > *:not(:last-child) {
31783
- margin-right: var(--pf-l-split--m-gutter--MarginRight);
31784
- }
31785
-
31786
31787
  .pf-c-about-modal-box {
31787
31788
  --pf-global--Color--100: var(--pf-global--Color--light-100);
31788
31789
  --pf-global--Color--200: var(--pf-global--Color--light-200);
@@ -8051,9 +8051,11 @@
8051
8051
  const idItem = React__namespace.Children.toArray(children).find((child) => !formCtrls.includes(child.type.displayName) && child.props.id);
8052
8052
  const inputGroupRef = innerRef || React__namespace.useRef(null);
8053
8053
  return (React__namespace.createElement("div", Object.assign({ ref: inputGroupRef, className: css(styles$v.inputGroup, className) }, props), idItem
8054
- ? React__namespace.Children.map(children, (child) => formCtrls.includes(child.type.displayName)
8055
- ? React__namespace.cloneElement(child, { 'aria-describedby': idItem.props.id })
8056
- : child)
8054
+ ? React__namespace.Children.map(children, (child) => !formCtrls.includes(child.type.displayName) || child.props['aria-describedby']
8055
+ ? child
8056
+ : React__namespace.cloneElement(child, {
8057
+ 'aria-describedby': child.props['aria-describedby'] === '' ? undefined : idItem.props.id
8058
+ }))
8057
8059
  : children));
8058
8060
  };
8059
8061
  InputGroup.displayName = 'InputGroup';
@@ -10885,9 +10887,27 @@
10885
10887
  }
10886
10888
  };
10887
10889
 
10890
+ const c_expandable_section_m_truncate__content_LineClamp = {
10891
+ "name": "--pf-c-expandable-section--m-truncate__content--LineClamp",
10892
+ "value": "3",
10893
+ "var": "var(--pf-c-expandable-section--m-truncate__content--LineClamp)"
10894
+ };
10895
+
10896
+ var ExpandableSectionVariant;
10897
+ (function (ExpandableSectionVariant) {
10898
+ ExpandableSectionVariant["default"] = "default";
10899
+ ExpandableSectionVariant["truncate"] = "truncate";
10900
+ })(ExpandableSectionVariant || (ExpandableSectionVariant = {}));
10901
+ const setLineClamp = (lines, element) => {
10902
+ if (!element || lines < 1) {
10903
+ return;
10904
+ }
10905
+ element.style.setProperty(c_expandable_section_m_truncate__content_LineClamp.name, lines.toString());
10906
+ };
10888
10907
  class ExpandableSection extends React__namespace.Component {
10889
10908
  constructor(props) {
10890
10909
  super(props);
10910
+ this.expandableContentRef = React__namespace.createRef();
10891
10911
  this.state = {
10892
10912
  isExpanded: props.isExpanded
10893
10913
  };
@@ -10901,10 +10921,25 @@
10901
10921
  }
10902
10922
  return toggleText;
10903
10923
  }
10924
+ componentDidMount() {
10925
+ if (this.props.variant === ExpandableSectionVariant.truncate && this.props.truncateMaxLines) {
10926
+ const expandableContent = this.expandableContentRef.current;
10927
+ setLineClamp(this.props.truncateMaxLines, expandableContent);
10928
+ }
10929
+ }
10930
+ componentDidUpdate(prevProps) {
10931
+ if (this.props.variant === ExpandableSectionVariant.truncate &&
10932
+ prevProps.truncateMaxLines !== this.props.truncateMaxLines) {
10933
+ const expandableContent = this.expandableContentRef.current;
10934
+ setLineClamp(this.props.truncateMaxLines, expandableContent);
10935
+ }
10936
+ }
10904
10937
  render() {
10905
10938
  const _a = this.props, { onToggle: onToggleProp,
10906
10939
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
10907
- isActive, className, toggleText, toggleTextExpanded, toggleTextCollapsed, toggleContent, children, isExpanded, isDetached, displaySize, isWidthLimited, isIndented, contentId } = _a, props = __rest$1(_a, ["onToggle", "isActive", "className", "toggleText", "toggleTextExpanded", "toggleTextCollapsed", "toggleContent", "children", "isExpanded", "isDetached", "displaySize", "isWidthLimited", "isIndented", "contentId"]);
10940
+ isActive, className, toggleText, toggleTextExpanded, toggleTextCollapsed, toggleContent, children, isExpanded, isDetached, displaySize, isWidthLimited, isIndented, contentId, variant,
10941
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10942
+ truncateMaxLines } = _a, props = __rest$1(_a, ["onToggle", "isActive", "className", "toggleText", "toggleTextExpanded", "toggleTextCollapsed", "toggleContent", "children", "isExpanded", "isDetached", "displaySize", "isWidthLimited", "isIndented", "contentId", "variant", "truncateMaxLines"]);
10908
10943
  let onToggle = onToggleProp;
10909
10944
  let propOrStateIsExpanded = isExpanded;
10910
10945
  // uncontrolled
@@ -10915,12 +10950,14 @@
10915
10950
  };
10916
10951
  }
10917
10952
  const computedToggleText = this.calculateToggleText(toggleText, toggleTextExpanded, toggleTextCollapsed, propOrStateIsExpanded);
10918
- return (React__namespace.createElement("div", Object.assign({}, props, { className: css(styles$m.expandableSection, propOrStateIsExpanded && styles$m.modifiers.expanded, isActive && styles$m.modifiers.active, isDetached && styles$m.modifiers.detached, displaySize === 'large' && styles$m.modifiers.displayLg, isWidthLimited && styles$m.modifiers.limitWidth, isIndented && styles$m.modifiers.indented, className) }),
10919
- !isDetached && (React__namespace.createElement("button", { className: css(styles$m.expandableSectionToggle), type: "button", "aria-expanded": propOrStateIsExpanded, onClick: () => onToggle(!propOrStateIsExpanded) },
10920
- React__namespace.createElement("span", { className: css(styles$m.expandableSectionToggleIcon) },
10921
- React__namespace.createElement(AngleRightIcon, { "aria-hidden": true })),
10922
- React__namespace.createElement("span", { className: css(styles$m.expandableSectionToggleText) }, toggleContent || computedToggleText))),
10923
- React__namespace.createElement("div", { className: css(styles$m.expandableSectionContent), hidden: !propOrStateIsExpanded, id: contentId }, children)));
10953
+ const expandableToggle = !isDetached && (React__namespace.createElement("button", { className: css(styles$m.expandableSectionToggle), type: "button", "aria-expanded": propOrStateIsExpanded, onClick: () => onToggle(!propOrStateIsExpanded) },
10954
+ variant !== ExpandableSectionVariant.truncate && (React__namespace.createElement("span", { className: css(styles$m.expandableSectionToggleIcon) },
10955
+ React__namespace.createElement(AngleRightIcon, { "aria-hidden": true }))),
10956
+ React__namespace.createElement("span", { className: css(styles$m.expandableSectionToggleText) }, toggleContent || computedToggleText)));
10957
+ return (React__namespace.createElement("div", Object.assign({ className: css(styles$m.expandableSection, propOrStateIsExpanded && styles$m.modifiers.expanded, isActive && styles$m.modifiers.active, isDetached && styles$m.modifiers.detached, displaySize === 'large' && styles$m.modifiers.displayLg, isWidthLimited && styles$m.modifiers.limitWidth, isIndented && styles$m.modifiers.indented, variant === ExpandableSectionVariant.truncate && styles$m.modifiers.truncate, className) }, props),
10958
+ variant === ExpandableSectionVariant.default && expandableToggle,
10959
+ React__namespace.createElement("div", { ref: this.expandableContentRef, className: css(styles$m.expandableSectionContent), hidden: variant !== ExpandableSectionVariant.truncate && !propOrStateIsExpanded, id: contentId }, children),
10960
+ variant === ExpandableSectionVariant.truncate && expandableToggle));
10924
10961
  }
10925
10962
  }
10926
10963
  ExpandableSection.displayName = 'ExpandableSection';
@@ -10936,7 +10973,8 @@
10936
10973
  displaySize: 'default',
10937
10974
  isWidthLimited: false,
10938
10975
  isIndented: false,
10939
- contentId: ''
10976
+ contentId: '',
10977
+ variant: 'default'
10940
10978
  };
10941
10979
 
10942
10980
  var fileReaderType;