@patternfly/react-core 4.232.13 → 4.233.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 +11 -0
- package/dist/esm/components/ExpandableSection/ExpandableSection.d.ts +17 -3
- package/dist/esm/components/ExpandableSection/ExpandableSection.d.ts.map +1 -1
- package/dist/esm/components/ExpandableSection/ExpandableSection.js +39 -8
- package/dist/esm/components/ExpandableSection/ExpandableSection.js.map +1 -1
- package/dist/esm/components/ExpandableSection/ExpandableSectionToggle.d.ts +2 -0
- package/dist/esm/components/ExpandableSection/ExpandableSectionToggle.d.ts.map +1 -1
- package/dist/esm/components/ExpandableSection/ExpandableSectionToggle.js +4 -4
- package/dist/esm/components/ExpandableSection/ExpandableSectionToggle.js.map +1 -1
- package/dist/esm/components/InputGroup/InputGroup.d.ts.map +1 -1
- package/dist/esm/components/InputGroup/InputGroup.js +5 -3
- package/dist/esm/components/InputGroup/InputGroup.js.map +1 -1
- package/dist/esm/components/NumberInput/NumberInput.d.ts +5 -0
- package/dist/esm/components/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/esm/components/NumberInput/NumberInput.js +5 -4
- package/dist/esm/components/NumberInput/NumberInput.js.map +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSection.d.ts +17 -3
- package/dist/js/components/ExpandableSection/ExpandableSection.d.ts.map +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSection.js +40 -9
- package/dist/js/components/ExpandableSection/ExpandableSection.js.map +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSectionToggle.d.ts +2 -0
- package/dist/js/components/ExpandableSection/ExpandableSectionToggle.d.ts.map +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSectionToggle.js +4 -4
- package/dist/js/components/ExpandableSection/ExpandableSectionToggle.js.map +1 -1
- package/dist/js/components/InputGroup/InputGroup.d.ts.map +1 -1
- package/dist/js/components/InputGroup/InputGroup.js +5 -3
- package/dist/js/components/InputGroup/InputGroup.js.map +1 -1
- package/dist/js/components/NumberInput/NumberInput.d.ts +5 -0
- package/dist/js/components/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/js/components/NumberInput/NumberInput.js +4 -3
- package/dist/js/components/NumberInput/NumberInput.js.map +1 -1
- package/dist/umd/react-core.css +69 -69
- package/dist/umd/react-core.js +56 -18
- package/dist/umd/react-core.min.css +921 -921
- package/dist/umd/react-core.min.js +5 -5
- package/package.json +6 -6
- package/src/components/ExpandableSection/ExpandableSection.tsx +73 -19
- package/src/components/ExpandableSection/ExpandableSectionToggle.tsx +15 -9
- package/src/components/ExpandableSection/__tests__/ExpandableSection.test.tsx +27 -1
- package/src/components/ExpandableSection/examples/ExpandableSection.md +7 -0
- package/src/components/ExpandableSection/examples/ExpandableSectionTruncateExpansion.tsx +27 -0
- package/src/components/InputGroup/InputGroup.tsx +5 -3
- package/src/components/InputGroup/__tests__/InputGroup.test.tsx +30 -0
- package/src/components/NumberInput/NumberInput.tsx +14 -8
- package/src/components/NumberInput/__tests__/NumberInput.test.tsx +16 -0
- package/src/components/NumberInput/__tests__/__snapshots__/NumberInput.test.tsx.snap +292 -18
- package/src/components/NumberInput/examples/NumberInput.md +5 -0
- package/src/components/NumberInput/examples/WithStatus.tsx +59 -0
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.233.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.232.13 (2022-08-19)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @patternfly/react-core
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { PickOptional } from '../../helpers/typeUtils';
|
|
3
|
+
export declare enum ExpandableSectionVariant {
|
|
4
|
+
default = "default",
|
|
5
|
+
truncate = "truncate"
|
|
6
|
+
}
|
|
3
7
|
export interface ExpandableSectionProps extends React.HTMLProps<HTMLDivElement> {
|
|
4
|
-
/** Content rendered inside the
|
|
8
|
+
/** Content rendered inside the expandable section. */
|
|
5
9
|
children?: React.ReactNode;
|
|
6
|
-
/** Additional classes added to the
|
|
10
|
+
/** Additional classes added to the expandable section. */
|
|
7
11
|
className?: string;
|
|
8
12
|
/** Flag to indicate if the content is expanded */
|
|
9
13
|
isExpanded?: boolean;
|
|
@@ -15,7 +19,7 @@ export interface ExpandableSectionProps extends React.HTMLProps<HTMLDivElement>
|
|
|
15
19
|
toggleTextCollapsed?: string;
|
|
16
20
|
/** React node that appears in the attached toggle in place of toggle text */
|
|
17
21
|
toggleContent?: React.ReactNode;
|
|
18
|
-
/** Callback function to toggle the expandable
|
|
22
|
+
/** Callback function to toggle the expandable section. Detached expandable sections should use the onToggle property of the expandable section toggle sub-component. */
|
|
19
23
|
onToggle?: (isExpanded: boolean) => void;
|
|
20
24
|
/** Forces active state */
|
|
21
25
|
isActive?: boolean;
|
|
@@ -29,6 +33,13 @@ export interface ExpandableSectionProps extends React.HTMLProps<HTMLDivElement>
|
|
|
29
33
|
isWidthLimited?: boolean;
|
|
30
34
|
/** Flag to indicate if the content is indented */
|
|
31
35
|
isIndented?: boolean;
|
|
36
|
+
/** @beta Determines the variant of the expandable section. When passing in "truncate" as the
|
|
37
|
+
* variant, the expandable content will be truncated after 3 lines by default.
|
|
38
|
+
*/
|
|
39
|
+
variant?: 'default' | 'truncate';
|
|
40
|
+
/** @beta Truncates the expandable content to the specified number of lines when using the
|
|
41
|
+
* "truncate" variant. */
|
|
42
|
+
truncateMaxLines?: number;
|
|
32
43
|
}
|
|
33
44
|
interface ExpandableSectionState {
|
|
34
45
|
isExpanded: boolean;
|
|
@@ -36,8 +47,11 @@ interface ExpandableSectionState {
|
|
|
36
47
|
export declare class ExpandableSection extends React.Component<ExpandableSectionProps, ExpandableSectionState> {
|
|
37
48
|
static displayName: string;
|
|
38
49
|
constructor(props: ExpandableSectionProps);
|
|
50
|
+
expandableContentRef: React.RefObject<HTMLDivElement>;
|
|
39
51
|
static defaultProps: PickOptional<ExpandableSectionProps>;
|
|
40
52
|
private calculateToggleText;
|
|
53
|
+
componentDidMount(): void;
|
|
54
|
+
componentDidUpdate(prevProps: ExpandableSectionProps): void;
|
|
41
55
|
render(): JSX.Element;
|
|
42
56
|
}
|
|
43
57
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpandableSection.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpandableSection/ExpandableSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpandableSection.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpandableSection/ExpandableSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,oBAAY,wBAAwB;IAClC,OAAO,YAAY;IACnB,QAAQ,aAAa;CACtB;AAED,MAAM,WAAW,sBAAuB,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IAC7E,sDAAsD;IACtD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,+CAA+C;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yKAAyK;IACzK,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,0KAA0K;IAC1K,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,6EAA6E;IAC7E,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,wKAAwK;IACxK,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,WAAW,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAClC,kGAAkG;IAClG,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kDAAkD;IAClD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IACjC;6BACyB;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,UAAU,sBAAsB;IAC9B,UAAU,EAAE,OAAO,CAAC;CACrB;AAUD,qBAAa,iBAAkB,SAAQ,KAAK,CAAC,SAAS,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;IACpG,MAAM,CAAC,WAAW,SAAuB;gBAC7B,KAAK,EAAE,sBAAsB;IAQzC,oBAAoB,kCAAqC;IACzD,MAAM,CAAC,YAAY,EAAE,YAAY,CAAC,sBAAsB,CAAC,CAcvD;IAEF,OAAO,CAAC,mBAAmB;IAe3B,iBAAiB;IAOjB,kBAAkB,CAAC,SAAS,EAAE,sBAAsB;IAUpD,MAAM;CAoFP"}
|
|
@@ -2,10 +2,23 @@ import { __rest } from "tslib";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import styles from '@patternfly/react-styles/css/components/ExpandableSection/expandable-section';
|
|
4
4
|
import { css } from '@patternfly/react-styles';
|
|
5
|
+
import lineClamp from '@patternfly/react-tokens/dist/esm/c_expandable_section_m_truncate__content_LineClamp';
|
|
5
6
|
import AngleRightIcon from '@patternfly/react-icons/dist/esm/icons/angle-right-icon';
|
|
7
|
+
export var ExpandableSectionVariant;
|
|
8
|
+
(function (ExpandableSectionVariant) {
|
|
9
|
+
ExpandableSectionVariant["default"] = "default";
|
|
10
|
+
ExpandableSectionVariant["truncate"] = "truncate";
|
|
11
|
+
})(ExpandableSectionVariant || (ExpandableSectionVariant = {}));
|
|
12
|
+
const setLineClamp = (lines, element) => {
|
|
13
|
+
if (!element || lines < 1) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
element.style.setProperty(lineClamp.name, lines.toString());
|
|
17
|
+
};
|
|
6
18
|
export class ExpandableSection extends React.Component {
|
|
7
19
|
constructor(props) {
|
|
8
20
|
super(props);
|
|
21
|
+
this.expandableContentRef = React.createRef();
|
|
9
22
|
this.state = {
|
|
10
23
|
isExpanded: props.isExpanded
|
|
11
24
|
};
|
|
@@ -19,10 +32,25 @@ export class ExpandableSection extends React.Component {
|
|
|
19
32
|
}
|
|
20
33
|
return toggleText;
|
|
21
34
|
}
|
|
35
|
+
componentDidMount() {
|
|
36
|
+
if (this.props.variant === ExpandableSectionVariant.truncate && this.props.truncateMaxLines) {
|
|
37
|
+
const expandableContent = this.expandableContentRef.current;
|
|
38
|
+
setLineClamp(this.props.truncateMaxLines, expandableContent);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
componentDidUpdate(prevProps) {
|
|
42
|
+
if (this.props.variant === ExpandableSectionVariant.truncate &&
|
|
43
|
+
prevProps.truncateMaxLines !== this.props.truncateMaxLines) {
|
|
44
|
+
const expandableContent = this.expandableContentRef.current;
|
|
45
|
+
setLineClamp(this.props.truncateMaxLines, expandableContent);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
22
48
|
render() {
|
|
23
49
|
const _a = this.props, { onToggle: onToggleProp,
|
|
24
50
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
25
|
-
isActive, className, toggleText, toggleTextExpanded, toggleTextCollapsed, toggleContent, children, isExpanded, isDetached, displaySize, isWidthLimited, isIndented, contentId
|
|
51
|
+
isActive, className, toggleText, toggleTextExpanded, toggleTextCollapsed, toggleContent, children, isExpanded, isDetached, displaySize, isWidthLimited, isIndented, contentId, variant,
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
53
|
+
truncateMaxLines } = _a, props = __rest(_a, ["onToggle", "isActive", "className", "toggleText", "toggleTextExpanded", "toggleTextCollapsed", "toggleContent", "children", "isExpanded", "isDetached", "displaySize", "isWidthLimited", "isIndented", "contentId", "variant", "truncateMaxLines"]);
|
|
26
54
|
let onToggle = onToggleProp;
|
|
27
55
|
let propOrStateIsExpanded = isExpanded;
|
|
28
56
|
// uncontrolled
|
|
@@ -33,12 +61,14 @@ export class ExpandableSection extends React.Component {
|
|
|
33
61
|
};
|
|
34
62
|
}
|
|
35
63
|
const computedToggleText = this.calculateToggleText(toggleText, toggleTextExpanded, toggleTextCollapsed, propOrStateIsExpanded);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
React.createElement(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
64
|
+
const expandableToggle = !isDetached && (React.createElement("button", { className: css(styles.expandableSectionToggle), type: "button", "aria-expanded": propOrStateIsExpanded, onClick: () => onToggle(!propOrStateIsExpanded) },
|
|
65
|
+
variant !== ExpandableSectionVariant.truncate && (React.createElement("span", { className: css(styles.expandableSectionToggleIcon) },
|
|
66
|
+
React.createElement(AngleRightIcon, { "aria-hidden": true }))),
|
|
67
|
+
React.createElement("span", { className: css(styles.expandableSectionToggleText) }, toggleContent || computedToggleText)));
|
|
68
|
+
return (React.createElement("div", Object.assign({ className: css(styles.expandableSection, propOrStateIsExpanded && styles.modifiers.expanded, isActive && styles.modifiers.active, isDetached && styles.modifiers.detached, displaySize === 'large' && styles.modifiers.displayLg, isWidthLimited && styles.modifiers.limitWidth, isIndented && styles.modifiers.indented, variant === ExpandableSectionVariant.truncate && styles.modifiers.truncate, className) }, props),
|
|
69
|
+
variant === ExpandableSectionVariant.default && expandableToggle,
|
|
70
|
+
React.createElement("div", { ref: this.expandableContentRef, className: css(styles.expandableSectionContent), hidden: variant !== ExpandableSectionVariant.truncate && !propOrStateIsExpanded, id: contentId }, children),
|
|
71
|
+
variant === ExpandableSectionVariant.truncate && expandableToggle));
|
|
42
72
|
}
|
|
43
73
|
}
|
|
44
74
|
ExpandableSection.displayName = 'ExpandableSection';
|
|
@@ -54,6 +84,7 @@ ExpandableSection.defaultProps = {
|
|
|
54
84
|
displaySize: 'default',
|
|
55
85
|
isWidthLimited: false,
|
|
56
86
|
isIndented: false,
|
|
57
|
-
contentId: ''
|
|
87
|
+
contentId: '',
|
|
88
|
+
variant: 'default'
|
|
58
89
|
};
|
|
59
90
|
//# sourceMappingURL=ExpandableSection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpandableSection.js","sourceRoot":"","sources":["../../../../src/components/ExpandableSection/ExpandableSection.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,8EAA8E,CAAC;AAClG,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,cAAc,MAAM,yDAAyD,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpandableSection.js","sourceRoot":"","sources":["../../../../src/components/ExpandableSection/ExpandableSection.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,8EAA8E,CAAC;AAClG,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,SAAS,MAAM,sFAAsF,CAAC;AAC7G,OAAO,cAAc,MAAM,yDAAyD,CAAC;AAGrF,MAAM,CAAN,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IAClC,+CAAm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AAyC;IAC1D,SAAS,EAAE,EAAE;IACb,UAAU,EAAE,EAAE;IACd,kBAAkB,EAAE,EAAE;IACtB,mBAAmB,EAAE,EAAE;IACvB,6DAA6D;IAC7D,QAAQ,EAAE,CAAC,UAAU,EAAQ,EAAE,CAAC,SAAS;IACzC,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE,KAAK;IACjB,WAAW,EAAE,SAAS;IACtB,cAAc,EAAE,KAAK;IACrB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,SAAS;CACnB,CAAC"}
|
|
@@ -12,6 +12,8 @@ export interface ExpandableSectionToggleProps extends React.HTMLProps<HTMLDivEle
|
|
|
12
12
|
contentId?: string;
|
|
13
13
|
/** Direction the toggle arrow should point when the expandable section is expanded. */
|
|
14
14
|
direction?: 'up' | 'down';
|
|
15
|
+
/** @beta Flag to determine toggle styling when the expandable content is truncated. */
|
|
16
|
+
hasTruncatedContent?: boolean;
|
|
15
17
|
}
|
|
16
18
|
export declare const ExpandableSectionToggle: React.FunctionComponent<ExpandableSectionToggleProps>;
|
|
17
19
|
//# sourceMappingURL=ExpandableSectionToggle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpandableSectionToggle.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpandableSection/ExpandableSectionToggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,4BAA6B,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IACnF,qDAAqD;IACrD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uFAAuF;IACvF,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpandableSectionToggle.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpandableSection/ExpandableSectionToggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,4BAA6B,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IACnF,qDAAqD;IACrD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uFAAuF;IACvF,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC1B,uFAAuF;IACvF,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,iBAAiB,CAAC,4BAA4B,CAwCzF,CAAC"}
|
|
@@ -4,11 +4,11 @@ import styles from '@patternfly/react-styles/css/components/ExpandableSection/ex
|
|
|
4
4
|
import { css } from '@patternfly/react-styles';
|
|
5
5
|
import AngleRightIcon from '@patternfly/react-icons/dist/esm/icons/angle-right-icon';
|
|
6
6
|
export const ExpandableSectionToggle = (_a) => {
|
|
7
|
-
var { children, className = '', isExpanded = false, onToggle, contentId, direction = 'down' } = _a, props = __rest(_a, ["children", "className", "isExpanded", "onToggle", "contentId", "direction"]);
|
|
8
|
-
return (React.createElement("div", Object.assign({
|
|
7
|
+
var { children, className = '', isExpanded = false, onToggle, contentId, direction = 'down', hasTruncatedContent = false } = _a, props = __rest(_a, ["children", "className", "isExpanded", "onToggle", "contentId", "direction", "hasTruncatedContent"]);
|
|
8
|
+
return (React.createElement("div", Object.assign({ className: css(styles.expandableSection, isExpanded && styles.modifiers.expanded, styles.modifiers.detached, hasTruncatedContent && styles.modifiers.truncate, className) }, props),
|
|
9
9
|
React.createElement("button", { className: css(styles.expandableSectionToggle), type: "button", "aria-expanded": isExpanded, "aria-controls": contentId, onClick: () => onToggle(!isExpanded) },
|
|
10
|
-
React.createElement("span", { className: css(styles.expandableSectionToggleIcon, isExpanded && direction === 'up' && styles.modifiers.expandTop) },
|
|
11
|
-
React.createElement(AngleRightIcon, { "aria-hidden": true })),
|
|
10
|
+
!hasTruncatedContent && (React.createElement("span", { className: css(styles.expandableSectionToggleIcon, isExpanded && direction === 'up' && styles.modifiers.expandTop) },
|
|
11
|
+
React.createElement(AngleRightIcon, { "aria-hidden": true }))),
|
|
12
12
|
React.createElement("span", { className: css(styles.expandableSectionToggleText) }, children))));
|
|
13
13
|
};
|
|
14
14
|
ExpandableSectionToggle.displayName = 'ExpandableSectionToggle';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpandableSectionToggle.js","sourceRoot":"","sources":["../../../../src/components/ExpandableSection/ExpandableSectionToggle.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,8EAA8E,CAAC;AAClG,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,cAAc,MAAM,yDAAyD,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpandableSectionToggle.js","sourceRoot":"","sources":["../../../../src/components/ExpandableSection/ExpandableSectionToggle.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,8EAA8E,CAAC;AAClG,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AA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MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IACtE,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;CACjC;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,iBAAiB,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"InputGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/InputGroup/InputGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IACtE,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;CACjC;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,iBAAiB,CAAC,eAAe,CA0B/D,CAAC"}
|
|
@@ -11,9 +11,11 @@ export const InputGroup = (_a) => {
|
|
|
11
11
|
const idItem = React.Children.toArray(children).find((child) => !formCtrls.includes(child.type.displayName) && child.props.id);
|
|
12
12
|
const inputGroupRef = innerRef || React.useRef(null);
|
|
13
13
|
return (React.createElement("div", Object.assign({ ref: inputGroupRef, className: css(styles.inputGroup, className) }, props), idItem
|
|
14
|
-
? React.Children.map(children, (child) => formCtrls.includes(child.type.displayName)
|
|
15
|
-
?
|
|
16
|
-
: child
|
|
14
|
+
? React.Children.map(children, (child) => !formCtrls.includes(child.type.displayName) || child.props['aria-describedby']
|
|
15
|
+
? child
|
|
16
|
+
: React.cloneElement(child, {
|
|
17
|
+
'aria-describedby': child.props['aria-describedby'] === '' ? undefined : idItem.props.id
|
|
18
|
+
}))
|
|
17
19
|
: children));
|
|
18
20
|
};
|
|
19
21
|
InputGroup.displayName = 'InputGroup';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputGroup.js","sourceRoot":"","sources":["../../../../src/components/InputGroup/InputGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,gEAAgE,CAAC;AACpF,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAWzC,MAAM,CAAC,MAAM,UAAU,GAA6C,CAAC,EAKnD,EAAE,EAAE;QAL+C,EACnE,SAAS,GAAG,EAAE,EACd,QAAQ,EACR,QAAQ,OAEQ,EADb,KAAK,cAJ2D,qCAKpE,CADS;IAER,MAAM,SAAS,GAAG,CAAC,UAAU,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAClF,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAClD,CAAC,KAAU,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,EAAE,CACxC,CAAC;IAExC,MAAM,aAAa,GAAG,QAAQ,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAErD,OAAO,CACL,2CAAK,GAAG,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,UAAU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Aa,EAAE,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,UAAU,EAAE,SAAS,CAAC,IAAM,KAAK,GAC7E,MAAM;QACL,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAU,EAAE,EAAE,CAC1C,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,kBAAkB,CAAC;YAC5E,CAAC,CAAC,KAAK;YACP,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,EAAE;gBACxB,kBAAkB,EAAE,KAAK,CAAC,KAAK,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;aACzF,CAAC,CACP;QACH,CAAC,CAAC,QAAQ,CACR,CACP,CAAC;AACJ,CAAC,CAAC;AACF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ButtonProps } from '../Button';
|
|
3
|
+
import { ValidatedOptions } from '../../helpers';
|
|
3
4
|
export interface NumberInputProps extends React.HTMLProps<HTMLDivElement> {
|
|
4
5
|
/** Value of the number input */
|
|
5
6
|
value?: number;
|
|
@@ -9,6 +10,10 @@ export interface NumberInputProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
9
10
|
widthChars?: number;
|
|
10
11
|
/** Indicates the whole number input should be disabled */
|
|
11
12
|
isDisabled?: boolean;
|
|
13
|
+
/** Value to indicate if the input is modified to show that validation state
|
|
14
|
+
* @beta
|
|
15
|
+
*/
|
|
16
|
+
validated?: 'default' | 'error' | 'warning' | 'success' | ValidatedOptions;
|
|
12
17
|
/** Callback for the minus button */
|
|
13
18
|
onMinus?: (event: React.MouseEvent, name?: string) => void;
|
|
14
19
|
/** Callback for the text input changing */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../../../src/components/NumberInput/NumberInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAAU,WAAW,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../../../src/components/NumberInput/NumberInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAAU,WAAW,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAa,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAG5D,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IACvE,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,gBAAgB,CAAC;IAC3E,oCAAoC;IACpC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC9D,kEAAkE;IAClE,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,mCAAmC;IACnC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1D,8CAA8C;IAC9C,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,wEAAwE;IACxE,YAAY,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAClC,iFAAiF;IACjF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gFAAgF;IAChF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8BAA8B;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qCAAqC;IACrC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,oCAAoC;IACpC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oDAAoD;IACpD,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,sDAAsD;IACtD,aAAa,CAAC,EAAE,WAAW,CAAC;IAC5B,qDAAqD;IACrD,YAAY,CAAC,EAAE,WAAW,CAAC;CAC5B;AAeD,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAyFjE,CAAC"}
|
|
@@ -6,7 +6,8 @@ import MinusIcon from '@patternfly/react-icons/dist/esm/icons/minus-icon';
|
|
|
6
6
|
import PlusIcon from '@patternfly/react-icons/dist/esm/icons/plus-icon';
|
|
7
7
|
import { InputGroup } from '../InputGroup';
|
|
8
8
|
import { Button } from '../Button';
|
|
9
|
-
import { KEY_CODES } from '../../helpers';
|
|
9
|
+
import { KEY_CODES, ValidatedOptions } from '../../helpers';
|
|
10
|
+
import { TextInput } from '../TextInput';
|
|
10
11
|
const defaultKeyDownHandler = (args) => (event) => {
|
|
11
12
|
if (KEY_CODES.ARROW_UP === event.keyCode && args.onPlus) {
|
|
12
13
|
event.preventDefault();
|
|
@@ -18,7 +19,7 @@ const defaultKeyDownHandler = (args) => (event) => {
|
|
|
18
19
|
}
|
|
19
20
|
};
|
|
20
21
|
export const NumberInput = (_a) => {
|
|
21
|
-
var { value = 0, className, widthChars, isDisabled = false, onMinus = () => { }, onChange, onBlur, onPlus = () => { }, unit, unitPosition = 'after', min, max, inputName, inputAriaLabel = 'Input', minusBtnAriaLabel = 'Minus', plusBtnAriaLabel = 'Plus', inputProps, minusBtnProps, plusBtnProps } = _a, props = __rest(_a, ["value", "className", "widthChars", "isDisabled", "onMinus", "onChange", "onBlur", "onPlus", "unit", "unitPosition", "min", "max", "inputName", "inputAriaLabel", "minusBtnAriaLabel", "plusBtnAriaLabel", "inputProps", "minusBtnProps", "plusBtnProps"]);
|
|
22
|
+
var { value = 0, className, widthChars, isDisabled = false, validated = ValidatedOptions.default, onMinus = () => { }, onChange, onBlur, onPlus = () => { }, unit, unitPosition = 'after', min, max, inputName, inputAriaLabel = 'Input', minusBtnAriaLabel = 'Minus', plusBtnAriaLabel = 'Plus', inputProps, minusBtnProps, plusBtnProps } = _a, props = __rest(_a, ["value", "className", "widthChars", "isDisabled", "validated", "onMinus", "onChange", "onBlur", "onPlus", "unit", "unitPosition", "min", "max", "inputName", "inputAriaLabel", "minusBtnAriaLabel", "plusBtnAriaLabel", "inputProps", "minusBtnProps", "plusBtnProps"]);
|
|
22
23
|
const numberInputUnit = React.createElement("div", { className: css(styles.numberInputUnit) }, unit);
|
|
23
24
|
const keyDownHandler = inputProps && inputProps.onKeyDown ? inputProps.onKeyDown : defaultKeyDownHandler({ inputName, onMinus, onPlus });
|
|
24
25
|
const handleBlur = (event) => {
|
|
@@ -30,7 +31,7 @@ export const NumberInput = (_a) => {
|
|
|
30
31
|
onBlur(event);
|
|
31
32
|
}
|
|
32
33
|
};
|
|
33
|
-
return (React.createElement("div", Object.assign({ className: css(styles.numberInput, className) }, (widthChars && {
|
|
34
|
+
return (React.createElement("div", Object.assign({ className: css(styles.numberInput, validated !== 'default' && styles.modifiers.status, className) }, (widthChars && {
|
|
34
35
|
style: Object.assign({ '--pf-c-number-input--c-form-control--width-chars': widthChars }, props.style)
|
|
35
36
|
}), props),
|
|
36
37
|
unit && unitPosition === 'before' && numberInputUnit,
|
|
@@ -38,7 +39,7 @@ export const NumberInput = (_a) => {
|
|
|
38
39
|
React.createElement(Button, Object.assign({ variant: "control", "aria-label": minusBtnAriaLabel, isDisabled: isDisabled || value <= min, onClick: evt => onMinus(evt, inputName) }, minusBtnProps),
|
|
39
40
|
React.createElement("span", { className: css(styles.numberInputIcon) },
|
|
40
41
|
React.createElement(MinusIcon, { "aria-hidden": "true" }))),
|
|
41
|
-
React.createElement(
|
|
42
|
+
React.createElement(TextInput, Object.assign({ type: "number", value: value, name: inputName, "aria-label": inputAriaLabel }, (isDisabled && { isDisabled }), (onChange && { onChange: (value, event) => onChange(event) }), { onBlur: handleBlur }, (!onChange && { isReadOnly: true }), { onKeyDown: keyDownHandler, validated: validated }, inputProps)),
|
|
42
43
|
React.createElement(Button, Object.assign({ variant: "control", "aria-label": plusBtnAriaLabel, isDisabled: isDisabled || value >= max, onClick: evt => onPlus(evt, inputName) }, plusBtnProps),
|
|
43
44
|
React.createElement("span", { className: css(styles.numberInputIcon) },
|
|
44
45
|
React.createElement(PlusIcon, { "aria-hidden": "true" })))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInput.js","sourceRoot":"","sources":["../../../../src/components/NumberInput/NumberInput.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,kEAAkE,CAAC;AACtF,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,SAAS,MAAM,mDAAmD,CAAC;AAC1E,OAAO,QAAQ,MAAM,kDAAkD,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAe,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"NumberInput.js","sourceRo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
|
+
export declare enum ExpandableSectionVariant {
|
|
4
|
+
default = "default",
|
|
5
|
+
truncate = "truncate"
|
|
6
|
+
}
|
|
3
7
|
export interface ExpandableSectionProps extends React.HTMLProps<HTMLDivElement> {
|
|
4
|
-
/** Content rendered inside the
|
|
8
|
+
/** Content rendered inside the expandable section. */
|
|
5
9
|
children?: React.ReactNode;
|
|
6
|
-
/** Additional classes added to the
|
|
10
|
+
/** Additional classes added to the expandable section. */
|
|
7
11
|
className?: string;
|
|
8
12
|
/** Flag to indicate if the content is expanded */
|
|
9
13
|
isExpanded?: boolean;
|
|
@@ -15,7 +19,7 @@ export interface ExpandableSectionProps extends React.HTMLProps<HTMLDivElement>
|
|
|
15
19
|
toggleTextCollapsed?: string;
|
|
16
20
|
/** React node that appears in the attached toggle in place of toggle text */
|
|
17
21
|
toggleContent?: React.ReactNode;
|
|
18
|
-
/** Callback function to toggle the expandable
|
|
22
|
+
/** Callback function to toggle the expandable section. Detached expandable sections should use the onToggle property of the expandable section toggle sub-component. */
|
|
19
23
|
onToggle?: (isExpanded: boolean) => void;
|
|
20
24
|
/** Forces active state */
|
|
21
25
|
isActive?: boolean;
|
|
@@ -29,6 +33,13 @@ export interface ExpandableSectionProps extends React.HTMLProps<HTMLDivElement>
|
|
|
29
33
|
isWidthLimited?: boolean;
|
|
30
34
|
/** Flag to indicate if the content is indented */
|
|
31
35
|
isIndented?: boolean;
|
|
36
|
+
/** @beta Determines the variant of the expandable section. When passing in "truncate" as the
|
|
37
|
+
* variant, the expandable content will be truncated after 3 lines by default.
|
|
38
|
+
*/
|
|
39
|
+
variant?: 'default' | 'truncate';
|
|
40
|
+
/** @beta Truncates the expandable content to the specified number of lines when using the
|
|
41
|
+
* "truncate" variant. */
|
|
42
|
+
truncateMaxLines?: number;
|
|
32
43
|
}
|
|
33
44
|
interface ExpandableSectionState {
|
|
34
45
|
isExpanded: boolean;
|
|
@@ -36,8 +47,11 @@ interface ExpandableSectionState {
|
|
|
36
47
|
export declare class ExpandableSection extends React.Component<ExpandableSectionProps, ExpandableSectionState> {
|
|
37
48
|
static displayName: string;
|
|
38
49
|
constructor(props: ExpandableSectionProps);
|
|
50
|
+
expandableContentRef: React.RefObject<HTMLDivElement>;
|
|
39
51
|
static defaultProps: PickOptional<ExpandableSectionProps>;
|
|
40
52
|
private calculateToggleText;
|
|
53
|
+
componentDidMount(): void;
|
|
54
|
+
componentDidUpdate(prevProps: ExpandableSectionProps): void;
|
|
41
55
|
render(): JSX.Element;
|
|
42
56
|
}
|
|
43
57
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpandableSection.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpandableSection/ExpandableSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpandableSection.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpandableSection/ExpandableSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,oBAAY,wBAAwB;IAClC,OAAO,YAAY;IACnB,QAAQ,aAAa;CACtB;AAED,MAAM,WAAW,sBAAuB,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IAC7E,sDAAsD;IACtD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,+CAA+C;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yKAAyK;IACzK,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,0KAA0K;IAC1K,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,6EAA6E;IAC7E,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,wKAAwK;IACxK,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,WAAW,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAClC,kGAAkG;IAClG,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kDAAkD;IAClD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IACjC;6BACyB;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,UAAU,sBAAsB;IAC9B,UAAU,EAAE,OAAO,CAAC;CACrB;AAUD,qBAAa,iBAAkB,SAAQ,KAAK,CAAC,SAAS,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;IACpG,MAAM,CAAC,WAAW,SAAuB;gBAC7B,KAAK,EAAE,sBAAsB;IAQzC,oBAAoB,kCAAqC;IACzD,MAAM,CAAC,YAAY,EAAE,YAAY,CAAC,sBAAsB,CAAC,CAcvD;IAEF,OAAO,CAAC,mBAAmB;IAe3B,iBAAiB;IAOjB,kBAAkB,CAAC,SAAS,EAAE,sBAAsB;IAUpD,MAAM;CAoFP"}
|
|
@@ -1,14 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ExpandableSection = void 0;
|
|
3
|
+
exports.ExpandableSection = exports.ExpandableSectionVariant = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const expandable_section_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/components/ExpandableSection/expandable-section"));
|
|
7
7
|
const react_styles_1 = require("@patternfly/react-styles");
|
|
8
|
+
const c_expandable_section_m_truncate__content_LineClamp_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/c_expandable_section_m_truncate__content_LineClamp'));
|
|
8
9
|
const angle_right_icon_1 = tslib_1.__importDefault(require('@patternfly/react-icons/dist/js/icons/angle-right-icon'));
|
|
10
|
+
var ExpandableSectionVariant;
|
|
11
|
+
(function (ExpandableSectionVariant) {
|
|
12
|
+
ExpandableSectionVariant["default"] = "default";
|
|
13
|
+
ExpandableSectionVariant["truncate"] = "truncate";
|
|
14
|
+
})(ExpandableSectionVariant = exports.ExpandableSectionVariant || (exports.ExpandableSectionVariant = {}));
|
|
15
|
+
const setLineClamp = (lines, element) => {
|
|
16
|
+
if (!element || lines < 1) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
element.style.setProperty(c_expandable_section_m_truncate__content_LineClamp_1.default.name, lines.toString());
|
|
20
|
+
};
|
|
9
21
|
class ExpandableSection extends React.Component {
|
|
10
22
|
constructor(props) {
|
|
11
23
|
super(props);
|
|
24
|
+
this.expandableContentRef = React.createRef();
|
|
12
25
|
this.state = {
|
|
13
26
|
isExpanded: props.isExpanded
|
|
14
27
|
};
|
|
@@ -22,10 +35,25 @@ class ExpandableSection extends React.Component {
|
|
|
22
35
|
}
|
|
23
36
|
return toggleText;
|
|
24
37
|
}
|
|
38
|
+
componentDidMount() {
|
|
39
|
+
if (this.props.variant === ExpandableSectionVariant.truncate && this.props.truncateMaxLines) {
|
|
40
|
+
const expandableContent = this.expandableContentRef.current;
|
|
41
|
+
setLineClamp(this.props.truncateMaxLines, expandableContent);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
componentDidUpdate(prevProps) {
|
|
45
|
+
if (this.props.variant === ExpandableSectionVariant.truncate &&
|
|
46
|
+
prevProps.truncateMaxLines !== this.props.truncateMaxLines) {
|
|
47
|
+
const expandableContent = this.expandableContentRef.current;
|
|
48
|
+
setLineClamp(this.props.truncateMaxLines, expandableContent);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
25
51
|
render() {
|
|
26
52
|
const _a = this.props, { onToggle: onToggleProp,
|
|
27
53
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
28
|
-
isActive, className, toggleText, toggleTextExpanded, toggleTextCollapsed, toggleContent, children, isExpanded, isDetached, displaySize, isWidthLimited, isIndented, contentId
|
|
54
|
+
isActive, className, toggleText, toggleTextExpanded, toggleTextCollapsed, toggleContent, children, isExpanded, isDetached, displaySize, isWidthLimited, isIndented, contentId, variant,
|
|
55
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
56
|
+
truncateMaxLines } = _a, props = tslib_1.__rest(_a, ["onToggle", "isActive", "className", "toggleText", "toggleTextExpanded", "toggleTextCollapsed", "toggleContent", "children", "isExpanded", "isDetached", "displaySize", "isWidthLimited", "isIndented", "contentId", "variant", "truncateMaxLines"]);
|
|
29
57
|
let onToggle = onToggleProp;
|
|
30
58
|
let propOrStateIsExpanded = isExpanded;
|
|
31
59
|
// uncontrolled
|
|
@@ -36,12 +64,14 @@ class ExpandableSection extends React.Component {
|
|
|
36
64
|
};
|
|
37
65
|
}
|
|
38
66
|
const computedToggleText = this.calculateToggleText(toggleText, toggleTextExpanded, toggleTextCollapsed, propOrStateIsExpanded);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
React.createElement(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
67
|
+
const expandableToggle = !isDetached && (React.createElement("button", { className: react_styles_1.css(expandable_section_1.default.expandableSectionToggle), type: "button", "aria-expanded": propOrStateIsExpanded, onClick: () => onToggle(!propOrStateIsExpanded) },
|
|
68
|
+
variant !== ExpandableSectionVariant.truncate && (React.createElement("span", { className: react_styles_1.css(expandable_section_1.default.expandableSectionToggleIcon) },
|
|
69
|
+
React.createElement(angle_right_icon_1.default, { "aria-hidden": true }))),
|
|
70
|
+
React.createElement("span", { className: react_styles_1.css(expandable_section_1.default.expandableSectionToggleText) }, toggleContent || computedToggleText)));
|
|
71
|
+
return (React.createElement("div", Object.assign({ className: react_styles_1.css(expandable_section_1.default.expandableSection, propOrStateIsExpanded && expandable_section_1.default.modifiers.expanded, isActive && expandable_section_1.default.modifiers.active, isDetached && expandable_section_1.default.modifiers.detached, displaySize === 'large' && expandable_section_1.default.modifiers.displayLg, isWidthLimited && expandable_section_1.default.modifiers.limitWidth, isIndented && expandable_section_1.default.modifiers.indented, variant === ExpandableSectionVariant.truncate && expandable_section_1.default.modifiers.truncate, className) }, props),
|
|
72
|
+
variant === ExpandableSectionVariant.default && expandableToggle,
|
|
73
|
+
React.createElement("div", { ref: this.expandableContentRef, className: react_styles_1.css(expandable_section_1.default.expandableSectionContent), hidden: variant !== ExpandableSectionVariant.truncate && !propOrStateIsExpanded, id: contentId }, children),
|
|
74
|
+
variant === ExpandableSectionVariant.truncate && expandableToggle));
|
|
45
75
|
}
|
|
46
76
|
}
|
|
47
77
|
exports.ExpandableSection = ExpandableSection;
|
|
@@ -58,6 +88,7 @@ ExpandableSection.defaultProps = {
|
|
|
58
88
|
displaySize: 'default',
|
|
59
89
|
isWidthLimited: false,
|
|
60
90
|
isIndented: false,
|
|
61
|
-
contentId: ''
|
|
91
|
+
contentId: '',
|
|
92
|
+
variant: 'default'
|
|
62
93
|
};
|
|
63
94
|
//# sourceMappingURL=ExpandableSection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpandableSection.js","sourceRoot":"","sources":["../../../../src/components/ExpandableSection/ExpandableSection.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAC/B,8IAAkG;AAClG,2DAA+C;AAC/C,sHAAqF;
|
|
1
|
+
{"version":3,"file":"ExpandableSection.js","sourceRoot":"","sources":["../../../../src/components/ExpandableSection/ExpandableSection.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAC/B,8IAAkG;AAClG,2DAA+C;AAC/C,qLAA6G;AAC7G,sHAAqF;AAGrF,IAA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,CACP,CAAC;IACJ,CAAC;;AA9IH,8CA+IC;AA9IQ,6BAAW,GAAG,mBAAmB,CAAC;AAUlC,8BAAY,GAAyC;IAC1D,SAAS,EAAE,EAAE;IACb,UAAU,EAAE,EAAE;IACd,kBAAkB,EAAE,EAAE;IACtB,mBAAmB,EAAE,EAAE;IACvB,6DAA6D;IAC7D,QAAQ,EAAE,CAAC,UAAU,EAAQ,EAAE,CAAC,SAAS;IACzC,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE,KAAK;IACjB,WAAW,EAAE,SAAS;IACtB,cAAc,EAAE,KAAK;IACrB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,SAAS;CACnB,CAAC"}
|
|
@@ -12,6 +12,8 @@ export interface ExpandableSectionToggleProps extends React.HTMLProps<HTMLDivEle
|
|
|
12
12
|
contentId?: string;
|
|
13
13
|
/** Direction the toggle arrow should point when the expandable section is expanded. */
|
|
14
14
|
direction?: 'up' | 'down';
|
|
15
|
+
/** @beta Flag to determine toggle styling when the expandable content is truncated. */
|
|
16
|
+
hasTruncatedContent?: boolean;
|
|
15
17
|
}
|
|
16
18
|
export declare const ExpandableSectionToggle: React.FunctionComponent<ExpandableSectionToggleProps>;
|
|
17
19
|
//# sourceMappingURL=ExpandableSectionToggle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpandableSectionToggle.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpandableSection/ExpandableSectionToggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,4BAA6B,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IACnF,qDAAqD;IACrD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uFAAuF;IACvF,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpandableSectionToggle.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpandableSection/ExpandableSectionToggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,4BAA6B,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IACnF,qDAAqD;IACrD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uFAAuF;IACvF,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC1B,uFAAuF;IACvF,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,iBAAiB,CAAC,4BAA4B,CAwCzF,CAAC"}
|
|
@@ -7,11 +7,11 @@ const expandable_section_1 = tslib_1.__importDefault(require("@patternfly/react-
|
|
|
7
7
|
const react_styles_1 = require("@patternfly/react-styles");
|
|
8
8
|
const angle_right_icon_1 = tslib_1.__importDefault(require('@patternfly/react-icons/dist/js/icons/angle-right-icon'));
|
|
9
9
|
const ExpandableSectionToggle = (_a) => {
|
|
10
|
-
var { children, className = '', isExpanded = false, onToggle, contentId, direction = 'down' } = _a, props = tslib_1.__rest(_a, ["children", "className", "isExpanded", "onToggle", "contentId", "direction"]);
|
|
11
|
-
return (React.createElement("div", Object.assign({
|
|
10
|
+
var { children, className = '', isExpanded = false, onToggle, contentId, direction = 'down', hasTruncatedContent = false } = _a, props = tslib_1.__rest(_a, ["children", "className", "isExpanded", "onToggle", "contentId", "direction", "hasTruncatedContent"]);
|
|
11
|
+
return (React.createElement("div", Object.assign({ className: react_styles_1.css(expandable_section_1.default.expandableSection, isExpanded && expandable_section_1.default.modifiers.expanded, expandable_section_1.default.modifiers.detached, hasTruncatedContent && expandable_section_1.default.modifiers.truncate, className) }, props),
|
|
12
12
|
React.createElement("button", { className: react_styles_1.css(expandable_section_1.default.expandableSectionToggle), type: "button", "aria-expanded": isExpanded, "aria-controls": contentId, onClick: () => onToggle(!isExpanded) },
|
|
13
|
-
React.createElement("span", { className: react_styles_1.css(expandable_section_1.default.expandableSectionToggleIcon, isExpanded && direction === 'up' && expandable_section_1.default.modifiers.expandTop) },
|
|
14
|
-
React.createElement(angle_right_icon_1.default, { "aria-hidden": true })),
|
|
13
|
+
!hasTruncatedContent && (React.createElement("span", { className: react_styles_1.css(expandable_section_1.default.expandableSectionToggleIcon, isExpanded && direction === 'up' && expandable_section_1.default.modifiers.expandTop) },
|
|
14
|
+
React.createElement(angle_right_icon_1.default, { "aria-hidden": true }))),
|
|
15
15
|
React.createElement("span", { className: react_styles_1.css(expandable_section_1.default.expandableSectionToggleText) }, children))));
|
|
16
16
|
};
|
|
17
17
|
exports.ExpandableSectionToggle = ExpandableSectionToggle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpandableSectionToggle.js","sourceRoot":"","sources":["../../../../src/components/ExpandableSection/ExpandableSectionToggle.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAC/B,8IAAkG;AAClG,2DAA+C;AAC/C,sHAAqF;
|
|
1
|
+
{"version":3,"file":"ExpandableSectionToggle.js","sourceRoot":"","sources":["../../../../src/components/ExpandableSection/ExpandableSectionToggle.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Group/InputGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IACtE,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;CACjC;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,iBAAiB,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"InputGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/InputGroup/InputGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IACtE,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;CACjC;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,iBAAiB,CAAC,eAAe,CA0B/D,CAAC"}
|
|
@@ -14,9 +14,11 @@ const InputGroup = (_a) => {
|
|
|
14
14
|
const idItem = React.Children.toArray(children).find((child) => !formCtrls.includes(child.type.displayName) && child.props.id);
|
|
15
15
|
const inputGroupRef = innerRef || React.useRef(null);
|
|
16
16
|
return (React.createElement("div", Object.assign({ ref: inputGroupRef, className: react_styles_1.css(input_group_1.default.inputGroup, className) }, props), idItem
|
|
17
|
-
? React.Children.map(children, (child) => formCtrls.includes(child.type.displayName)
|
|
18
|
-
?
|
|
19
|
-
: child
|
|
17
|
+
? React.Children.map(children, (child) => !formCtrls.includes(child.type.displayName) || child.props['aria-describedby']
|
|
18
|
+
? child
|
|
19
|
+
: React.cloneElement(child, {
|
|
20
|
+
'aria-describedby': child.props['aria-describedby'] === '' ? undefined : idItem.props.id
|
|
21
|
+
}))
|
|
20
22
|
: children));
|
|
21
23
|
};
|
|
22
24
|
exports.InputGroup = InputGroup;
|