@patternfly/react-core 6.0.0-prerelease.20 → 6.0.0-prerelease.21
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 +7 -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/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/Tile/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 +0 -1
- package/dist/esm/components/MenuToggle/MenuToggle.d.ts +2 -8
- package/dist/esm/components/MenuToggle/MenuToggle.d.ts.map +1 -1
- package/dist/esm/components/MenuToggle/MenuToggle.js +4 -4
- package/dist/esm/components/MenuToggle/MenuToggle.js.map +1 -1
- package/dist/esm/components/Page/Page.d.ts.map +1 -1
- package/dist/esm/components/Page/Page.js +2 -3
- package/dist/esm/components/Page/Page.js.map +1 -1
- package/dist/js/components/MenuToggle/MenuToggle.d.ts +2 -8
- package/dist/js/components/MenuToggle/MenuToggle.d.ts.map +1 -1
- package/dist/js/components/MenuToggle/MenuToggle.js +4 -4
- package/dist/js/components/MenuToggle/MenuToggle.js.map +1 -1
- package/dist/js/components/Page/Page.d.ts.map +1 -1
- package/dist/js/components/Page/Page.js +1 -2
- package/dist/js/components/Page/Page.js.map +1 -1
- package/dist/styles/base-no-reset.css +84 -59
- package/dist/styles/base.css +99 -59
- package/dist/umd/assets/{output-Dp7Kc79X.css → output-CWhO_0Db.css} +19485 -19447
- package/dist/umd/react-core.min.js +1 -1
- 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/MenuToggle/MenuToggle.tsx +6 -20
- package/src/components/MenuToggle/__tests__/MenuToggle.test.tsx +10 -11
- package/src/components/MenuToggle/examples/MenuToggle.md +5 -5
- package/src/components/MenuToggle/examples/MenuToggleSplitButtonAction.tsx +23 -32
- package/src/components/MenuToggle/examples/MenuToggleSplitButtonCheckbox.tsx +9 -9
- package/src/components/MenuToggle/examples/MenuToggleSplitButtonCheckboxWithText.tsx +27 -33
- package/src/components/MenuToggle/examples/MenuToggleSplitButtonCheckboxWithToggleText.tsx +21 -27
- package/src/components/Page/Page.tsx +2 -4
- package/src/components/Toolbar/examples/ToolbarStacked.tsx +7 -9
- package/src/demos/CardView/examples/CardView.tsx +11 -13
- package/src/demos/DataList/examples/DataListBasic.tsx +7 -9
- package/src/demos/Filters/examples/FilterAttributeSearch.tsx +9 -11
- package/src/demos/Filters/examples/FilterCheckboxSelect.tsx +9 -11
- package/src/demos/Filters/examples/FilterFaceted.tsx +9 -11
- package/src/demos/Filters/examples/FilterMixedSelectGroup.tsx +9 -11
- package/src/demos/Filters/examples/FilterSameSelectGroup.tsx +9 -11
- package/src/demos/Filters/examples/FilterSearchInput.tsx +9 -11
- package/src/demos/Filters/examples/FilterSingleSelect.tsx +9 -11
- package/src/demos/examples/PrimaryDetail/PrimaryDetailCardView.tsx +11 -13
- package/dist/styles/assets/images/PF-Masthead-Logo.svg +0 -1
- package/dist/styles/assets/images/background-filter.svg +0 -17
- package/dist/styles/assets/images/g_sizing.png +0 -0
- package/dist/styles/assets/images/img_avatar-dark.svg +0 -22
- package/dist/styles/assets/images/img_avatar.svg +0 -21
- package/dist/styles/assets/images/l_pf-reverse-164x11.png +0 -0
- package/dist/styles/assets/images/l_pf-reverse.svg +0 -1
- package/dist/styles/assets/images/logo-dropbox-old.svg +0 -1
- package/dist/styles/assets/images/logo-dropbox.svg +0 -6
- package/dist/styles/assets/images/logo-facebook.svg +0 -4
- package/dist/styles/assets/images/logo-github.svg +0 -4
- package/dist/styles/assets/images/logo-gitlab.svg +0 -4
- package/dist/styles/assets/images/logo-google.svg +0 -4
- package/dist/styles/assets/images/logo-google2.svg +0 -10
- package/dist/styles/assets/images/logo__pf--reverse--base.png +0 -0
- package/dist/styles/assets/images/logo__pf--reverse--base.svg +0 -40
- package/dist/styles/assets/images/logo__pf--reverse-on-md.svg +0 -40
- package/dist/styles/assets/images/pf-c-brand__logo-base.jpg +0 -0
- package/dist/styles/assets/images/pf-c-brand__logo-on-lg-white.svg +0 -32
- package/dist/styles/assets/images/pf-c-brand__logo-on-lg.svg +0 -32
- package/dist/styles/assets/images/pf-c-brand__logo-on-md-white.svg +0 -42
- package/dist/styles/assets/images/pf-c-brand__logo-on-md.svg +0 -42
- package/dist/styles/assets/images/pf-c-brand__logo-on-sm-white.svg +0 -17
- package/dist/styles/assets/images/pf-c-brand__logo-on-sm.svg +0 -17
- package/dist/styles/assets/images/pf-c-brand__logo-on-xl-white.svg +0 -39
- package/dist/styles/assets/images/pf-c-brand__logo-on-xl.svg +0 -39
- package/dist/styles/assets/images/pf-c-brand__logo.svg +0 -10
- package/dist/styles/assets/images/pf-logo.svg +0 -28
- package/dist/styles/assets/images/pf_logo.svg +0 -37
- package/dist/styles/assets/images/pf_logo_color.svg +0 -22
- package/dist/styles/assets/images/pf_logo_white.svg +0 -37
- package/dist/styles/assets/images/pf_mini_logo_white.svg +0 -1
- package/dist/styles/assets/images/pfbg_1200.jpg +0 -0
- package/dist/styles/assets/images/pfbg_2000.jpg +0 -0
- package/dist/styles/assets/images/pfbg_576.jpg +0 -0
- package/dist/styles/assets/images/pfbg_576@2x.jpg +0 -0
- package/dist/styles/assets/images/pfbg_768.jpg +0 -0
- package/dist/styles/assets/images/pfbg_768@2x.jpg +0 -0
- package/dist/styles/assets/images/pfbg_992.jpg +0 -0
- package/dist/styles/assets/images/pfbg_992@2x.jpg +0 -0
- package/dist/styles/assets/images/status-icon-sprite.svg +0 -38
package/helpers/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@patternfly/react-core-helpers","main":"../dist/js/helpers/index.js","module":"../dist/esm/helpers/index.js","typings":"../dist/esm/helpers/index.d.ts","version":"6.0.0-prerelease.
|
|
1
|
+
{"name":"@patternfly/react-core-helpers","main":"../dist/js/helpers/index.js","module":"../dist/esm/helpers/index.js","typings":"../dist/esm/helpers/index.d.ts","version":"6.0.0-prerelease.20","private":true}
|
package/layouts/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@patternfly/react-core-layouts","main":"../dist/js/layouts/index.js","module":"../dist/esm/layouts/index.js","typings":"../dist/esm/layouts/index.d.ts","version":"6.0.0-prerelease.
|
|
1
|
+
{"name":"@patternfly/react-core-layouts","main":"../dist/js/layouts/index.js","module":"../dist/esm/layouts/index.js","typings":"../dist/esm/layouts/index.d.ts","version":"6.0.0-prerelease.20","private":true}
|
package/next/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@patternfly/react-core-next","main":"../dist/js/next/index.js","module":"../dist/esm/next/index.js","typings":"../dist/esm/next/index.d.ts","version":"6.0.0-prerelease.
|
|
1
|
+
{"name":"@patternfly/react-core-next","main":"../dist/js/next/index.js","module":"../dist/esm/next/index.js","typings":"../dist/esm/next/index.d.ts","version":"6.0.0-prerelease.20","private":true}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "6.0.0-prerelease.
|
|
3
|
+
"version": "6.0.0-prerelease.21",
|
|
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",
|
|
@@ -46,15 +46,15 @@
|
|
|
46
46
|
"subpaths": "node ../../scripts/exportSubpaths.mjs --config subpaths.config.json"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@patternfly/react-icons": "^6.0.0-prerelease.
|
|
50
|
-
"@patternfly/react-styles": "^6.0.0-prerelease.
|
|
51
|
-
"@patternfly/react-tokens": "^6.0.0-prerelease.
|
|
49
|
+
"@patternfly/react-icons": "^6.0.0-prerelease.7",
|
|
50
|
+
"@patternfly/react-styles": "^6.0.0-prerelease.6",
|
|
51
|
+
"@patternfly/react-tokens": "^6.0.0-prerelease.7",
|
|
52
52
|
"focus-trap": "7.6.0",
|
|
53
53
|
"react-dropzone": "^14.2.3",
|
|
54
54
|
"tslib": "^2.7.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@patternfly/patternfly": "6.0.0-prerelease.
|
|
57
|
+
"@patternfly/patternfly": "6.0.0-prerelease.15",
|
|
58
58
|
"case-anything": "^2.1.13",
|
|
59
59
|
"css": "^3.0.0",
|
|
60
60
|
"fs-extra": "^11.2.0"
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"react": "^17 || ^18",
|
|
64
64
|
"react-dom": "^17 || ^18"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "d36646de28fe6e9e231103b909e37051bd58ec5b"
|
|
67
67
|
}
|
|
@@ -21,13 +21,6 @@ export enum MenuToggleSize {
|
|
|
21
21
|
|
|
22
22
|
export type MenuToggleElement = HTMLDivElement | HTMLButtonElement;
|
|
23
23
|
|
|
24
|
-
export interface SplitButtonOptions {
|
|
25
|
-
/** Elements to display before the toggle button. When included, renders the menu toggle as a split button. */
|
|
26
|
-
items: React.ReactNode[];
|
|
27
|
-
/** Variant of split button toggle */
|
|
28
|
-
variant?: 'action' | 'checkbox';
|
|
29
|
-
}
|
|
30
|
-
|
|
31
24
|
export interface MenuToggleProps
|
|
32
25
|
extends Omit<
|
|
33
26
|
React.DetailedHTMLProps<
|
|
@@ -51,8 +44,8 @@ export interface MenuToggleProps
|
|
|
51
44
|
isFullWidth?: boolean;
|
|
52
45
|
/** Flag indicating the toggle contains placeholder text */
|
|
53
46
|
isPlaceholder?: boolean;
|
|
54
|
-
/**
|
|
55
|
-
|
|
47
|
+
/** Elements to display before the toggle button. When included, renders the menu toggle as a split button. */
|
|
48
|
+
splitButtonItems?: React.ReactNode[];
|
|
56
49
|
/** Variant styles of the menu toggle */
|
|
57
50
|
variant?: 'default' | 'plain' | 'primary' | 'plainText' | 'secondary' | 'typeahead';
|
|
58
51
|
/** Status styles of the menu toggle */
|
|
@@ -107,7 +100,7 @@ class MenuToggleBase extends React.Component<MenuToggleProps, MenuToggleState> {
|
|
|
107
100
|
isFullHeight,
|
|
108
101
|
isFullWidth,
|
|
109
102
|
isPlaceholder,
|
|
110
|
-
|
|
103
|
+
splitButtonItems,
|
|
111
104
|
variant,
|
|
112
105
|
status,
|
|
113
106
|
statusIcon,
|
|
@@ -204,17 +197,10 @@ class MenuToggleBase extends React.Component<MenuToggleProps, MenuToggleState> {
|
|
|
204
197
|
);
|
|
205
198
|
}
|
|
206
199
|
|
|
207
|
-
if (
|
|
200
|
+
if (splitButtonItems) {
|
|
208
201
|
return (
|
|
209
|
-
<div
|
|
210
|
-
|
|
211
|
-
className={css(
|
|
212
|
-
commonStyles,
|
|
213
|
-
styles.modifiers.splitButton,
|
|
214
|
-
splitButtonOptions?.variant === 'action' && styles.modifiers.action
|
|
215
|
-
)}
|
|
216
|
-
>
|
|
217
|
-
{splitButtonOptions?.items}
|
|
202
|
+
<div ref={innerRef as React.Ref<HTMLDivElement>} className={css(commonStyles, styles.modifiers.splitButton)}>
|
|
203
|
+
{splitButtonItems}
|
|
218
204
|
<button
|
|
219
205
|
className={css(styles.menuToggleButton, children && styles.modifiers.text)}
|
|
220
206
|
type="button"
|
|
@@ -7,6 +7,7 @@ import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-ico
|
|
|
7
7
|
import userEvent from '@testing-library/user-event';
|
|
8
8
|
import { render, screen } from '@testing-library/react';
|
|
9
9
|
import styles from '@patternfly/react-styles/css/components/MenuToggle/menu-toggle';
|
|
10
|
+
import '@testing-library/jest-dom';
|
|
10
11
|
|
|
11
12
|
describe('menu toggle', () => {
|
|
12
13
|
test('renders successfully', () => {
|
|
@@ -82,17 +83,15 @@ describe('menu toggle', () => {
|
|
|
82
83
|
render(
|
|
83
84
|
<MenuToggle
|
|
84
85
|
onClick={mockClick}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
]
|
|
95
|
-
}}
|
|
86
|
+
splitButtonItems={[
|
|
87
|
+
<MenuToggleCheckbox
|
|
88
|
+
id="split-button-checkbox-with-text-disabled-example"
|
|
89
|
+
key="split-checkbox-with-text-disabled"
|
|
90
|
+
aria-label="Select all"
|
|
91
|
+
>
|
|
92
|
+
10 selected
|
|
93
|
+
</MenuToggleCheckbox>
|
|
94
|
+
]}
|
|
96
95
|
aria-label="Menu toggle with checkbox split button and text"
|
|
97
96
|
/>
|
|
98
97
|
);
|
|
@@ -3,7 +3,7 @@ id: Menu toggle
|
|
|
3
3
|
section: components
|
|
4
4
|
subsection: menus
|
|
5
5
|
cssPrefix: pf-v6-c-menu-toggle
|
|
6
|
-
propComponents: ['MenuToggle', 'MenuToggleAction', 'MenuToggleCheckbox'
|
|
6
|
+
propComponents: ['MenuToggle', 'MenuToggleAction', 'MenuToggleCheckbox']
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
import './MenuToggle.css'
|
|
@@ -203,7 +203,7 @@ import { MenuToggle } from '@patternfly/react-core';
|
|
|
203
203
|
|
|
204
204
|
To add a checkbox (or other action/control) to a menu toggle, use a split button.
|
|
205
205
|
|
|
206
|
-
A `<MenuToggle>` can be rendered as a split button by adding a `
|
|
206
|
+
A `<MenuToggle>` can be rendered as a split button by adding a `splitButtonItems` property. Elements to be displayed before the toggle button must be included in the `splitButtonItems`.
|
|
207
207
|
|
|
208
208
|
The following example shows a split button with a `<MenuToggleCheckbox>`.
|
|
209
209
|
|
|
@@ -217,7 +217,7 @@ Variant styling can be applied to split button toggles to adjust their appearanc
|
|
|
217
217
|
|
|
218
218
|
You can allow users to select a toggle checkbox by clicking either the checkbox or the text label.
|
|
219
219
|
|
|
220
|
-
To link a split toggle label to the toggle's checkbox, pass both the label and the `<MenuToggleCheckbox>` component to `
|
|
220
|
+
To link a split toggle label to the toggle's checkbox, pass both the label and the `<MenuToggleCheckbox>` component to `splitButtonItems`.
|
|
221
221
|
|
|
222
222
|
```ts file='MenuToggleSplitButtonCheckboxWithText.tsx'
|
|
223
223
|
|
|
@@ -225,7 +225,7 @@ To link a split toggle label to the toggle's checkbox, pass both the label and t
|
|
|
225
225
|
|
|
226
226
|
### Split toggle with checkbox and toggle text
|
|
227
227
|
|
|
228
|
-
To link a split toggle label to the toggle button itself, pass the label to the `<MenuToggle>` component, instead of `
|
|
228
|
+
To link a split toggle label to the toggle button itself, pass the label to the `<MenuToggle>` component, instead of `splitButtonItems`.
|
|
229
229
|
|
|
230
230
|
```ts file='MenuToggleSplitButtonCheckboxWithToggleText.tsx'
|
|
231
231
|
|
|
@@ -233,7 +233,7 @@ To link a split toggle label to the toggle button itself, pass the label to the
|
|
|
233
233
|
|
|
234
234
|
### Split toggle with action
|
|
235
235
|
|
|
236
|
-
To add an action to a split button,
|
|
236
|
+
To add an action to a split button, add a `<MenuToggleAction>` to the `splitButtonItems` property.
|
|
237
237
|
|
|
238
238
|
Actions may be used with primary and secondary toggle variants.
|
|
239
239
|
|
|
@@ -4,46 +4,37 @@ import { MenuToggleAction, MenuToggle } from '@patternfly/react-core';
|
|
|
4
4
|
export const MenuToggleSplitButtonAction: React.FunctionComponent = () => (
|
|
5
5
|
<React.Fragment>
|
|
6
6
|
<MenuToggle
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
</MenuToggleAction>
|
|
13
|
-
]
|
|
14
|
-
}}
|
|
7
|
+
splitButtonItems={[
|
|
8
|
+
<MenuToggleAction id="split-button-action-example-with-toggle-button" key="split-action" aria-label="Action">
|
|
9
|
+
Action
|
|
10
|
+
</MenuToggleAction>
|
|
11
|
+
]}
|
|
15
12
|
aria-label="Menu toggle with action split button"
|
|
16
13
|
/>{' '}
|
|
17
14
|
<MenuToggle
|
|
18
15
|
variant="primary"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
</MenuToggleAction>
|
|
29
|
-
]
|
|
30
|
-
}}
|
|
16
|
+
splitButtonItems={[
|
|
17
|
+
<MenuToggleAction
|
|
18
|
+
id="split-button-action-primary-example-with-toggle-button"
|
|
19
|
+
key="split-action-primary"
|
|
20
|
+
aria-label="Action"
|
|
21
|
+
>
|
|
22
|
+
Action
|
|
23
|
+
</MenuToggleAction>
|
|
24
|
+
]}
|
|
31
25
|
aria-label="Menu toggle with action split button"
|
|
32
26
|
/>{' '}
|
|
33
27
|
<MenuToggle
|
|
34
28
|
variant="secondary"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
</MenuToggleAction>
|
|
45
|
-
]
|
|
46
|
-
}}
|
|
29
|
+
splitButtonItems={[
|
|
30
|
+
<MenuToggleAction
|
|
31
|
+
id="split-button-action-secondary-example-with-toggle-button"
|
|
32
|
+
key="split-action-secondary"
|
|
33
|
+
aria-label="Action"
|
|
34
|
+
>
|
|
35
|
+
Action
|
|
36
|
+
</MenuToggleAction>
|
|
37
|
+
]}
|
|
47
38
|
aria-label="Menu toggle with action split button"
|
|
48
39
|
/>
|
|
49
40
|
</React.Fragment>
|
|
@@ -4,23 +4,23 @@ import { MenuToggleCheckbox, MenuToggle } from '@patternfly/react-core';
|
|
|
4
4
|
export const MenuToggleSplitButtonCheckbox: React.FunctionComponent = () => (
|
|
5
5
|
<React.Fragment>
|
|
6
6
|
<MenuToggle
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
7
|
+
splitButtonItems={[
|
|
8
|
+
<MenuToggleCheckbox id="split-button-checkbox-example" key="split-checkbox" aria-label="Select all" />
|
|
9
|
+
]}
|
|
10
10
|
aria-label="Menu toggle with checkbox split button"
|
|
11
11
|
/>{' '}
|
|
12
12
|
<MenuToggle
|
|
13
13
|
variant="primary"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
14
|
+
splitButtonItems={[
|
|
15
|
+
<MenuToggleCheckbox id="split-button-checkbox-example" key="split-checkbox" aria-label="Select all" />
|
|
16
|
+
]}
|
|
17
17
|
aria-label="Menu toggle with checkbox split button"
|
|
18
18
|
/>{' '}
|
|
19
19
|
<MenuToggle
|
|
20
20
|
variant="secondary"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
21
|
+
splitButtonItems={[
|
|
22
|
+
<MenuToggleCheckbox id="split-button-checkbox-example" key="split-checkbox" aria-label="Select all" />
|
|
23
|
+
]}
|
|
24
24
|
aria-label="Menu toggle with checkbox split button"
|
|
25
25
|
/>
|
|
26
26
|
</React.Fragment>
|
|
@@ -4,47 +4,41 @@ import { MenuToggleCheckbox, MenuToggle } from '@patternfly/react-core';
|
|
|
4
4
|
export const MenuToggleSplitButtonCheckboxWithText: React.FunctionComponent = () => (
|
|
5
5
|
<React.Fragment>
|
|
6
6
|
<MenuToggle
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
]
|
|
17
|
-
}}
|
|
7
|
+
splitButtonItems={[
|
|
8
|
+
<MenuToggleCheckbox
|
|
9
|
+
id="split-button-checkbox-with-text-example"
|
|
10
|
+
key="split-checkbox-with-text"
|
|
11
|
+
aria-label="Select all"
|
|
12
|
+
>
|
|
13
|
+
10 selected
|
|
14
|
+
</MenuToggleCheckbox>
|
|
15
|
+
]}
|
|
18
16
|
aria-label="Menu toggle with checkbox split button and text"
|
|
19
17
|
/>{' '}
|
|
20
18
|
<MenuToggle
|
|
21
19
|
variant="primary"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
]
|
|
32
|
-
}}
|
|
20
|
+
splitButtonItems={[
|
|
21
|
+
<MenuToggleCheckbox
|
|
22
|
+
id="split-button-checkbox-primary-example"
|
|
23
|
+
key="split-checkbox-primary"
|
|
24
|
+
aria-label="Select all"
|
|
25
|
+
>
|
|
26
|
+
10 selected
|
|
27
|
+
</MenuToggleCheckbox>
|
|
28
|
+
]}
|
|
33
29
|
aria-label="Primary menu toggle with checkbox split button"
|
|
34
30
|
/>{' '}
|
|
35
31
|
<MenuToggle
|
|
36
32
|
variant="secondary"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
]
|
|
47
|
-
}}
|
|
33
|
+
splitButtonItems={[
|
|
34
|
+
<MenuToggleCheckbox
|
|
35
|
+
id="split-button-checkbox-secondary-example"
|
|
36
|
+
key="split-checkbox-secondary"
|
|
37
|
+
aria-label="Select all"
|
|
38
|
+
>
|
|
39
|
+
10 selected
|
|
40
|
+
</MenuToggleCheckbox>
|
|
41
|
+
]}
|
|
48
42
|
aria-label="Secondary menu toggle with checkbox split button"
|
|
49
43
|
/>
|
|
50
44
|
</React.Fragment>
|
|
@@ -4,45 +4,39 @@ import { MenuToggleCheckbox, MenuToggle } from '@patternfly/react-core';
|
|
|
4
4
|
export const MenuToggleSplitButtonCheckboxWithToggleText: React.FunctionComponent = () => (
|
|
5
5
|
<React.Fragment>
|
|
6
6
|
<MenuToggle
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
]
|
|
15
|
-
}}
|
|
7
|
+
splitButtonItems={[
|
|
8
|
+
<MenuToggleCheckbox
|
|
9
|
+
id="split-button-checkbox-with-text-example"
|
|
10
|
+
key="split-checkbox-with-text"
|
|
11
|
+
aria-label="Select all"
|
|
12
|
+
/>
|
|
13
|
+
]}
|
|
16
14
|
aria-label="Menu toggle with checkbox split button and text"
|
|
17
15
|
>
|
|
18
16
|
10 selected
|
|
19
17
|
</MenuToggle>{' '}
|
|
20
18
|
<MenuToggle
|
|
21
19
|
variant="primary"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
]
|
|
30
|
-
}}
|
|
20
|
+
splitButtonItems={[
|
|
21
|
+
<MenuToggleCheckbox
|
|
22
|
+
id="split-button-checkbox-primary-example"
|
|
23
|
+
key="split-checkbox-primary"
|
|
24
|
+
aria-label="Select all"
|
|
25
|
+
/>
|
|
26
|
+
]}
|
|
31
27
|
aria-label="Primary menu toggle with checkbox split button"
|
|
32
28
|
>
|
|
33
29
|
10 selected
|
|
34
30
|
</MenuToggle>{' '}
|
|
35
31
|
<MenuToggle
|
|
36
32
|
variant="secondary"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
]
|
|
45
|
-
}}
|
|
33
|
+
splitButtonItems={[
|
|
34
|
+
<MenuToggleCheckbox
|
|
35
|
+
id="split-button-checkbox-secondary-example"
|
|
36
|
+
key="split-checkbox-secondary"
|
|
37
|
+
aria-label="Select all"
|
|
38
|
+
/>
|
|
39
|
+
]}
|
|
46
40
|
aria-label="Secondary menu toggle with checkbox split button"
|
|
47
41
|
>
|
|
48
42
|
10 selected
|
|
@@ -3,7 +3,7 @@ import styles from '@patternfly/react-styles/css/components/Page/page';
|
|
|
3
3
|
import { css } from '@patternfly/react-styles';
|
|
4
4
|
import globalBreakpointXl from '@patternfly/react-tokens/dist/esm/t_global_breakpoint_xl';
|
|
5
5
|
import { debounce, canUseDOM } from '../../helpers/util';
|
|
6
|
-
import { Drawer, DrawerContent,
|
|
6
|
+
import { Drawer, DrawerContent, DrawerPanelContent } from '../Drawer';
|
|
7
7
|
import { PageBreadcrumb, PageBreadcrumbProps } from './PageBreadcrumb';
|
|
8
8
|
import { PageGroup, PageGroupProps } from './PageGroup';
|
|
9
9
|
import { getResizeObserver } from '../../helpers/resizeObserver';
|
|
@@ -345,9 +345,7 @@ class Page extends React.Component<PageProps, PageState> {
|
|
|
345
345
|
{notificationDrawer && (
|
|
346
346
|
<div className={css(styles.pageDrawer)}>
|
|
347
347
|
<Drawer isExpanded={isNotificationDrawerExpanded} onExpand={(event) => onNotificationDrawerExpand(event)}>
|
|
348
|
-
<DrawerContent panelContent={panelContent}>
|
|
349
|
-
<DrawerContentBody>{main}</DrawerContentBody>
|
|
350
|
-
</DrawerContent>
|
|
348
|
+
<DrawerContent panelContent={panelContent}>{main}</DrawerContent>
|
|
351
349
|
</Drawer>
|
|
352
350
|
</div>
|
|
353
351
|
)}
|
|
@@ -260,15 +260,13 @@ export const ToolbarStacked: React.FunctionComponent = () => {
|
|
|
260
260
|
isExpanded={isSplitButtonDropdownOpen}
|
|
261
261
|
onClick={onSplitButtonToggle}
|
|
262
262
|
aria-label="Toolbar stacked example split toggle"
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
]
|
|
271
|
-
}}
|
|
263
|
+
splitButtonItems={[
|
|
264
|
+
<MenuToggleCheckbox
|
|
265
|
+
key="toolbar-stacked-split-button-checkbox-1"
|
|
266
|
+
id="toolbar-stacked-split-button-checkbox-1"
|
|
267
|
+
aria-label="Select all"
|
|
268
|
+
/>
|
|
269
|
+
]}
|
|
272
270
|
/>
|
|
273
271
|
)}
|
|
274
272
|
>
|
|
@@ -283,19 +283,17 @@ export const CardViewBasic: React.FunctionComponent = () => {
|
|
|
283
283
|
isExpanded={splitButtonDropdownIsOpen}
|
|
284
284
|
onClick={onSplitButtonToggle}
|
|
285
285
|
aria-label="Select cards"
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
]
|
|
298
|
-
}}
|
|
286
|
+
splitButtonItems={[
|
|
287
|
+
<MenuToggleCheckbox
|
|
288
|
+
id="split-dropdown-checkbox"
|
|
289
|
+
key="split-dropdown-checkbox"
|
|
290
|
+
aria-label={anySelected ? 'Deselect all cards' : 'Select all cards'}
|
|
291
|
+
isChecked={areAllSelected}
|
|
292
|
+
onClick={(e) => splitCheckboxSelectAll(e)}
|
|
293
|
+
>
|
|
294
|
+
{numSelected !== 0 && `${numSelected} selected`}
|
|
295
|
+
</MenuToggleCheckbox>
|
|
296
|
+
]}
|
|
299
297
|
></MenuToggle>
|
|
300
298
|
)}
|
|
301
299
|
>
|
|
@@ -38,15 +38,13 @@ export const DataListBasic: React.FunctionComponent = () => {
|
|
|
38
38
|
<ToolbarItem variant="bulk-select">
|
|
39
39
|
<MenuToggle
|
|
40
40
|
aria-label="Select cards"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
]
|
|
49
|
-
}}
|
|
41
|
+
splitButtonItems={[
|
|
42
|
+
<MenuToggleCheckbox
|
|
43
|
+
id="split-dropdown-checkbox"
|
|
44
|
+
key="split-dropdown-checkbox"
|
|
45
|
+
aria-label={'Select all cards'}
|
|
46
|
+
/>
|
|
47
|
+
]}
|
|
50
48
|
></MenuToggle>
|
|
51
49
|
</ToolbarItem>
|
|
52
50
|
<ToolbarItem>
|
|
@@ -209,17 +209,15 @@ export const FilterAttributeSearch: React.FunctionComponent = () => {
|
|
|
209
209
|
ref={bulkSelectToggleRef}
|
|
210
210
|
onClick={onBulkSelectToggleClick}
|
|
211
211
|
isExpanded={isBulkSelectOpen}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
]
|
|
222
|
-
}}
|
|
212
|
+
splitButtonItems={[
|
|
213
|
+
<MenuToggleCheckbox
|
|
214
|
+
id="attribute-search-input-bulk-select"
|
|
215
|
+
key="attribute-search-input-bulk-select"
|
|
216
|
+
aria-label="Select all"
|
|
217
|
+
isChecked={menuToggleCheckmark}
|
|
218
|
+
onChange={(checked, _event) => selectAllRepos(checked)}
|
|
219
|
+
/>
|
|
220
|
+
]}
|
|
223
221
|
aria-label="Full table selection checkbox"
|
|
224
222
|
/>
|
|
225
223
|
);
|
|
@@ -187,17 +187,15 @@ export const FilterCheckboxSelect: React.FunctionComponent = () => {
|
|
|
187
187
|
ref={bulkSelectToggleRef}
|
|
188
188
|
onClick={onBulkSelectToggleClick}
|
|
189
189
|
isExpanded={isBulkSelectOpen}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
]
|
|
200
|
-
}}
|
|
190
|
+
splitButtonItems={[
|
|
191
|
+
<MenuToggleCheckbox
|
|
192
|
+
id="checkbox-bulk-select"
|
|
193
|
+
key="checkbox-bulk-select"
|
|
194
|
+
aria-label="Select all"
|
|
195
|
+
isChecked={menuToggleCheckmark}
|
|
196
|
+
onChange={(checked, _event) => selectAllRepos(checked)}
|
|
197
|
+
/>
|
|
198
|
+
]}
|
|
201
199
|
aria-label="Full table selection checkbox"
|
|
202
200
|
/>
|
|
203
201
|
);
|
|
@@ -192,17 +192,15 @@ export const FilterFaceted: React.FunctionComponent = () => {
|
|
|
192
192
|
ref={bulkSelectToggleRef}
|
|
193
193
|
onClick={onBulkSelectToggleClick}
|
|
194
194
|
isExpanded={isBulkSelectOpen}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
]
|
|
205
|
-
}}
|
|
195
|
+
splitButtonItems={[
|
|
196
|
+
<MenuToggleCheckbox
|
|
197
|
+
id="filter-faceted-input-bulk-select"
|
|
198
|
+
key="filter-faceted-input-bulk-select"
|
|
199
|
+
aria-label="Select all"
|
|
200
|
+
isChecked={menuToggleCheckmark}
|
|
201
|
+
onChange={(checked, _event) => selectAllRepos(checked)}
|
|
202
|
+
/>
|
|
203
|
+
]}
|
|
206
204
|
aria-label="Full table selection checkbox"
|
|
207
205
|
/>
|
|
208
206
|
);
|