@patternfly/react-core 6.0.0-alpha.77 → 6.0.0-alpha.79
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 +12 -0
- package/components/package.json +1 -1
- package/deprecated/package.json +1 -1
- package/dist/dynamic/components/AboutModal/package.json +1 -1
- package/dist/dynamic/components/Accordion/package.json +1 -1
- package/dist/dynamic/components/ActionList/package.json +1 -1
- package/dist/dynamic/components/Alert/package.json +1 -1
- package/dist/dynamic/components/Avatar/package.json +1 -1
- package/dist/dynamic/components/BackToTop/package.json +1 -1
- package/dist/dynamic/components/Backdrop/package.json +1 -1
- package/dist/dynamic/components/BackgroundImage/package.json +1 -1
- package/dist/dynamic/components/Badge/package.json +1 -1
- package/dist/dynamic/components/Banner/package.json +1 -1
- package/dist/dynamic/components/Brand/package.json +1 -1
- package/dist/dynamic/components/Breadcrumb/package.json +1 -1
- package/dist/dynamic/components/Button/package.json +1 -1
- package/dist/dynamic/components/CalendarMonth/package.json +1 -1
- package/dist/dynamic/components/Card/package.json +1 -1
- package/dist/dynamic/components/Checkbox/package.json +1 -1
- package/dist/dynamic/components/ClipboardCopy/package.json +1 -1
- package/dist/dynamic/components/CodeBlock/package.json +1 -1
- package/dist/dynamic/components/Content/package.json +1 -1
- package/dist/dynamic/components/DataList/package.json +1 -1
- package/dist/dynamic/components/DatePicker/package.json +1 -1
- package/dist/dynamic/components/DescriptionList/package.json +1 -1
- package/dist/dynamic/components/Divider/package.json +1 -1
- package/dist/dynamic/components/Drawer/package.json +1 -1
- package/dist/dynamic/components/Dropdown/package.json +1 -1
- package/dist/dynamic/components/DualListSelector/package.json +1 -1
- package/dist/dynamic/components/EmptyState/package.json +1 -1
- package/dist/dynamic/components/ExpandableSection/package.json +1 -1
- package/dist/dynamic/components/FileUpload/package.json +1 -1
- package/dist/dynamic/components/Form/package.json +1 -1
- package/dist/dynamic/components/FormSelect/package.json +1 -1
- package/dist/dynamic/components/HelperText/package.json +1 -1
- package/dist/dynamic/components/Hint/package.json +1 -1
- package/dist/dynamic/components/Icon/package.json +1 -1
- package/dist/dynamic/components/InputGroup/package.json +1 -1
- package/dist/dynamic/components/JumpLinks/package.json +1 -1
- package/dist/dynamic/components/Label/package.json +1 -1
- package/dist/dynamic/components/List/package.json +1 -1
- package/dist/dynamic/components/LoginPage/package.json +1 -1
- package/dist/dynamic/components/Masthead/package.json +1 -1
- package/dist/dynamic/components/Menu/package.json +1 -1
- package/dist/dynamic/components/MenuToggle/package.json +1 -1
- package/dist/dynamic/components/Modal/package.json +1 -1
- package/dist/dynamic/components/MultipleFileUpload/package.json +1 -1
- package/dist/dynamic/components/Nav/package.json +1 -1
- package/dist/dynamic/components/NotificationBadge/package.json +1 -1
- package/dist/dynamic/components/NotificationDrawer/package.json +1 -1
- package/dist/dynamic/components/NumberInput/package.json +1 -1
- package/dist/dynamic/components/OverflowMenu/package.json +1 -1
- package/dist/dynamic/components/Page/package.json +1 -1
- package/dist/dynamic/components/Pagination/package.json +1 -1
- package/dist/dynamic/components/Panel/package.json +1 -1
- package/dist/dynamic/components/Popover/package.json +1 -1
- package/dist/dynamic/components/Progress/package.json +1 -1
- package/dist/dynamic/components/ProgressStepper/package.json +1 -1
- package/dist/dynamic/components/Radio/package.json +1 -1
- package/dist/dynamic/components/SearchInput/package.json +1 -1
- package/dist/dynamic/components/Select/package.json +1 -1
- package/dist/dynamic/components/Sidebar/package.json +1 -1
- package/dist/dynamic/components/SimpleList/package.json +1 -1
- package/dist/dynamic/components/Skeleton/package.json +1 -1
- package/dist/dynamic/components/SkipToContent/package.json +1 -1
- package/dist/dynamic/components/Slider/package.json +1 -1
- package/dist/dynamic/components/Spinner/package.json +1 -1
- package/dist/dynamic/components/Switch/package.json +1 -1
- package/dist/dynamic/components/Tabs/package.json +1 -1
- package/dist/dynamic/components/TextArea/package.json +1 -1
- package/dist/dynamic/components/TextInput/package.json +1 -1
- package/dist/dynamic/components/TextInputGroup/package.json +1 -1
- package/dist/dynamic/components/Tile/package.json +1 -1
- package/dist/dynamic/components/TimePicker/package.json +1 -1
- package/dist/dynamic/components/Timestamp/package.json +1 -1
- package/dist/dynamic/components/Title/package.json +1 -1
- package/dist/dynamic/components/ToggleGroup/package.json +1 -1
- package/dist/dynamic/components/Toolbar/package.json +1 -1
- package/dist/dynamic/components/Tooltip/package.json +1 -1
- package/dist/dynamic/components/TreeView/package.json +1 -1
- package/dist/dynamic/components/Truncate/package.json +1 -1
- package/dist/dynamic/components/Wizard/hooks/package.json +1 -1
- package/dist/dynamic/components/Wizard/package.json +1 -1
- package/dist/dynamic/deprecated/components/Chip/package.json +1 -1
- package/dist/dynamic/deprecated/components/DragDrop/package.json +1 -1
- package/dist/dynamic/deprecated/components/DualListSelector/package.json +1 -1
- package/dist/dynamic/deprecated/components/Modal/package.json +1 -1
- package/dist/dynamic/deprecated/components/Wizard/package.json +1 -1
- package/dist/dynamic/deprecated/components/package.json +1 -1
- package/dist/dynamic/helpers/FocusTrap/FocusTrap/package.json +1 -1
- package/dist/dynamic/helpers/GenerateId/GenerateId/package.json +1 -1
- package/dist/dynamic/helpers/KeyboardHandler/package.json +1 -1
- package/dist/dynamic/helpers/OUIA/ouia/package.json +1 -1
- package/dist/dynamic/helpers/Popper/Popper/package.json +1 -1
- package/dist/dynamic/helpers/constants/package.json +1 -1
- package/dist/dynamic/helpers/datetimeUtils/package.json +1 -1
- package/dist/dynamic/helpers/fileUtils/package.json +1 -1
- package/dist/dynamic/helpers/htmlConstants/package.json +1 -1
- package/dist/dynamic/helpers/package.json +1 -1
- package/dist/dynamic/helpers/resizeObserver/package.json +1 -1
- package/dist/dynamic/helpers/typeUtils/package.json +1 -1
- package/dist/dynamic/helpers/useInterval/package.json +1 -1
- package/dist/dynamic/helpers/useIsomorphicLayout/package.json +1 -1
- package/dist/dynamic/helpers/useUnmountEffect/package.json +1 -1
- package/dist/dynamic/helpers/util/package.json +1 -1
- package/dist/dynamic/layouts/Bullseye/package.json +1 -1
- package/dist/dynamic/layouts/Flex/package.json +1 -1
- package/dist/dynamic/layouts/Gallery/package.json +1 -1
- package/dist/dynamic/layouts/Grid/package.json +1 -1
- package/dist/dynamic/layouts/Level/package.json +1 -1
- package/dist/dynamic/layouts/Split/package.json +1 -1
- package/dist/dynamic/layouts/Stack/package.json +1 -1
- package/dist/dynamic/styles/package.json +1 -1
- package/dist/dynamic-modules.json +2 -2
- package/dist/esm/components/ExpandableSection/ExpandableSection.d.ts.map +1 -1
- package/dist/esm/components/ExpandableSection/ExpandableSection.js +6 -4
- package/dist/esm/components/ExpandableSection/ExpandableSection.js.map +1 -1
- package/dist/esm/components/JumpLinks/JumpLinks.d.ts.map +1 -1
- package/dist/esm/components/JumpLinks/JumpLinks.js +2 -7
- package/dist/esm/components/JumpLinks/JumpLinks.js.map +1 -1
- package/dist/esm/components/Page/PageSidebarBody.d.ts +2 -0
- package/dist/esm/components/Page/PageSidebarBody.d.ts.map +1 -1
- package/dist/esm/components/Page/PageSidebarBody.js +2 -2
- package/dist/esm/components/Page/PageSidebarBody.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/esm/components/Tabs/Tabs.js +2 -4
- package/dist/esm/components/Tabs/Tabs.js.map +1 -1
- package/dist/esm/components/Toolbar/Toolbar.d.ts +5 -5
- package/dist/esm/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/Toolbar.js +6 -6
- package/dist/esm/components/Toolbar/Toolbar.js.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarContent.d.ts +1 -1
- package/dist/esm/components/Toolbar/ToolbarContent.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarContent.js +2 -2
- package/dist/esm/components/Toolbar/ToolbarContent.js.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarExpandableContent.d.ts +2 -2
- package/dist/esm/components/Toolbar/ToolbarExpandableContent.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarExpandableContent.js +7 -7
- package/dist/esm/components/Toolbar/ToolbarExpandableContent.js.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarFilter.d.ts +21 -21
- package/dist/esm/components/Toolbar/ToolbarFilter.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarFilter.js +15 -15
- package/dist/esm/components/Toolbar/ToolbarFilter.js.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarGroup.d.ts +1 -1
- package/dist/esm/components/Toolbar/ToolbarGroup.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarItem.d.ts +2 -2
- package/dist/esm/components/Toolbar/ToolbarItem.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarItem.js +2 -2
- package/dist/esm/components/Toolbar/ToolbarItem.js.map +1 -1
- package/dist/esm/components/Toolbar/{ToolbarChipGroupContent.d.ts → ToolbarLabelGroupContent.d.ts} +10 -10
- package/dist/esm/components/Toolbar/ToolbarLabelGroupContent.d.ts.map +1 -0
- package/dist/esm/components/Toolbar/{ToolbarChipGroupContent.js → ToolbarLabelGroupContent.js} +11 -11
- package/dist/esm/components/Toolbar/ToolbarLabelGroupContent.js.map +1 -0
- package/dist/esm/components/Toolbar/ToolbarToggleGroup.d.ts +2 -2
- package/dist/esm/components/Toolbar/ToolbarToggleGroup.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarToggleGroup.js +4 -4
- package/dist/esm/components/Toolbar/ToolbarToggleGroup.js.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarUtils.d.ts +3 -3
- package/dist/esm/components/Toolbar/ToolbarUtils.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarUtils.js +2 -2
- package/dist/esm/components/Toolbar/ToolbarUtils.js.map +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSection.d.ts.map +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSection.js +6 -4
- package/dist/js/components/ExpandableSection/ExpandableSection.js.map +1 -1
- package/dist/js/components/JumpLinks/JumpLinks.d.ts.map +1 -1
- package/dist/js/components/JumpLinks/JumpLinks.js +2 -7
- package/dist/js/components/JumpLinks/JumpLinks.js.map +1 -1
- package/dist/js/components/Page/PageSidebarBody.d.ts +2 -0
- package/dist/js/components/Page/PageSidebarBody.d.ts.map +1 -1
- package/dist/js/components/Page/PageSidebarBody.js +2 -2
- package/dist/js/components/Page/PageSidebarBody.js.map +1 -1
- package/dist/js/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/js/components/Tabs/Tabs.js +2 -4
- package/dist/js/components/Tabs/Tabs.js.map +1 -1
- package/dist/js/components/Toolbar/Toolbar.d.ts +5 -5
- package/dist/js/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/js/components/Toolbar/Toolbar.js +6 -6
- package/dist/js/components/Toolbar/Toolbar.js.map +1 -1
- package/dist/js/components/Toolbar/ToolbarContent.d.ts +1 -1
- package/dist/js/components/Toolbar/ToolbarContent.d.ts.map +1 -1
- package/dist/js/components/Toolbar/ToolbarContent.js +2 -2
- package/dist/js/components/Toolbar/ToolbarContent.js.map +1 -1
- package/dist/js/components/Toolbar/ToolbarExpandableContent.d.ts +2 -2
- package/dist/js/components/Toolbar/ToolbarExpandableContent.d.ts.map +1 -1
- package/dist/js/components/Toolbar/ToolbarExpandableContent.js +7 -7
- package/dist/js/components/Toolbar/ToolbarExpandableContent.js.map +1 -1
- package/dist/js/components/Toolbar/ToolbarFilter.d.ts +21 -21
- package/dist/js/components/Toolbar/ToolbarFilter.d.ts.map +1 -1
- package/dist/js/components/Toolbar/ToolbarFilter.js +15 -15
- package/dist/js/components/Toolbar/ToolbarFilter.js.map +1 -1
- package/dist/js/components/Toolbar/ToolbarGroup.d.ts +1 -1
- package/dist/js/components/Toolbar/ToolbarGroup.d.ts.map +1 -1
- package/dist/js/components/Toolbar/ToolbarItem.d.ts +2 -2
- package/dist/js/components/Toolbar/ToolbarItem.d.ts.map +1 -1
- package/dist/js/components/Toolbar/ToolbarItem.js +2 -2
- package/dist/js/components/Toolbar/ToolbarItem.js.map +1 -1
- package/dist/js/components/Toolbar/{ToolbarChipGroupContent.d.ts → ToolbarLabelGroupContent.d.ts} +10 -10
- package/dist/js/components/Toolbar/ToolbarLabelGroupContent.d.ts.map +1 -0
- package/dist/js/components/Toolbar/{ToolbarChipGroupContent.js → ToolbarLabelGroupContent.js} +12 -12
- package/dist/js/components/Toolbar/ToolbarLabelGroupContent.js.map +1 -0
- package/dist/js/components/Toolbar/ToolbarToggleGroup.d.ts +2 -2
- package/dist/js/components/Toolbar/ToolbarToggleGroup.d.ts.map +1 -1
- package/dist/js/components/Toolbar/ToolbarToggleGroup.js +4 -4
- package/dist/js/components/Toolbar/ToolbarToggleGroup.js.map +1 -1
- package/dist/js/components/Toolbar/ToolbarUtils.d.ts +3 -3
- package/dist/js/components/Toolbar/ToolbarUtils.d.ts.map +1 -1
- package/dist/js/components/Toolbar/ToolbarUtils.js +2 -2
- package/dist/js/components/Toolbar/ToolbarUtils.js.map +1 -1
- package/dist/styles/assets/images/img_avatar-dark.svg +22 -16
- package/dist/styles/assets/images/img_avatar-light.svg +25 -18
- package/dist/styles/assets/pficon/pf-v6-pficon.woff2 +0 -0
- package/dist/styles/assets/pficon/pficon.scss +36 -0
- package/dist/styles/base-no-reset.css +936 -905
- package/dist/styles/base.css +936 -905
- package/dist/umd/assets/{output-BHzG532B.css → output-Rz4e1DgY.css} +2827 -3613
- package/dist/umd/react-core.min.js +3 -3
- package/helpers/package.json +1 -1
- package/layouts/package.json +1 -1
- package/next/package.json +1 -1
- package/package.json +6 -6
- package/src/components/ExpandableSection/ExpandableSection.tsx +6 -4
- package/src/components/JumpLinks/JumpLinks.tsx +6 -4
- package/src/components/JumpLinks/__tests__/__snapshots__/JumpLinks.test.tsx.snap +6 -6
- package/src/components/Page/PageSidebarBody.tsx +4 -0
- package/src/components/Page/examples/PageMultipleSidebarBody.tsx +6 -3
- package/src/components/Tabs/Tabs.tsx +6 -8
- package/src/components/Tabs/__tests__/__snapshots__/Tabs.test.tsx.snap +5 -3
- package/src/components/Toolbar/Toolbar.tsx +12 -12
- package/src/components/Toolbar/ToolbarContent.tsx +2 -2
- package/src/components/Toolbar/ToolbarExpandableContent.tsx +9 -9
- package/src/components/Toolbar/ToolbarFilter.tsx +51 -51
- package/src/components/Toolbar/ToolbarGroup.tsx +1 -1
- package/src/components/Toolbar/ToolbarItem.tsx +3 -3
- package/src/components/Toolbar/{ToolbarChipGroupContent.tsx → ToolbarLabelGroupContent.tsx} +17 -17
- package/src/components/Toolbar/ToolbarToggleGroup.tsx +7 -7
- package/src/components/Toolbar/ToolbarUtils.tsx +5 -5
- package/src/components/Toolbar/__tests__/Generated/ToolbarChipGroupContent.test.tsx +4 -4
- package/src/components/Toolbar/__tests__/Generated/ToolbarExpandableContent.test.tsx +1 -1
- package/src/components/Toolbar/__tests__/Generated/__snapshots__/ToolbarChipGroupContent.test.tsx.snap +1 -1
- package/src/components/Toolbar/__tests__/Toolbar.test.tsx +6 -6
- package/src/components/Toolbar/__tests__/__snapshots__/Toolbar.test.tsx.snap +2 -2
- package/src/components/Toolbar/examples/Toolbar.md +5 -5
- package/src/components/Toolbar/examples/{ToolbarCustomChipGroupContent.tsx → ToolbarCustomLabelGroupContent.tsx} +10 -10
- package/src/components/Toolbar/examples/ToolbarWithFilters.tsx +5 -5
- package/src/demos/CardView/examples/CardView.tsx +2 -2
- package/src/demos/Filters/examples/FilterAttributeSearch.tsx +9 -9
- package/src/demos/Filters/examples/FilterCheckboxSelect.tsx +3 -3
- package/src/demos/Filters/examples/FilterFaceted.tsx +9 -9
- package/src/demos/Filters/examples/FilterMixedSelectGroup.tsx +6 -6
- package/src/demos/Page.md +6 -0
- package/src/demos/examples/Page/PageContextSelector.tsx +319 -0
- package/src/demos/examples/PrimaryDetail/PrimaryDetailCardView.tsx +2 -2
- package/dist/esm/components/Toolbar/ToolbarChipGroupContent.d.ts.map +0 -1
- package/dist/esm/components/Toolbar/ToolbarChipGroupContent.js.map +0 -1
- package/dist/js/components/Toolbar/ToolbarChipGroupContent.d.ts.map +0 -1
- package/dist/js/components/Toolbar/ToolbarChipGroupContent.js.map +0 -1
package/helpers/package.json
CHANGED
package/layouts/package.json
CHANGED
package/next/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "6.0.0-alpha.
|
|
3
|
+
"version": "6.0.0-alpha.79",
|
|
4
4
|
"description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
|
|
5
5
|
"main": "dist/js/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -47,15 +47,15 @@
|
|
|
47
47
|
"clean:exports": "node scripts/cleanDistExports.js"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@patternfly/react-icons": "^6.0.0-alpha.
|
|
51
|
-
"@patternfly/react-styles": "^6.0.0-alpha.
|
|
52
|
-
"@patternfly/react-tokens": "^6.0.0-alpha.
|
|
50
|
+
"@patternfly/react-icons": "^6.0.0-alpha.29",
|
|
51
|
+
"@patternfly/react-styles": "^6.0.0-alpha.28",
|
|
52
|
+
"@patternfly/react-tokens": "^6.0.0-alpha.28",
|
|
53
53
|
"focus-trap": "7.5.4",
|
|
54
54
|
"react-dropzone": "^14.2.3",
|
|
55
55
|
"tslib": "^2.6.2"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@patternfly/patternfly": "6.0.0-alpha.
|
|
58
|
+
"@patternfly/patternfly": "6.0.0-alpha.180",
|
|
59
59
|
"case-anything": "^2.1.13",
|
|
60
60
|
"css": "^3.0.0",
|
|
61
61
|
"fs-extra": "^11.2.0"
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"react": "^17 || ^18",
|
|
65
65
|
"react-dom": "^17 || ^18"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "cb1098099e5ccc766571bcd64adc642ee9687f3b"
|
|
68
68
|
}
|
|
@@ -168,10 +168,12 @@ class ExpandableSection extends React.Component<ExpandableSectionProps, Expandab
|
|
|
168
168
|
};
|
|
169
169
|
|
|
170
170
|
resize = () => {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
this.
|
|
174
|
-
|
|
171
|
+
if (this.expandableContentRef) {
|
|
172
|
+
const { offsetWidth } = this.expandableContentRef.current;
|
|
173
|
+
if (this.state.previousWidth !== offsetWidth) {
|
|
174
|
+
this.setState({ previousWidth: offsetWidth });
|
|
175
|
+
this.checkToggleVisibility();
|
|
176
|
+
}
|
|
175
177
|
}
|
|
176
178
|
};
|
|
177
179
|
handleResize = debounce(this.resize, 250);
|
|
@@ -249,11 +249,13 @@ export const JumpLinks: React.FunctionComponent<JumpLinksProps> = ({
|
|
|
249
249
|
onClick={() => setIsExpanded(!isExpanded)}
|
|
250
250
|
aria-label={toggleAriaLabel}
|
|
251
251
|
aria-expanded={isExpanded}
|
|
252
|
+
icon={
|
|
253
|
+
<span className={styles.jumpLinksToggleIcon}>
|
|
254
|
+
<AngleRightIcon />
|
|
255
|
+
</span>
|
|
256
|
+
}
|
|
252
257
|
>
|
|
253
|
-
|
|
254
|
-
<AngleRightIcon />
|
|
255
|
-
</span>
|
|
256
|
-
{label && <span className={css(styles.jumpLinksToggleText)}> {label} </span>}
|
|
258
|
+
{label && label}
|
|
257
259
|
</Button>
|
|
258
260
|
</div>
|
|
259
261
|
)}
|
|
@@ -26,7 +26,7 @@ exports[`expandable vertical with subsection 1`] = `
|
|
|
26
26
|
type="button"
|
|
27
27
|
>
|
|
28
28
|
<span
|
|
29
|
-
class="pf-v6-c-
|
|
29
|
+
class="pf-v6-c-button__icon pf-m-start"
|
|
30
30
|
>
|
|
31
31
|
<span
|
|
32
32
|
class="pf-v6-c-jump-links__toggle-icon"
|
|
@@ -45,11 +45,11 @@ exports[`expandable vertical with subsection 1`] = `
|
|
|
45
45
|
/>
|
|
46
46
|
</svg>
|
|
47
47
|
</span>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
</span>
|
|
49
|
+
<span
|
|
50
|
+
class="pf-v6-c-button__text"
|
|
51
|
+
>
|
|
52
|
+
Jump to section
|
|
53
53
|
</span>
|
|
54
54
|
</button>
|
|
55
55
|
</div>
|
|
@@ -11,6 +11,8 @@ export interface PageSidebarBodyProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
11
11
|
usePageInsets?: boolean;
|
|
12
12
|
/** Flag indicating that the page sidebar body should fill the available vertical space. */
|
|
13
13
|
isFilled?: boolean;
|
|
14
|
+
/** Flag indicating that the page sidebar body is for a context selector/perspective switcher */
|
|
15
|
+
isContextSelector?: boolean;
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
export const PageSidebarBody: React.FunctionComponent<PageSidebarBodyProps> = ({
|
|
@@ -18,6 +20,7 @@ export const PageSidebarBody: React.FunctionComponent<PageSidebarBodyProps> = ({
|
|
|
18
20
|
className,
|
|
19
21
|
usePageInsets,
|
|
20
22
|
isFilled,
|
|
23
|
+
isContextSelector,
|
|
21
24
|
...props
|
|
22
25
|
}: PageSidebarBodyProps) => (
|
|
23
26
|
<div
|
|
@@ -26,6 +29,7 @@ export const PageSidebarBody: React.FunctionComponent<PageSidebarBodyProps> = ({
|
|
|
26
29
|
usePageInsets && styles.modifiers.pageInsets,
|
|
27
30
|
isFilled === false && styles.modifiers.noFill,
|
|
28
31
|
isFilled === true && styles.modifiers.fill,
|
|
32
|
+
isContextSelector === true && styles.modifiers.contextSelector,
|
|
29
33
|
className
|
|
30
34
|
)}
|
|
31
35
|
{...props}
|
|
@@ -55,10 +55,13 @@ export const PageMultipleSidebarBody: React.FunctionComponent = () => {
|
|
|
55
55
|
|
|
56
56
|
const sidebar = (
|
|
57
57
|
<PageSidebar isSidebarOpen={isSidebarOpen} id="multiple-sidebar-body-sidebar">
|
|
58
|
-
<PageSidebarBody
|
|
59
|
-
|
|
58
|
+
<PageSidebarBody isContextSelector>
|
|
59
|
+
First sidebar body (for a context selector/perspective switcher)
|
|
60
|
+
</PageSidebarBody>
|
|
61
|
+
<PageSidebarBody usePageInsets>Second sidebar body (with insets)</PageSidebarBody>
|
|
62
|
+
<PageSidebarBody isFilled={true}>Third sidebar body (with fill)</PageSidebarBody>
|
|
60
63
|
<PageSidebarBody isFilled={false} usePageInsets>
|
|
61
|
-
|
|
64
|
+
Fourth sidebar body (with insets and no fill)
|
|
62
65
|
</PageSidebarBody>
|
|
63
66
|
</PageSidebar>
|
|
64
67
|
);
|
|
@@ -521,15 +521,13 @@ class Tabs extends React.Component<TabsProps, TabsState> {
|
|
|
521
521
|
aria-expanded={isExpandedLocal}
|
|
522
522
|
id={`${randomId}-button`}
|
|
523
523
|
aria-labelledby={`${randomId}-text ${randomId}-button`}
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
</span>
|
|
528
|
-
{toggleText && (
|
|
529
|
-
<span className={css(styles.tabsToggleText)} id={`${randomId}-text`}>
|
|
530
|
-
{toggleText}
|
|
524
|
+
icon={
|
|
525
|
+
<span className={css(styles.tabsToggleIcon)}>
|
|
526
|
+
<AngleRightIcon />
|
|
531
527
|
</span>
|
|
532
|
-
|
|
528
|
+
}
|
|
529
|
+
>
|
|
530
|
+
{toggleText && <span id={`${randomId}-text`}>{toggleText}</span>}
|
|
533
531
|
</Button>
|
|
534
532
|
</div>
|
|
535
533
|
</div>
|
|
@@ -417,14 +417,13 @@ exports[`should render expandable vertical tabs 1`] = `
|
|
|
417
417
|
type="button"
|
|
418
418
|
>
|
|
419
419
|
<span
|
|
420
|
-
class="pf-v6-c-
|
|
420
|
+
class="pf-v6-c-button__icon pf-m-start"
|
|
421
421
|
>
|
|
422
422
|
<span
|
|
423
423
|
class="pf-v6-c-tabs__toggle-icon"
|
|
424
424
|
>
|
|
425
425
|
<svg
|
|
426
426
|
aria-hidden="true"
|
|
427
|
-
arian-hidden="true"
|
|
428
427
|
class="pf-v6-svg"
|
|
429
428
|
fill="currentColor"
|
|
430
429
|
height="1em"
|
|
@@ -437,8 +436,11 @@ exports[`should render expandable vertical tabs 1`] = `
|
|
|
437
436
|
/>
|
|
438
437
|
</svg>
|
|
439
438
|
</span>
|
|
439
|
+
</span>
|
|
440
|
+
<span
|
|
441
|
+
class="pf-v6-c-button__text"
|
|
442
|
+
>
|
|
440
443
|
<span
|
|
441
|
-
class="pf-v6-c-tabs__toggle-text"
|
|
442
444
|
id="generated-id-text"
|
|
443
445
|
>
|
|
444
446
|
toggle
|
|
@@ -3,7 +3,7 @@ import styles from '@patternfly/react-styles/css/components/Toolbar/toolbar';
|
|
|
3
3
|
import { GenerateId } from '../../helpers/GenerateId/GenerateId';
|
|
4
4
|
import { css } from '@patternfly/react-styles';
|
|
5
5
|
import { ToolbarContext } from './ToolbarUtils';
|
|
6
|
-
import {
|
|
6
|
+
import { ToolbarLabelGroupContent } from './ToolbarLabelGroupContent';
|
|
7
7
|
import { formatBreakpointMods, canUseDOM } from '../../helpers/util';
|
|
8
8
|
import { getDefaultOUIAId, getOUIAProps, OUIAProps } from '../../helpers';
|
|
9
9
|
import { PageContext } from '../Page/PageContext';
|
|
@@ -20,9 +20,9 @@ export interface ToolbarProps extends React.HTMLProps<HTMLDivElement>, OUIAProps
|
|
|
20
20
|
clearAllFilters?: () => void;
|
|
21
21
|
/** Text to display in the clear all filters button */
|
|
22
22
|
clearFiltersButtonText?: string;
|
|
23
|
-
/** Custom content appended to the filter generated
|
|
24
|
-
|
|
25
|
-
/** The breakpoint at which the listed filters in
|
|
23
|
+
/** Custom content appended to the filter generated label group. To maintain spacing and styling, each node should be wrapped in a ToolbarItem or ToolbarGroup. This property will remove the default "Clear all filters" button. */
|
|
24
|
+
customLabelGroupContent?: React.ReactNode;
|
|
25
|
+
/** The breakpoint at which the listed filters in label groups are collapsed down to a summary */
|
|
26
26
|
collapseListedFiltersBreakpoint?: 'all' | 'md' | 'lg' | 'xl' | '2xl';
|
|
27
27
|
/** Flag indicating if a data toolbar toggle group's expandable content is expanded */
|
|
28
28
|
isExpanded?: boolean;
|
|
@@ -65,7 +65,7 @@ export interface ToolbarState {
|
|
|
65
65
|
/** Flag used if the user has opted NOT to manage the 'isExpanded' state of the toggle group.
|
|
66
66
|
* Indicates whether or not the toggle group is expanded. */
|
|
67
67
|
isManagedToggleExpanded: boolean;
|
|
68
|
-
/** Object managing information about how many
|
|
68
|
+
/** Object managing information about how many labels are in each label group */
|
|
69
69
|
filterInfo: FilterInfo;
|
|
70
70
|
/** Used to keep track of window width so we can collapse expanded content when window is resizing */
|
|
71
71
|
windowWidth: number;
|
|
@@ -78,7 +78,7 @@ interface FilterInfo {
|
|
|
78
78
|
|
|
79
79
|
class Toolbar extends React.Component<ToolbarProps, ToolbarState> {
|
|
80
80
|
static displayName = 'Toolbar';
|
|
81
|
-
|
|
81
|
+
labelGroupContentRef = React.createRef<HTMLDivElement>();
|
|
82
82
|
staticFilterInfo = {};
|
|
83
83
|
state = {
|
|
84
84
|
isManagedToggleExpanded: false,
|
|
@@ -144,7 +144,7 @@ class Toolbar extends React.Component<ToolbarProps, ToolbarState> {
|
|
|
144
144
|
isSticky,
|
|
145
145
|
ouiaId,
|
|
146
146
|
numberOfFiltersText,
|
|
147
|
-
|
|
147
|
+
customLabelGroupContent,
|
|
148
148
|
colorVariant = ToolbarColorVariant.default,
|
|
149
149
|
...props
|
|
150
150
|
} = this.props;
|
|
@@ -180,27 +180,27 @@ class Toolbar extends React.Component<ToolbarProps, ToolbarState> {
|
|
|
180
180
|
value={{
|
|
181
181
|
isExpanded,
|
|
182
182
|
toggleIsExpanded: isToggleManaged ? this.toggleIsExpanded : toggleIsExpanded,
|
|
183
|
-
|
|
183
|
+
labelGroupContentRef: this.labelGroupContentRef,
|
|
184
184
|
updateNumberFilters: this.updateNumberFilters,
|
|
185
185
|
numberOfFilters,
|
|
186
186
|
clearAllFilters,
|
|
187
187
|
clearFiltersButtonText,
|
|
188
188
|
showClearFiltersButton,
|
|
189
189
|
toolbarId: randomId,
|
|
190
|
-
|
|
190
|
+
customLabelGroupContent
|
|
191
191
|
}}
|
|
192
192
|
>
|
|
193
193
|
{children}
|
|
194
|
-
<
|
|
194
|
+
<ToolbarLabelGroupContent
|
|
195
195
|
isExpanded={isExpanded}
|
|
196
|
-
|
|
196
|
+
labelGroupContentRef={this.labelGroupContentRef}
|
|
197
197
|
clearAllFilters={clearAllFilters}
|
|
198
198
|
showClearFiltersButton={showClearFiltersButton}
|
|
199
199
|
clearFiltersButtonText={clearFiltersButtonText}
|
|
200
200
|
numberOfFilters={numberOfFilters}
|
|
201
201
|
numberOfFiltersText={numberOfFiltersText}
|
|
202
202
|
collapseListedFiltersBreakpoint={collapseListedFiltersBreakpoint}
|
|
203
|
-
|
|
203
|
+
customLabelGroupContent={customLabelGroupContent}
|
|
204
204
|
/>
|
|
205
205
|
</ToolbarContext.Provider>
|
|
206
206
|
</div>
|
|
@@ -37,7 +37,7 @@ export interface ToolbarContentProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
37
37
|
class ToolbarContent extends React.Component<ToolbarContentProps> {
|
|
38
38
|
static displayName = 'ToolbarContent';
|
|
39
39
|
private expandableContentRef = React.createRef<HTMLDivElement>();
|
|
40
|
-
private
|
|
40
|
+
private labelContainerRef = React.createRef<HTMLDivElement>();
|
|
41
41
|
private static currentId = 0;
|
|
42
42
|
|
|
43
43
|
static defaultProps: ToolbarContentProps = {
|
|
@@ -88,7 +88,7 @@ class ToolbarContent extends React.Component<ToolbarContentProps> {
|
|
|
88
88
|
value={{
|
|
89
89
|
expandableContentRef: this.expandableContentRef,
|
|
90
90
|
expandableContentId,
|
|
91
|
-
|
|
91
|
+
labelContainerRef: this.labelContainerRef,
|
|
92
92
|
isExpanded: isExpanded || isExpandedContext,
|
|
93
93
|
clearAllFilters: clearAllFilters || clearAllFiltersContext,
|
|
94
94
|
clearFiltersButtonText: clearFiltersButtonText || clearFiltersButtonContext,
|
|
@@ -16,8 +16,8 @@ export interface ToolbarExpandableContentProps extends React.HTMLProps<HTMLDivEl
|
|
|
16
16
|
isExpanded?: boolean;
|
|
17
17
|
/** Expandable content reference for passing to data toolbar children */
|
|
18
18
|
expandableContentRef?: RefObject<HTMLDivElement>;
|
|
19
|
-
/**
|
|
20
|
-
|
|
19
|
+
/** Label container reference for passing to data toolbar children */
|
|
20
|
+
labelContainerRef?: RefObject<any>;
|
|
21
21
|
/** optional callback for clearing all filters in the toolbar */
|
|
22
22
|
clearAllFilters?: () => void;
|
|
23
23
|
/** Text to display in the clear all filters button */
|
|
@@ -40,16 +40,16 @@ class ToolbarExpandableContent extends React.Component<ToolbarExpandableContentP
|
|
|
40
40
|
children,
|
|
41
41
|
className,
|
|
42
42
|
expandableContentRef,
|
|
43
|
-
|
|
43
|
+
labelContainerRef,
|
|
44
44
|
isExpanded,
|
|
45
45
|
clearAllFilters,
|
|
46
46
|
clearFiltersButtonText,
|
|
47
47
|
showClearFiltersButton,
|
|
48
48
|
...props
|
|
49
49
|
} = this.props;
|
|
50
|
-
const { numberOfFilters,
|
|
50
|
+
const { numberOfFilters, customLabelGroupContent } = this.context;
|
|
51
51
|
|
|
52
|
-
const
|
|
52
|
+
const clearLabelGroups = () => {
|
|
53
53
|
clearAllFilters();
|
|
54
54
|
};
|
|
55
55
|
|
|
@@ -62,15 +62,15 @@ class ToolbarExpandableContent extends React.Component<ToolbarExpandableContentP
|
|
|
62
62
|
<ToolbarGroup>{children}</ToolbarGroup>
|
|
63
63
|
{numberOfFilters > 0 && (
|
|
64
64
|
<ToolbarGroup>
|
|
65
|
-
<ToolbarGroup ref={
|
|
66
|
-
{showClearFiltersButton && !
|
|
65
|
+
<ToolbarGroup ref={labelContainerRef} />
|
|
66
|
+
{showClearFiltersButton && !customLabelGroupContent && (
|
|
67
67
|
<ToolbarItem>
|
|
68
|
-
<Button variant="link" onClick={
|
|
68
|
+
<Button variant="link" onClick={clearLabelGroups} isInline>
|
|
69
69
|
{clearFiltersButtonText}
|
|
70
70
|
</Button>
|
|
71
71
|
</ToolbarItem>
|
|
72
72
|
)}
|
|
73
|
-
{
|
|
73
|
+
{customLabelGroupContent && customLabelGroupContent}
|
|
74
74
|
</ToolbarGroup>
|
|
75
75
|
)}
|
|
76
76
|
</div>
|
|
@@ -5,41 +5,41 @@ import { ToolbarContentContext, ToolbarContext } from './ToolbarUtils';
|
|
|
5
5
|
import { PickOptional } from '../../helpers/typeUtils';
|
|
6
6
|
import { Label, LabelGroup } from '../Label';
|
|
7
7
|
|
|
8
|
-
export interface
|
|
9
|
-
/** A unique key to identify this
|
|
8
|
+
export interface ToolbarLabelGroup {
|
|
9
|
+
/** A unique key to identify this label group category */
|
|
10
10
|
key: string;
|
|
11
|
-
/** The category name to display for the
|
|
11
|
+
/** The category name to display for the label group */
|
|
12
12
|
name: string;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export interface
|
|
16
|
-
/** A unique key to identify this
|
|
15
|
+
export interface ToolbarLabel {
|
|
16
|
+
/** A unique key to identify this label */
|
|
17
17
|
key: string;
|
|
18
|
-
/** The ReactNode to display in the
|
|
18
|
+
/** The ReactNode to display in the label */
|
|
19
19
|
node: React.ReactNode;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export interface ToolbarFilterProps extends ToolbarItemProps {
|
|
23
23
|
/** Flag indicating when toolbar toggle group is expanded for non-managed toolbar toggle groups. */
|
|
24
24
|
isExpanded?: boolean;
|
|
25
|
-
/** An array of strings to be displayed as
|
|
26
|
-
|
|
27
|
-
/** Callback passed by consumer used to close the entire
|
|
28
|
-
|
|
29
|
-
/** Callback passed by consumer used to delete a
|
|
30
|
-
|
|
31
|
-
/** Customizable "Show Less" text string for the
|
|
32
|
-
|
|
33
|
-
/** Customizeable template string for the
|
|
34
|
-
|
|
35
|
-
/** Content to be rendered inside the data toolbar item associated with the
|
|
25
|
+
/** An array of strings to be displayed as labels in the expandable content */
|
|
26
|
+
labels?: (string | ToolbarLabel)[];
|
|
27
|
+
/** Callback passed by consumer used to close the entire label group */
|
|
28
|
+
deleteLabelGroup?: (category: string | ToolbarLabelGroup) => void;
|
|
29
|
+
/** Callback passed by consumer used to delete a label from the labels[] */
|
|
30
|
+
deleteLabel?: (category: string | ToolbarLabelGroup, label: ToolbarLabel | string) => void;
|
|
31
|
+
/** Customizable "Show Less" text string for the label group */
|
|
32
|
+
labelGroupExpandedText?: string;
|
|
33
|
+
/** Customizeable template string for the label group. Use variable "${remaining}" for the overflow label count. */
|
|
34
|
+
labelGroupCollapsedText?: string;
|
|
35
|
+
/** Content to be rendered inside the data toolbar item associated with the label group */
|
|
36
36
|
children: React.ReactNode;
|
|
37
|
-
/** Unique category name to be used as a label for the
|
|
38
|
-
categoryName: string |
|
|
37
|
+
/** Unique category name to be used as a label for the label group */
|
|
38
|
+
categoryName: string | ToolbarLabelGroup;
|
|
39
39
|
/** Flag to show the toolbar item */
|
|
40
40
|
showToolbarItem?: boolean;
|
|
41
|
-
/** Reference to a
|
|
42
|
-
|
|
41
|
+
/** Reference to a label container created with a custom expandable content group, for non-managed multiple toolbar toggle groups. */
|
|
42
|
+
expandableLabelContainerRef?: React.RefObject<HTMLDivElement>;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
interface ToolbarFilterState {
|
|
@@ -51,7 +51,7 @@ class ToolbarFilter extends React.Component<ToolbarFilterProps, ToolbarFilterSta
|
|
|
51
51
|
static contextType = ToolbarContext;
|
|
52
52
|
context!: React.ContextType<typeof ToolbarContext>;
|
|
53
53
|
static defaultProps: PickOptional<ToolbarFilterProps> = {
|
|
54
|
-
|
|
54
|
+
labels: [] as (string | ToolbarLabel)[],
|
|
55
55
|
showToolbarItem: true
|
|
56
56
|
};
|
|
57
57
|
|
|
@@ -63,65 +63,65 @@ class ToolbarFilter extends React.Component<ToolbarFilterProps, ToolbarFilterSta
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
componentDidMount() {
|
|
66
|
-
const { categoryName,
|
|
66
|
+
const { categoryName, labels } = this.props;
|
|
67
67
|
this.context.updateNumberFilters(
|
|
68
68
|
typeof categoryName !== 'string' && categoryName.hasOwnProperty('key')
|
|
69
69
|
? categoryName.key
|
|
70
70
|
: categoryName.toString(),
|
|
71
|
-
|
|
71
|
+
labels.length
|
|
72
72
|
);
|
|
73
73
|
this.setState({ isMounted: true });
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
componentDidUpdate() {
|
|
77
|
-
const { categoryName,
|
|
77
|
+
const { categoryName, labels } = this.props;
|
|
78
78
|
this.context.updateNumberFilters(
|
|
79
79
|
typeof categoryName !== 'string' && categoryName.hasOwnProperty('key')
|
|
80
80
|
? categoryName.key
|
|
81
81
|
: categoryName.toString(),
|
|
82
|
-
|
|
82
|
+
labels.length
|
|
83
83
|
);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
render() {
|
|
87
87
|
const {
|
|
88
88
|
children,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
89
|
+
labels,
|
|
90
|
+
deleteLabelGroup,
|
|
91
|
+
deleteLabel,
|
|
92
|
+
labelGroupExpandedText,
|
|
93
|
+
labelGroupCollapsedText,
|
|
94
94
|
categoryName,
|
|
95
95
|
showToolbarItem,
|
|
96
96
|
isExpanded,
|
|
97
|
-
|
|
97
|
+
expandableLabelContainerRef,
|
|
98
98
|
...props
|
|
99
99
|
} = this.props;
|
|
100
|
-
const { isExpanded: managedIsExpanded,
|
|
100
|
+
const { isExpanded: managedIsExpanded, labelGroupContentRef } = this.context;
|
|
101
101
|
const _isExpanded = isExpanded !== undefined ? isExpanded : managedIsExpanded;
|
|
102
102
|
const categoryKey =
|
|
103
103
|
typeof categoryName !== 'string' && categoryName.hasOwnProperty('key')
|
|
104
104
|
? categoryName.key
|
|
105
105
|
: categoryName.toString();
|
|
106
106
|
|
|
107
|
-
const
|
|
108
|
-
<ToolbarItem variant="
|
|
107
|
+
const labelGroup = labels.length ? (
|
|
108
|
+
<ToolbarItem variant="label-group">
|
|
109
109
|
<LabelGroup
|
|
110
110
|
key={categoryKey}
|
|
111
111
|
categoryName={typeof categoryName === 'string' ? categoryName : categoryName.name}
|
|
112
|
-
isClosable={
|
|
113
|
-
onClick={() =>
|
|
114
|
-
collapsedText={
|
|
115
|
-
expandedText={
|
|
112
|
+
isClosable={deleteLabelGroup !== undefined}
|
|
113
|
+
onClick={() => deleteLabelGroup(categoryName)}
|
|
114
|
+
collapsedText={labelGroupCollapsedText}
|
|
115
|
+
expandedText={labelGroupExpandedText}
|
|
116
116
|
>
|
|
117
|
-
{
|
|
118
|
-
typeof
|
|
119
|
-
<Label variant="outline" key={
|
|
120
|
-
{
|
|
117
|
+
{labels.map((label) =>
|
|
118
|
+
typeof label === 'string' ? (
|
|
119
|
+
<Label variant="outline" key={label} onClose={() => deleteLabel(categoryKey, label)}>
|
|
120
|
+
{label}
|
|
121
121
|
</Label>
|
|
122
122
|
) : (
|
|
123
|
-
<Label key={
|
|
124
|
-
{
|
|
123
|
+
<Label key={label.key} onClose={() => deleteLabel(categoryKey, label)}>
|
|
124
|
+
{label.node}
|
|
125
125
|
</Label>
|
|
126
126
|
)
|
|
127
127
|
)}
|
|
@@ -133,20 +133,20 @@ class ToolbarFilter extends React.Component<ToolbarFilterProps, ToolbarFilterSta
|
|
|
133
133
|
return (
|
|
134
134
|
<React.Fragment>
|
|
135
135
|
{showToolbarItem && <ToolbarItem {...props}>{children}</ToolbarItem>}
|
|
136
|
-
{ReactDOM.createPortal(
|
|
136
|
+
{ReactDOM.createPortal(labelGroup, labelGroupContentRef.current.firstElementChild)}
|
|
137
137
|
</React.Fragment>
|
|
138
138
|
);
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
return (
|
|
142
142
|
<ToolbarContentContext.Consumer>
|
|
143
|
-
{({
|
|
143
|
+
{({ labelContainerRef }) => (
|
|
144
144
|
<React.Fragment>
|
|
145
145
|
{showToolbarItem && <ToolbarItem {...props}>{children}</ToolbarItem>}
|
|
146
|
-
{
|
|
147
|
-
{
|
|
148
|
-
|
|
149
|
-
ReactDOM.createPortal(
|
|
146
|
+
{labelContainerRef.current && ReactDOM.createPortal(labelGroup, labelContainerRef.current)}
|
|
147
|
+
{expandableLabelContainerRef &&
|
|
148
|
+
expandableLabelContainerRef.current &&
|
|
149
|
+
ReactDOM.createPortal(labelGroup, expandableLabelContainerRef.current)}
|
|
150
150
|
</React.Fragment>
|
|
151
151
|
)}
|
|
152
152
|
</ToolbarContentContext.Consumer>
|
|
@@ -152,7 +152,7 @@ export interface ToolbarGroupProps extends Omit<React.HTMLProps<HTMLDivElement>,
|
|
|
152
152
|
children?: React.ReactNode;
|
|
153
153
|
/** Flag that modifies the toolbar group to hide overflow and respond to available space. Used for horizontal navigation. */
|
|
154
154
|
isOverflowContainer?: boolean;
|
|
155
|
-
/** @hide Reference to pass to this group if it has .pf-m-
|
|
155
|
+
/** @hide Reference to pass to this group if it has .pf-m-label-container modifier */
|
|
156
156
|
innerRef?: React.RefObject<any>;
|
|
157
157
|
}
|
|
158
158
|
|
|
@@ -9,7 +9,7 @@ export enum ToolbarItemVariant {
|
|
|
9
9
|
separator = 'separator',
|
|
10
10
|
pagination = 'pagination',
|
|
11
11
|
label = 'label',
|
|
12
|
-
'
|
|
12
|
+
'label-group' = 'label-group',
|
|
13
13
|
'expand-all' = 'expand-all'
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -17,7 +17,7 @@ export interface ToolbarItemProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
17
17
|
/** Classes applied to root element of the data toolbar item */
|
|
18
18
|
className?: string;
|
|
19
19
|
/** A type modifier which modifies spacing specifically depending on the type of item */
|
|
20
|
-
variant?: ToolbarItemVariant | 'pagination' | 'label' | '
|
|
20
|
+
variant?: ToolbarItemVariant | 'pagination' | 'label' | 'label-group' | 'separator' | 'expand-all';
|
|
21
21
|
/** Visibility at various breakpoints. */
|
|
22
22
|
visibility?: {
|
|
23
23
|
default?: 'hidden' | 'visible';
|
|
@@ -189,7 +189,7 @@ export const ToolbarItem: React.FunctionComponent<ToolbarItemProps> = ({
|
|
|
189
189
|
className={css(
|
|
190
190
|
styles.toolbarItem,
|
|
191
191
|
variant && styles.modifiers[toCamel(variant) as 'pagination' | 'label'],
|
|
192
|
-
variant === ToolbarItemVariant['
|
|
192
|
+
variant === ToolbarItemVariant['label-group'] && styles.modifiers.labelGroup,
|
|
193
193
|
isAllExpanded && styles.modifiers.expanded,
|
|
194
194
|
isOverflowContainer && styles.modifiers.overflowContainer,
|
|
195
195
|
formatBreakpointMods(visibility, styles, '', getBreakpoint(width)),
|