@patternfly/react-core 6.0.0-alpha.82 → 6.0.0-alpha.84
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 +17 -0
- package/components/package.json +1 -8
- package/deprecated/package.json +1 -8
- package/dist/dynamic/components/AboutModal/package.json +1 -8
- package/dist/dynamic/components/Accordion/package.json +1 -8
- package/dist/dynamic/components/ActionList/package.json +1 -8
- package/dist/dynamic/components/Alert/package.json +1 -8
- package/dist/dynamic/components/Avatar/package.json +1 -8
- package/dist/dynamic/components/BackToTop/package.json +1 -8
- package/dist/dynamic/components/Backdrop/package.json +1 -8
- package/dist/dynamic/components/BackgroundImage/package.json +1 -8
- package/dist/dynamic/components/Badge/package.json +1 -8
- package/dist/dynamic/components/Banner/package.json +1 -8
- package/dist/dynamic/components/Brand/package.json +1 -8
- package/dist/dynamic/components/Breadcrumb/package.json +1 -8
- package/dist/dynamic/components/Button/package.json +1 -8
- package/dist/dynamic/components/CalendarMonth/package.json +1 -8
- package/dist/dynamic/components/Card/package.json +1 -8
- package/dist/dynamic/components/Checkbox/package.json +1 -8
- package/dist/dynamic/components/ClipboardCopy/package.json +1 -8
- package/dist/dynamic/components/CodeBlock/package.json +1 -8
- package/dist/dynamic/components/Content/package.json +1 -8
- package/dist/dynamic/components/DataList/package.json +1 -8
- package/dist/dynamic/components/DatePicker/package.json +1 -8
- package/dist/dynamic/components/DescriptionList/package.json +1 -8
- package/dist/dynamic/components/Divider/package.json +1 -8
- package/dist/dynamic/components/Drawer/package.json +1 -8
- package/dist/dynamic/components/Dropdown/package.json +1 -8
- package/dist/dynamic/components/DualListSelector/package.json +1 -8
- package/dist/dynamic/components/EmptyState/package.json +1 -8
- package/dist/dynamic/components/ExpandableSection/package.json +1 -8
- package/dist/dynamic/components/FileUpload/package.json +1 -8
- package/dist/dynamic/components/Form/package.json +1 -8
- package/dist/dynamic/components/FormSelect/package.json +1 -8
- package/dist/dynamic/components/HelperText/package.json +1 -8
- package/dist/dynamic/components/Hint/package.json +1 -8
- package/dist/dynamic/components/Icon/package.json +1 -8
- package/dist/dynamic/components/InputGroup/package.json +1 -8
- package/dist/dynamic/components/JumpLinks/package.json +1 -8
- package/dist/dynamic/components/Label/package.json +1 -8
- package/dist/dynamic/components/List/package.json +1 -8
- package/dist/dynamic/components/LoginPage/package.json +1 -8
- package/dist/dynamic/components/Masthead/package.json +1 -8
- package/dist/dynamic/components/Menu/package.json +1 -8
- package/dist/dynamic/components/MenuToggle/package.json +1 -8
- package/dist/dynamic/components/Modal/package.json +1 -8
- package/dist/dynamic/components/MultipleFileUpload/package.json +1 -8
- package/dist/dynamic/components/Nav/package.json +1 -8
- package/dist/dynamic/components/NotificationBadge/package.json +1 -8
- package/dist/dynamic/components/NotificationDrawer/package.json +1 -8
- package/dist/dynamic/components/NumberInput/package.json +1 -8
- package/dist/dynamic/components/OverflowMenu/package.json +1 -8
- package/dist/dynamic/components/Page/package.json +1 -8
- package/dist/dynamic/components/Pagination/package.json +1 -8
- package/dist/dynamic/components/Panel/package.json +1 -8
- package/dist/dynamic/components/Popover/package.json +1 -8
- package/dist/dynamic/components/Progress/package.json +1 -8
- package/dist/dynamic/components/ProgressStepper/package.json +1 -8
- package/dist/dynamic/components/Radio/package.json +1 -8
- package/dist/dynamic/components/SearchInput/package.json +1 -8
- package/dist/dynamic/components/Select/package.json +1 -8
- package/dist/dynamic/components/Sidebar/package.json +1 -8
- package/dist/dynamic/components/SimpleList/package.json +1 -8
- package/dist/dynamic/components/Skeleton/package.json +1 -8
- package/dist/dynamic/components/SkipToContent/package.json +1 -8
- package/dist/dynamic/components/Slider/package.json +1 -8
- package/dist/dynamic/components/Spinner/package.json +1 -8
- package/dist/dynamic/components/Switch/package.json +1 -8
- package/dist/dynamic/components/Tabs/package.json +1 -8
- package/dist/dynamic/components/TextArea/package.json +1 -8
- package/dist/dynamic/components/TextInput/package.json +1 -8
- package/dist/dynamic/components/TextInputGroup/package.json +1 -8
- package/dist/dynamic/components/Tile/package.json +1 -8
- package/dist/dynamic/components/TimePicker/package.json +1 -8
- package/dist/dynamic/components/Timestamp/package.json +1 -8
- package/dist/dynamic/components/Title/package.json +1 -8
- package/dist/dynamic/components/ToggleGroup/package.json +1 -8
- package/dist/dynamic/components/Toolbar/package.json +1 -8
- package/dist/dynamic/components/Tooltip/package.json +1 -8
- package/dist/dynamic/components/TreeView/package.json +1 -8
- package/dist/dynamic/components/Truncate/package.json +1 -8
- package/dist/dynamic/components/Wizard/hooks/package.json +1 -8
- package/dist/dynamic/components/Wizard/package.json +1 -8
- package/dist/dynamic/deprecated/components/Chip/package.json +1 -8
- package/dist/dynamic/deprecated/components/DragDrop/package.json +1 -8
- package/dist/dynamic/deprecated/components/DualListSelector/package.json +1 -8
- package/dist/dynamic/deprecated/components/Modal/package.json +1 -8
- package/dist/dynamic/deprecated/components/Wizard/package.json +1 -8
- package/dist/dynamic/deprecated/components/package.json +1 -8
- package/dist/dynamic/helpers/FocusTrap/FocusTrap/package.json +1 -8
- package/dist/dynamic/helpers/GenerateId/GenerateId/package.json +1 -8
- package/dist/dynamic/helpers/KeyboardHandler/package.json +1 -8
- package/dist/dynamic/helpers/OUIA/ouia/package.json +1 -8
- package/dist/dynamic/helpers/Popper/Popper/package.json +1 -8
- package/dist/dynamic/helpers/constants/package.json +1 -8
- package/dist/dynamic/helpers/datetimeUtils/package.json +1 -8
- package/dist/dynamic/helpers/fileUtils/package.json +1 -8
- package/dist/dynamic/helpers/htmlConstants/package.json +1 -8
- package/dist/dynamic/helpers/package.json +1 -8
- package/dist/dynamic/helpers/resizeObserver/package.json +1 -8
- package/dist/dynamic/helpers/typeUtils/package.json +1 -8
- package/dist/dynamic/helpers/useInterval/package.json +1 -8
- package/dist/dynamic/helpers/useIsomorphicLayout/package.json +1 -8
- package/dist/dynamic/helpers/useUnmountEffect/package.json +1 -8
- package/dist/dynamic/helpers/util/package.json +1 -8
- package/dist/dynamic/layouts/Bullseye/package.json +1 -8
- package/dist/dynamic/layouts/Flex/package.json +1 -8
- package/dist/dynamic/layouts/Gallery/package.json +1 -8
- package/dist/dynamic/layouts/Grid/package.json +1 -8
- package/dist/dynamic/layouts/Level/package.json +1 -8
- package/dist/dynamic/layouts/Split/package.json +1 -8
- package/dist/dynamic/layouts/Stack/package.json +1 -8
- package/dist/dynamic/styles/package.json +1 -8
- package/dist/dynamic-modules.json +2 -2
- package/dist/esm/components/Page/Page.d.ts.map +1 -1
- package/dist/esm/components/Page/Page.js +8 -8
- package/dist/esm/components/Page/Page.js.map +1 -1
- package/dist/esm/components/Page/PageBody.d.ts +9 -0
- package/dist/esm/components/Page/PageBody.d.ts.map +1 -0
- package/dist/esm/components/Page/PageBody.js +10 -0
- package/dist/esm/components/Page/PageBody.js.map +1 -0
- package/dist/esm/components/Page/PageBreadcrumb.d.ts +5 -1
- package/dist/esm/components/Page/PageBreadcrumb.d.ts.map +1 -1
- package/dist/esm/components/Page/PageBreadcrumb.js +3 -4
- package/dist/esm/components/Page/PageBreadcrumb.js.map +1 -1
- package/dist/esm/components/Page/PageSection.d.ts +5 -2
- package/dist/esm/components/Page/PageSection.d.ts.map +1 -1
- package/dist/esm/components/Page/PageSection.js +3 -6
- package/dist/esm/components/Page/PageSection.js.map +1 -1
- package/dist/esm/components/Page/index.d.ts +1 -1
- package/dist/esm/components/Page/index.d.ts.map +1 -1
- package/dist/esm/components/Page/index.js +1 -1
- package/dist/esm/components/Page/index.js.map +1 -1
- package/dist/esm/components/Pagination/Pagination.d.ts +2 -0
- package/dist/esm/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/esm/components/Pagination/Pagination.js +2 -2
- package/dist/esm/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/Pagination/PaginationOptionsMenu.d.ts +3 -0
- package/dist/esm/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
- package/dist/esm/components/Pagination/PaginationOptionsMenu.js +19 -16
- package/dist/esm/components/Pagination/PaginationOptionsMenu.js.map +1 -1
- package/dist/esm/components/Wizard/Wizard.d.ts.map +1 -1
- package/dist/esm/components/Wizard/Wizard.js +5 -1
- package/dist/esm/components/Wizard/Wizard.js.map +1 -1
- package/dist/esm/components/Wizard/WizardContext.d.ts.map +1 -1
- package/dist/esm/components/Wizard/WizardContext.js +4 -0
- package/dist/esm/components/Wizard/WizardContext.js.map +1 -1
- package/dist/esm/components/Wizard/WizardStep.d.ts +2 -2
- package/dist/esm/components/Wizard/WizardStep.d.ts.map +1 -1
- package/dist/esm/components/Wizard/WizardToggle.d.ts.map +1 -1
- package/dist/esm/components/Wizard/WizardToggle.js +1 -2
- package/dist/esm/components/Wizard/WizardToggle.js.map +1 -1
- package/dist/js/components/Page/Page.d.ts.map +1 -1
- package/dist/js/components/Page/Page.js +7 -7
- package/dist/js/components/Page/Page.js.map +1 -1
- package/dist/js/components/Page/PageBody.d.ts +9 -0
- package/dist/js/components/Page/PageBody.d.ts.map +1 -0
- package/dist/js/components/Page/PageBody.js +14 -0
- package/dist/js/components/Page/PageBody.js.map +1 -0
- package/dist/js/components/Page/PageBreadcrumb.d.ts +5 -1
- package/dist/js/components/Page/PageBreadcrumb.d.ts.map +1 -1
- package/dist/js/components/Page/PageBreadcrumb.js +3 -4
- package/dist/js/components/Page/PageBreadcrumb.js.map +1 -1
- package/dist/js/components/Page/PageSection.d.ts +5 -2
- package/dist/js/components/Page/PageSection.d.ts.map +1 -1
- package/dist/js/components/Page/PageSection.js +3 -6
- package/dist/js/components/Page/PageSection.js.map +1 -1
- package/dist/js/components/Page/index.d.ts +1 -1
- package/dist/js/components/Page/index.d.ts.map +1 -1
- package/dist/js/components/Page/index.js +1 -1
- package/dist/js/components/Page/index.js.map +1 -1
- package/dist/js/components/Pagination/Pagination.d.ts +2 -0
- package/dist/js/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/js/components/Pagination/Pagination.js +2 -2
- package/dist/js/components/Pagination/Pagination.js.map +1 -1
- package/dist/js/components/Pagination/PaginationOptionsMenu.d.ts +3 -0
- package/dist/js/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
- package/dist/js/components/Pagination/PaginationOptionsMenu.js +19 -16
- package/dist/js/components/Pagination/PaginationOptionsMenu.js.map +1 -1
- package/dist/js/components/Wizard/Wizard.d.ts.map +1 -1
- package/dist/js/components/Wizard/Wizard.js +5 -1
- package/dist/js/components/Wizard/Wizard.js.map +1 -1
- package/dist/js/components/Wizard/WizardContext.d.ts.map +1 -1
- package/dist/js/components/Wizard/WizardContext.js +4 -0
- package/dist/js/components/Wizard/WizardContext.js.map +1 -1
- package/dist/js/components/Wizard/WizardStep.d.ts +2 -2
- package/dist/js/components/Wizard/WizardStep.d.ts.map +1 -1
- package/dist/js/components/Wizard/WizardToggle.d.ts.map +1 -1
- package/dist/js/components/Wizard/WizardToggle.js +1 -2
- package/dist/js/components/Wizard/WizardToggle.js.map +1 -1
- package/dist/umd/assets/{output-CJBOn_jY.css → output-WegUSgI7.css} +2632 -2632
- package/dist/umd/react-core.min.js +1 -1
- package/helpers/package.json +1 -8
- package/layouts/package.json +1 -8
- package/next/package.json +1 -8
- package/package.json +2 -2
- package/src/components/Page/Page.tsx +11 -21
- package/src/components/Page/PageBody.tsx +18 -0
- package/src/components/Page/PageBreadcrumb.tsx +7 -2
- package/src/components/Page/PageSection.tsx +8 -5
- package/src/components/Page/__tests__/Page.test.tsx +11 -41
- package/src/components/Page/__tests__/PageBody.test.tsx +34 -0
- package/src/components/Page/__tests__/PageBreadcrumb.test.tsx +14 -1
- package/src/components/Page/__tests__/PageSection.test.tsx +15 -2
- package/src/components/Page/__tests__/__snapshots__/Page.test.tsx.snap +950 -973
- package/src/components/Page/__tests__/__snapshots__/PageBody.test.tsx.snap +11 -0
- package/src/components/Page/__tests__/__snapshots__/PageBreadcrumb.test.tsx.snap +30 -6
- package/src/components/Page/__tests__/__snapshots__/PageSection.test.tsx.snap +66 -14
- package/src/components/Page/examples/Page.md +2 -11
- package/src/components/Page/examples/PageGroupSection.tsx +19 -22
- package/src/components/Page/index.ts +1 -1
- package/src/components/Pagination/Pagination.tsx +4 -0
- package/src/components/Pagination/PaginationOptionsMenu.tsx +42 -34
- package/src/components/Pagination/__tests__/Generated/__snapshots__/PaginationOptionsMenu.test.tsx.snap +42 -38
- package/src/components/Pagination/__tests__/__snapshots__/Pagination.test.tsx.snap +854 -774
- package/src/components/Wizard/Wizard.tsx +6 -1
- package/src/components/Wizard/WizardContext.tsx +5 -0
- package/src/components/Wizard/WizardStep.tsx +2 -2
- package/src/components/Wizard/WizardToggle.tsx +1 -2
- package/src/components/Wizard/__tests__/WizardStep.test.tsx +0 -5
- package/src/components/Wizard/examples/Wizard.md +0 -2
- package/src/components/Wizard/examples/WizardStepDrawerContent.tsx +13 -3
- package/src/components/Wizard/examples/WizardValidateOnButtonPress.tsx +15 -4
- package/src/components/Wizard/examples/WizardWithCustomFooter.tsx +24 -9
- package/src/demos/examples/Wizard/InModalWithDrawer.tsx +10 -5
- package/src/demos/examples/Wizard/InModalWithDrawerInformationalStep.tsx +10 -5
- package/src/demos/examples/Wizard/InPageWithDrawer.tsx +10 -5
- package/src/demos/examples/Wizard/InPageWithDrawerInformationalStep.tsx +10 -5
- package/dist/esm/components/Page/PageNavigation.d.ts +0 -31
- package/dist/esm/components/Page/PageNavigation.d.ts.map +0 -1
- package/dist/esm/components/Page/PageNavigation.js +0 -21
- package/dist/esm/components/Page/PageNavigation.js.map +0 -1
- package/dist/js/components/Page/PageNavigation.d.ts +0 -31
- package/dist/js/components/Page/PageNavigation.d.ts.map +0 -1
- package/dist/js/components/Page/PageNavigation.js +0 -25
- package/dist/js/components/Page/PageNavigation.js.map +0 -1
- package/src/components/Page/PageNavigation.tsx +0 -72
- package/src/components/Page/__tests__/PageNavigation.test.tsx +0 -78
- package/src/components/Page/__tests__/__snapshots__/PageNavigation.test.tsx.snap +0 -77
|
@@ -77,7 +77,7 @@ export const Wizard = ({
|
|
|
77
77
|
onStepChange,
|
|
78
78
|
onSave,
|
|
79
79
|
onClose,
|
|
80
|
-
shouldFocusContent =
|
|
80
|
+
shouldFocusContent = true,
|
|
81
81
|
...wrapperProps
|
|
82
82
|
}: WizardProps) => {
|
|
83
83
|
const [activeStepIndex, setActiveStepIndex] = React.useState(startIndex);
|
|
@@ -92,6 +92,11 @@ export const Wizard = ({
|
|
|
92
92
|
}
|
|
93
93
|
}, [startIndex]);
|
|
94
94
|
|
|
95
|
+
// When children change, active step index should reset
|
|
96
|
+
React.useEffect(() => {
|
|
97
|
+
setActiveStepIndex(startIndex);
|
|
98
|
+
}, [children, startIndex]);
|
|
99
|
+
|
|
95
100
|
const focusMainContentElement = () =>
|
|
96
101
|
setTimeout(() => {
|
|
97
102
|
wrapperRef?.current?.focus && wrapperRef.current.focus();
|
|
@@ -74,6 +74,11 @@ export const WizardContextProvider: React.FunctionComponent<WizardContextProvide
|
|
|
74
74
|
const [currentSteps, setCurrentSteps] = React.useState<WizardStepType[]>(initialSteps);
|
|
75
75
|
const [currentFooter, setCurrentFooter] = React.useState<WizardFooterType>();
|
|
76
76
|
|
|
77
|
+
// Callback to update steps if they change after initial render
|
|
78
|
+
React.useEffect(() => {
|
|
79
|
+
setCurrentSteps(initialSteps);
|
|
80
|
+
}, [initialSteps]);
|
|
81
|
+
|
|
77
82
|
// Combined initial and current state steps
|
|
78
83
|
const steps = React.useMemo(
|
|
79
84
|
() =>
|
|
@@ -16,8 +16,8 @@ export interface WizardStepProps {
|
|
|
16
16
|
id: string | number;
|
|
17
17
|
/** Optional for when the step is used as a parent to sub-steps */
|
|
18
18
|
children?: React.ReactNode | undefined;
|
|
19
|
-
/** Props for WizardBody that wraps content by default.
|
|
20
|
-
body?: Omit<Omit<WizardBodyProps, 'children'>, 'children'
|
|
19
|
+
/** Props for WizardBody that wraps content by default. */
|
|
20
|
+
body?: Omit<Omit<WizardBodyProps, 'children'>, 'children'>;
|
|
21
21
|
/** Optional list of sub-steps */
|
|
22
22
|
steps?: React.ReactElement<WizardStepProps>[];
|
|
23
23
|
/** Flag to disable the step's navigation item */
|
|
@@ -73,8 +73,7 @@ export const WizardToggle = ({
|
|
|
73
73
|
|
|
74
74
|
return (
|
|
75
75
|
<React.Fragment key={step.id}>
|
|
76
|
-
{activeStep?.id === step.id &&
|
|
77
|
-
(body || body === undefined ? <WizardBody {...body}>{children}</WizardBody> : children)}
|
|
76
|
+
{activeStep?.id === step.id && <WizardBody {...body}>{children}</WizardBody>}
|
|
78
77
|
|
|
79
78
|
<div key={step.id} style={{ display: 'none' }}>
|
|
80
79
|
<WizardStep {...propsWithoutChildren} />
|
|
@@ -55,11 +55,6 @@ test('renders with children', () => {
|
|
|
55
55
|
expect(screen.getByText('content')).toBeVisible();
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
-
test('excludes WizardBody when body is set to null', () => {
|
|
59
|
-
render(<WizardStep id="test-step" name="Test step" body={null} />);
|
|
60
|
-
expect(screen.queryByRole('main')).toBeNull();
|
|
61
|
-
});
|
|
62
|
-
|
|
63
58
|
test('updates "isDisabled" in context when the value changes', () => {
|
|
64
59
|
render(<WizardStep {...testStep} isDisabled />);
|
|
65
60
|
expect(setStep).toHaveBeenCalledWith({ ...testStepProps, isDisabled: true, isVisited: true });
|
|
@@ -65,8 +65,6 @@ import layout from '@patternfly/react-styles/css/layouts/Bullseye/bullseye';
|
|
|
65
65
|
|
|
66
66
|
To focus the main content element of the `Wizard`, pass in the `shouldFocusContent` property. It is recommended that this is passed in so that users can navigate through a `WizardStep` content in order.
|
|
67
67
|
|
|
68
|
-
If a `WizardStep` is passed a `body={null}` property, you must manually handle focus.
|
|
69
|
-
|
|
70
68
|
```ts file="./WizardFocusOnNextBack.tsx"
|
|
71
69
|
|
|
72
70
|
```
|
|
@@ -59,17 +59,27 @@ const StepContentWithDrawer: React.FunctionComponent = () => {
|
|
|
59
59
|
|
|
60
60
|
export const WizardStepDrawerContent: React.FunctionComponent = () => (
|
|
61
61
|
<Wizard height={400} title="With drawer wizard">
|
|
62
|
-
<WizardStep body={
|
|
62
|
+
<WizardStep body={{ hasNoPadding: true }} name="Step 1" id="with-drawer-step-1">
|
|
63
63
|
<StepContentWithDrawer />
|
|
64
64
|
</WizardStep>
|
|
65
65
|
<WizardStep
|
|
66
66
|
name="Step 2"
|
|
67
67
|
id="with-drawer-step-2"
|
|
68
68
|
steps={[
|
|
69
|
-
<WizardStep
|
|
69
|
+
<WizardStep
|
|
70
|
+
body={{ hasNoPadding: true }}
|
|
71
|
+
key="with-drawer-substep-1"
|
|
72
|
+
name="Substep 1"
|
|
73
|
+
id="with-drawer-substep-1"
|
|
74
|
+
>
|
|
70
75
|
<StepContentWithDrawer />
|
|
71
76
|
</WizardStep>,
|
|
72
|
-
<WizardStep
|
|
77
|
+
<WizardStep
|
|
78
|
+
body={{ hasNoPadding: true }}
|
|
79
|
+
key="with-drawer-substep-2"
|
|
80
|
+
name="Substep 2"
|
|
81
|
+
id="with-drawer-substep-2"
|
|
82
|
+
>
|
|
73
83
|
<StepContentWithDrawer />
|
|
74
84
|
</WizardStep>
|
|
75
85
|
]}
|
|
@@ -2,6 +2,9 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
Button,
|
|
5
|
+
ActionList,
|
|
6
|
+
ActionListGroup,
|
|
7
|
+
ActionListItem,
|
|
5
8
|
Alert,
|
|
6
9
|
EmptyState,
|
|
7
10
|
EmptyStateFooter,
|
|
@@ -96,10 +99,18 @@ const LastStepFooter: React.FunctionComponent<LastStepFooterProps> = ({
|
|
|
96
99
|
|
|
97
100
|
return (
|
|
98
101
|
<WizardFooterWrapper>
|
|
99
|
-
<
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
<ActionList>
|
|
103
|
+
<ActionListGroup>
|
|
104
|
+
<ActionListItem>
|
|
105
|
+
<Button variant="secondary" onClick={goToPrevStep}>
|
|
106
|
+
Back
|
|
107
|
+
</Button>
|
|
108
|
+
</ActionListItem>
|
|
109
|
+
<ActionListItem>
|
|
110
|
+
<Button onClick={onValidate}>Validate</Button>
|
|
111
|
+
</ActionListItem>
|
|
112
|
+
</ActionListGroup>
|
|
113
|
+
</ActionList>
|
|
103
114
|
</WizardFooterWrapper>
|
|
104
115
|
);
|
|
105
116
|
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
+
ActionList,
|
|
5
|
+
ActionListGroup,
|
|
6
|
+
ActionListItem,
|
|
4
7
|
Button,
|
|
5
8
|
Flex,
|
|
6
9
|
FlexItem,
|
|
@@ -40,15 +43,27 @@ const CustomStepTwoFooter = () => {
|
|
|
40
43
|
|
|
41
44
|
return (
|
|
42
45
|
<WizardFooterWrapper>
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
<ActionList>
|
|
47
|
+
<ActionListGroup>
|
|
48
|
+
<ActionListItem>
|
|
49
|
+
<Button variant="secondary" onClick={goToPrevStep} isDisabled={isLoading}>
|
|
50
|
+
Back
|
|
51
|
+
</Button>
|
|
52
|
+
</ActionListItem>
|
|
53
|
+
<ActionListItem>
|
|
54
|
+
<Button variant="primary" onClick={onNext} isLoading={isLoading} isDisabled={isLoading}>
|
|
55
|
+
Async Next
|
|
56
|
+
</Button>
|
|
57
|
+
</ActionListItem>
|
|
58
|
+
</ActionListGroup>
|
|
59
|
+
<ActionListGroup>
|
|
60
|
+
<ActionListItem>
|
|
61
|
+
<Button variant="link" onClick={close} isDisabled={isLoading}>
|
|
62
|
+
Cancel
|
|
63
|
+
</Button>
|
|
64
|
+
</ActionListItem>
|
|
65
|
+
</ActionListGroup>
|
|
66
|
+
</ActionList>
|
|
52
67
|
</WizardFooterWrapper>
|
|
53
68
|
);
|
|
54
69
|
};
|
|
@@ -88,25 +88,30 @@ export const WizardModalWithDrawerDemo: React.FunctionComponent = () => {
|
|
|
88
88
|
}
|
|
89
89
|
height={400}
|
|
90
90
|
>
|
|
91
|
-
<WizardStep body={
|
|
91
|
+
<WizardStep body={{ hasNoPadding: true }} name="Information" id="wizard-step-1">
|
|
92
92
|
{createStepContentWithDrawer('Information step')}
|
|
93
93
|
</WizardStep>
|
|
94
94
|
<WizardStep
|
|
95
95
|
name="Configuration"
|
|
96
96
|
id="wizard-step-2"
|
|
97
97
|
steps={[
|
|
98
|
-
<WizardStep body={
|
|
98
|
+
<WizardStep body={{ hasNoPadding: true }} name="Substep A" id="wizard-step-2a" key="wizard-step-2a">
|
|
99
99
|
{createStepContentWithDrawer('Configuration substep A')}
|
|
100
100
|
</WizardStep>,
|
|
101
|
-
<WizardStep body={
|
|
101
|
+
<WizardStep body={{ hasNoPadding: true }} name="Substep B" id="wizard-step-2b" key="wizard-step-2b">
|
|
102
102
|
{createStepContentWithDrawer('Configuration substep B')}
|
|
103
103
|
</WizardStep>
|
|
104
104
|
]}
|
|
105
105
|
/>
|
|
106
|
-
<WizardStep body={
|
|
106
|
+
<WizardStep body={{ hasNoPadding: true }} name="Additional" id="wizard-step-3">
|
|
107
107
|
{createStepContentWithDrawer('Additional step')}
|
|
108
108
|
</WizardStep>
|
|
109
|
-
<WizardStep
|
|
109
|
+
<WizardStep
|
|
110
|
+
body={{ hasNoPadding: true }}
|
|
111
|
+
name="Review"
|
|
112
|
+
id="wizard-step-4"
|
|
113
|
+
footer={{ nextButtonText: 'Finish' }}
|
|
114
|
+
>
|
|
110
115
|
{createStepContentWithDrawer('Review step')}
|
|
111
116
|
</WizardStep>
|
|
112
117
|
</Wizard>
|
|
@@ -95,25 +95,30 @@ export const WizardModalWithDrawerInfoStepDemo: React.FunctionComponent = () =>
|
|
|
95
95
|
}
|
|
96
96
|
height={400}
|
|
97
97
|
>
|
|
98
|
-
<WizardStep body={
|
|
98
|
+
<WizardStep body={{ hasNoPadding: true }} name="Information" id="wizard-step-1">
|
|
99
99
|
{createStepContentWithDrawer('Information step')}
|
|
100
100
|
</WizardStep>
|
|
101
101
|
<WizardStep
|
|
102
102
|
name="Configuration"
|
|
103
103
|
id="wizard-step-2"
|
|
104
104
|
steps={[
|
|
105
|
-
<WizardStep body={
|
|
105
|
+
<WizardStep body={{ hasNoPadding: true }} name="Substep A" id="wizard-step-2a" key="wizard-step-2a">
|
|
106
106
|
{createStepContentWithDrawer('Configuration substep A')}
|
|
107
107
|
</WizardStep>,
|
|
108
|
-
<WizardStep body={
|
|
108
|
+
<WizardStep body={{ hasNoPadding: true }} name="Substep B" id="wizard-step-2b" key="wizard-step-2b">
|
|
109
109
|
{createStepContentWithDrawer('Configuration substep B')}
|
|
110
110
|
</WizardStep>
|
|
111
111
|
]}
|
|
112
112
|
/>
|
|
113
|
-
<WizardStep body={
|
|
113
|
+
<WizardStep body={{ hasNoPadding: true }} name="Additional" id="wizard-step-3">
|
|
114
114
|
{createStepContentWithDrawer('Additional step')}
|
|
115
115
|
</WizardStep>
|
|
116
|
-
<WizardStep
|
|
116
|
+
<WizardStep
|
|
117
|
+
body={{ hasNoPadding: true }}
|
|
118
|
+
name="Review"
|
|
119
|
+
id="wizard-step-4"
|
|
120
|
+
footer={{ nextButtonText: 'Finish' }}
|
|
121
|
+
>
|
|
117
122
|
{createStepContentWithDrawer('Review step')}
|
|
118
123
|
</WizardStep>
|
|
119
124
|
</Wizard>
|
|
@@ -166,25 +166,30 @@ export const WizardFullPageWithDrawerDemo: React.FunctionComponent = () => {
|
|
|
166
166
|
</PageSection>
|
|
167
167
|
<PageSection type={PageSectionTypes.wizard}>
|
|
168
168
|
<Wizard>
|
|
169
|
-
<WizardStep body={
|
|
169
|
+
<WizardStep body={{ hasNoPadding: true }} name="Information" id="wizard-step-1">
|
|
170
170
|
{createStepContentWithDrawer('Information step')}
|
|
171
171
|
</WizardStep>
|
|
172
172
|
<WizardStep
|
|
173
173
|
name="Configuration"
|
|
174
174
|
id="wizard-step-2"
|
|
175
175
|
steps={[
|
|
176
|
-
<WizardStep body={
|
|
176
|
+
<WizardStep body={{ hasNoPadding: true }} name="Substep A" id="wizard-step-2a" key="wizard-step-2a">
|
|
177
177
|
{createStepContentWithDrawer('Configuration substep A')}
|
|
178
178
|
</WizardStep>,
|
|
179
|
-
<WizardStep body={
|
|
179
|
+
<WizardStep body={{ hasNoPadding: true }} name="Substep B" id="wizard-step-2b" key="wizard-step-2b">
|
|
180
180
|
{createStepContentWithDrawer('Configuration substep B')}
|
|
181
181
|
</WizardStep>
|
|
182
182
|
]}
|
|
183
183
|
/>
|
|
184
|
-
<WizardStep body={
|
|
184
|
+
<WizardStep body={{ hasNoPadding: true }} name="Additional" id="wizard-step-3">
|
|
185
185
|
{createStepContentWithDrawer('Additional step')}
|
|
186
186
|
</WizardStep>
|
|
187
|
-
<WizardStep
|
|
187
|
+
<WizardStep
|
|
188
|
+
body={{ hasNoPadding: true }}
|
|
189
|
+
name="Review"
|
|
190
|
+
id="wizard-step-4"
|
|
191
|
+
footer={{ nextButtonText: 'Finish' }}
|
|
192
|
+
>
|
|
188
193
|
{createStepContentWithDrawer('Review step')}
|
|
189
194
|
</WizardStep>
|
|
190
195
|
</Wizard>
|
|
@@ -171,25 +171,30 @@ export const WizardFullPageWithDrawerInfoStepDemo: React.FunctionComponent = ()
|
|
|
171
171
|
</PageSection>
|
|
172
172
|
<PageSection type={PageSectionTypes.wizard} ß>
|
|
173
173
|
<Wizard>
|
|
174
|
-
<WizardStep body={
|
|
174
|
+
<WizardStep body={{ hasNoPadding: true }} name="Information" id="wizard-step-1">
|
|
175
175
|
{createStepContentWithDrawer('Information step')}
|
|
176
176
|
</WizardStep>
|
|
177
177
|
<WizardStep
|
|
178
178
|
name="Configuration"
|
|
179
179
|
id="wizard-step-2"
|
|
180
180
|
steps={[
|
|
181
|
-
<WizardStep body={
|
|
181
|
+
<WizardStep body={{ hasNoPadding: true }} name="Substep A" id="wizard-step-2a" key="wizard-step-2a">
|
|
182
182
|
{createStepContentWithDrawer('Configuration substep A')}
|
|
183
183
|
</WizardStep>,
|
|
184
|
-
<WizardStep body={
|
|
184
|
+
<WizardStep body={{ hasNoPadding: true }} name="Substep B" id="wizard-step-2b" key="wizard-step-2b">
|
|
185
185
|
{createStepContentWithDrawer('Configuration substep B')}
|
|
186
186
|
</WizardStep>
|
|
187
187
|
]}
|
|
188
188
|
/>
|
|
189
|
-
<WizardStep body={
|
|
189
|
+
<WizardStep body={{ hasNoPadding: true }} name="Additional" id="wizard-step-3">
|
|
190
190
|
{createStepContentWithDrawer('Additional step')}
|
|
191
191
|
</WizardStep>
|
|
192
|
-
<WizardStep
|
|
192
|
+
<WizardStep
|
|
193
|
+
body={{ hasNoPadding: true }}
|
|
194
|
+
name="Review"
|
|
195
|
+
id="wizard-step-4"
|
|
196
|
+
footer={{ nextButtonText: 'Finish' }}
|
|
197
|
+
>
|
|
193
198
|
{createStepContentWithDrawer('Review step')}
|
|
194
199
|
</WizardStep>
|
|
195
200
|
</Wizard>
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export interface PageNavigationProps extends React.HTMLProps<HTMLDivElement> {
|
|
3
|
-
/** Additional classes to apply to the PageNavigation */
|
|
4
|
-
className?: string;
|
|
5
|
-
/** Content rendered inside of the PageNavigation */
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
/** Limits the width of the PageNavigation */
|
|
8
|
-
isWidthLimited?: boolean;
|
|
9
|
-
/** Modifier indicating if the PageBreadcrumb is sticky to the top or bottom at various breakpoints */
|
|
10
|
-
stickyOnBreakpoint?: {
|
|
11
|
-
default?: 'top' | 'bottom';
|
|
12
|
-
sm?: 'top' | 'bottom';
|
|
13
|
-
md?: 'top' | 'bottom';
|
|
14
|
-
lg?: 'top' | 'bottom';
|
|
15
|
-
xl?: 'top' | 'bottom';
|
|
16
|
-
'2xl'?: 'top' | 'bottom';
|
|
17
|
-
};
|
|
18
|
-
/** Flag indicating if PageNavigation should have a shadow at the top */
|
|
19
|
-
hasShadowTop?: boolean;
|
|
20
|
-
/** Flag indicating if PageNavigation should have a shadow at the bottom */
|
|
21
|
-
hasShadowBottom?: boolean;
|
|
22
|
-
/** Flag indicating if the PageNavigation has a scrolling overflow */
|
|
23
|
-
hasOverflowScroll?: boolean;
|
|
24
|
-
/** Adds an accessible name to the page navigation when the hasOverflowScroll prop is set to true. */
|
|
25
|
-
'aria-label'?: string;
|
|
26
|
-
}
|
|
27
|
-
export declare const PageNavigation: {
|
|
28
|
-
({ className, children, isWidthLimited, stickyOnBreakpoint, hasShadowTop, hasShadowBottom, hasOverflowScroll, "aria-label": ariaLabel, ...props }: PageNavigationProps): React.JSX.Element;
|
|
29
|
-
displayName: string;
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=PageNavigation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageNavigation.d.ts","sourceRoot":"","sources":["../../../../src/components/Page/PageNavigation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,MAAM,WAAW,mBAAoB,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IAC1E,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,6CAA6C;IAC7C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,sGAAsG;IACtG,kBAAkB,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;QAC3B,EAAE,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;QACtB,EAAE,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;QACtB,EAAE,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;QACtB,EAAE,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;QACtB,KAAK,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;KAC1B,CAAC;IACF,wEAAwE;IACxE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,2EAA2E;IAC3E,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,qEAAqE;IACrE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,qGAAqG;IACrG,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,cAAc;uJAUxB,mBAAmB;;CA4BrB,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { __rest } from "tslib";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { css } from '@patternfly/react-styles';
|
|
4
|
-
import styles from '@patternfly/react-styles/css/components/Page/page.mjs';
|
|
5
|
-
import { formatBreakpointMods } from '../../helpers/util';
|
|
6
|
-
import { PageContext } from './PageContext';
|
|
7
|
-
export const PageNavigation = (_a) => {
|
|
8
|
-
var { className = '', children, isWidthLimited, stickyOnBreakpoint, hasShadowTop = false, hasShadowBottom = false, hasOverflowScroll = false, 'aria-label': ariaLabel } = _a, props = __rest(_a, ["className", "children", "isWidthLimited", "stickyOnBreakpoint", "hasShadowTop", "hasShadowBottom", "hasOverflowScroll", 'aria-label']);
|
|
9
|
-
const { height, getVerticalBreakpoint } = React.useContext(PageContext);
|
|
10
|
-
React.useEffect(() => {
|
|
11
|
-
if (hasOverflowScroll && !ariaLabel) {
|
|
12
|
-
/* eslint-disable no-console */
|
|
13
|
-
console.warn('PageNavigation: An accessible aria-label is required when hasOverflowScroll is set to true.');
|
|
14
|
-
}
|
|
15
|
-
}, [hasOverflowScroll, ariaLabel]);
|
|
16
|
-
return (React.createElement("div", Object.assign({ className: css(styles.pageMainNav, formatBreakpointMods(stickyOnBreakpoint, styles, 'sticky-', getVerticalBreakpoint(height), true), isWidthLimited && styles.modifiers.limitWidth, hasShadowTop && styles.modifiers.shadowTop, hasShadowBottom && styles.modifiers.shadowBottom, hasOverflowScroll && styles.modifiers.overflowScroll, className) }, (hasOverflowScroll && { tabIndex: 0, role: 'region', 'aria-label': ariaLabel }), props),
|
|
17
|
-
isWidthLimited && React.createElement("div", { className: css(styles.pageMainBody) }, children),
|
|
18
|
-
!isWidthLimited && children));
|
|
19
|
-
};
|
|
20
|
-
PageNavigation.displayName = 'PageNavigation';
|
|
21
|
-
//# sourceMappingURL=PageNavigation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageNavigation.js","sourceRoot":"","sources":["../../../../src/components/Page/PageNavigation.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,MAAM,8DAA0D;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AA4B5C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAUT,EAAE,EAAE;QAVK,EAC7B,SAAS,GAAG,EAAE,EACd,QAAQ,EACR,cAAc,EACd,kBAAkB,EAClB,YAAY,GAAG,KAAK,EACpB,eAAe,GAAG,KAAK,EACvB,iBAAiB,GAAG,KAAK,EACzB,YAAY,EAAE,SAAS,OAEH,EADjB,KAAK,cATqB,uIAU9B,CADS;IAER,MAAM,EAAE,MAAM,EAAE,qBAAqB,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAExE,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,iBAAiB,IAAI,CAAC,SAAS,EAAE,CAAC;YACpC,+BAA+B;YAC/B,OAAO,CAAC,IAAI,CAAC,6FAA6F,CAAC,CAAC;QAC9G,CAAC;IACH,CAAC,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC,CAAC;IAEnC,OAAO,CACL,2CACE,SAAS,EAAE,GAAG,CACZ,MAAM,CAAC,WAAW,EAClB,oBAAoB,CAAC,kBAAkB,EAAE,MAAM,EAAE,SAAS,EAAE,qBAAqB,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,EAChG,cAAc,IAAI,MAAM,CAAC,SAAS,CAAC,UAAU,EAC7C,YAAY,IAAI,MAAM,CAAC,SAAS,CAAC,SAAS,EAC1C,eAAe,IAAI,MAAM,CAAC,SAAS,CAAC,YAAY,EAChD,iBAAiB,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,EACpD,SAAS,CACV,IACG,CAAC,iBAAiB,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,EAC/E,KAAK;QAER,cAAc,IAAI,6BAAK,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,IAAG,QAAQ,CAAO;QAC5E,CAAC,cAAc,IAAI,QAAQ,CACxB,CACP,CAAC;AACJ,CAAC,CAAC;AACF,cAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export interface PageNavigationProps extends React.HTMLProps<HTMLDivElement> {
|
|
3
|
-
/** Additional classes to apply to the PageNavigation */
|
|
4
|
-
className?: string;
|
|
5
|
-
/** Content rendered inside of the PageNavigation */
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
/** Limits the width of the PageNavigation */
|
|
8
|
-
isWidthLimited?: boolean;
|
|
9
|
-
/** Modifier indicating if the PageBreadcrumb is sticky to the top or bottom at various breakpoints */
|
|
10
|
-
stickyOnBreakpoint?: {
|
|
11
|
-
default?: 'top' | 'bottom';
|
|
12
|
-
sm?: 'top' | 'bottom';
|
|
13
|
-
md?: 'top' | 'bottom';
|
|
14
|
-
lg?: 'top' | 'bottom';
|
|
15
|
-
xl?: 'top' | 'bottom';
|
|
16
|
-
'2xl'?: 'top' | 'bottom';
|
|
17
|
-
};
|
|
18
|
-
/** Flag indicating if PageNavigation should have a shadow at the top */
|
|
19
|
-
hasShadowTop?: boolean;
|
|
20
|
-
/** Flag indicating if PageNavigation should have a shadow at the bottom */
|
|
21
|
-
hasShadowBottom?: boolean;
|
|
22
|
-
/** Flag indicating if the PageNavigation has a scrolling overflow */
|
|
23
|
-
hasOverflowScroll?: boolean;
|
|
24
|
-
/** Adds an accessible name to the page navigation when the hasOverflowScroll prop is set to true. */
|
|
25
|
-
'aria-label'?: string;
|
|
26
|
-
}
|
|
27
|
-
export declare const PageNavigation: {
|
|
28
|
-
({ className, children, isWidthLimited, stickyOnBreakpoint, hasShadowTop, hasShadowBottom, hasOverflowScroll, "aria-label": ariaLabel, ...props }: PageNavigationProps): React.JSX.Element;
|
|
29
|
-
displayName: string;
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=PageNavigation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageNavigation.d.ts","sourceRoot":"","sources":["../../../../src/components/Page/PageNavigation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,MAAM,WAAW,mBAAoB,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IAC1E,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,6CAA6C;IAC7C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,sGAAsG;IACtG,kBAAkB,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;QAC3B,EAAE,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;QACtB,EAAE,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;QACtB,EAAE,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;QACtB,EAAE,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;QACtB,KAAK,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;KAC1B,CAAC;IACF,wEAAwE;IACxE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,2EAA2E;IAC3E,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,qEAAqE;IACrE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,qGAAqG;IACrG,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,cAAc;uJAUxB,mBAAmB;;CA4BrB,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PageNavigation = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const react_styles_1 = require("@patternfly/react-styles");
|
|
7
|
-
const page_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/components/Page/page"));
|
|
8
|
-
const util_1 = require("../../helpers/util");
|
|
9
|
-
const PageContext_1 = require("./PageContext");
|
|
10
|
-
const PageNavigation = (_a) => {
|
|
11
|
-
var { className = '', children, isWidthLimited, stickyOnBreakpoint, hasShadowTop = false, hasShadowBottom = false, hasOverflowScroll = false, 'aria-label': ariaLabel } = _a, props = tslib_1.__rest(_a, ["className", "children", "isWidthLimited", "stickyOnBreakpoint", "hasShadowTop", "hasShadowBottom", "hasOverflowScroll", 'aria-label']);
|
|
12
|
-
const { height, getVerticalBreakpoint } = React.useContext(PageContext_1.PageContext);
|
|
13
|
-
React.useEffect(() => {
|
|
14
|
-
if (hasOverflowScroll && !ariaLabel) {
|
|
15
|
-
/* eslint-disable no-console */
|
|
16
|
-
console.warn('PageNavigation: An accessible aria-label is required when hasOverflowScroll is set to true.');
|
|
17
|
-
}
|
|
18
|
-
}, [hasOverflowScroll, ariaLabel]);
|
|
19
|
-
return (React.createElement("div", Object.assign({ className: (0, react_styles_1.css)(page_1.default.pageMainNav, (0, util_1.formatBreakpointMods)(stickyOnBreakpoint, page_1.default, 'sticky-', getVerticalBreakpoint(height), true), isWidthLimited && page_1.default.modifiers.limitWidth, hasShadowTop && page_1.default.modifiers.shadowTop, hasShadowBottom && page_1.default.modifiers.shadowBottom, hasOverflowScroll && page_1.default.modifiers.overflowScroll, className) }, (hasOverflowScroll && { tabIndex: 0, role: 'region', 'aria-label': ariaLabel }), props),
|
|
20
|
-
isWidthLimited && React.createElement("div", { className: (0, react_styles_1.css)(page_1.default.pageMainBody) }, children),
|
|
21
|
-
!isWidthLimited && children));
|
|
22
|
-
};
|
|
23
|
-
exports.PageNavigation = PageNavigation;
|
|
24
|
-
exports.PageNavigation.displayName = 'PageNavigation';
|
|
25
|
-
//# sourceMappingURL=PageNavigation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageNavigation.js","sourceRoot":"","sources":["../../../../src/components/Page/PageNavigation.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAC/B,2DAA+C;AAC/C,qGAAuE;AACvE,6CAA0D;AAC1D,+CAA4C;AA4BrC,MAAM,cAAc,GAAG,CAAC,EAUT,EAAE,EAAE;QAVK,EAC7B,SAAS,GAAG,EAAE,EACd,QAAQ,EACR,cAAc,EACd,kBAAkB,EAClB,YAAY,GAAG,KAAK,EACpB,eAAe,GAAG,KAAK,EACvB,iBAAiB,GAAG,KAAK,EACzB,YAAY,EAAE,SAAS,OAEH,EADjB,KAAK,sBATqB,uIAU9B,CADS;IAER,MAAM,EAAE,MAAM,EAAE,qBAAqB,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC,yBAAW,CAAC,CAAC;IAExE,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,iBAAiB,IAAI,CAAC,SAAS,EAAE,CAAC;YACpC,+BAA+B;YAC/B,OAAO,CAAC,IAAI,CAAC,6FAA6F,CAAC,CAAC;QAC9G,CAAC;IACH,CAAC,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC,CAAC;IAEnC,OAAO,CACL,2CACE,SAAS,EAAE,IAAA,kBAAG,EACZ,cAAM,CAAC,WAAW,EAClB,IAAA,2BAAoB,EAAC,kBAAkB,EAAE,cAAM,EAAE,SAAS,EAAE,qBAAqB,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,EAChG,cAAc,IAAI,cAAM,CAAC,SAAS,CAAC,UAAU,EAC7C,YAAY,IAAI,cAAM,CAAC,SAAS,CAAC,SAAS,EAC1C,eAAe,IAAI,cAAM,CAAC,SAAS,CAAC,YAAY,EAChD,iBAAiB,IAAI,cAAM,CAAC,SAAS,CAAC,cAAc,EACpD,SAAS,CACV,IACG,CAAC,iBAAiB,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,EAC/E,KAAK;QAER,cAAc,IAAI,6BAAK,SAAS,EAAE,IAAA,kBAAG,EAAC,cAAM,CAAC,YAAY,CAAC,IAAG,QAAQ,CAAO;QAC5E,CAAC,cAAc,IAAI,QAAQ,CACxB,CACP,CAAC;AACJ,CAAC,CAAC;AAtCW,QAAA,cAAc,kBAsCzB;AACF,sBAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { css } from '@patternfly/react-styles';
|
|
3
|
-
import styles from '@patternfly/react-styles/css/components/Page/page';
|
|
4
|
-
import { formatBreakpointMods } from '../../helpers/util';
|
|
5
|
-
import { PageContext } from './PageContext';
|
|
6
|
-
|
|
7
|
-
export interface PageNavigationProps extends React.HTMLProps<HTMLDivElement> {
|
|
8
|
-
/** Additional classes to apply to the PageNavigation */
|
|
9
|
-
className?: string;
|
|
10
|
-
/** Content rendered inside of the PageNavigation */
|
|
11
|
-
children?: React.ReactNode;
|
|
12
|
-
/** Limits the width of the PageNavigation */
|
|
13
|
-
isWidthLimited?: boolean;
|
|
14
|
-
/** Modifier indicating if the PageBreadcrumb is sticky to the top or bottom at various breakpoints */
|
|
15
|
-
stickyOnBreakpoint?: {
|
|
16
|
-
default?: 'top' | 'bottom';
|
|
17
|
-
sm?: 'top' | 'bottom';
|
|
18
|
-
md?: 'top' | 'bottom';
|
|
19
|
-
lg?: 'top' | 'bottom';
|
|
20
|
-
xl?: 'top' | 'bottom';
|
|
21
|
-
'2xl'?: 'top' | 'bottom';
|
|
22
|
-
};
|
|
23
|
-
/** Flag indicating if PageNavigation should have a shadow at the top */
|
|
24
|
-
hasShadowTop?: boolean;
|
|
25
|
-
/** Flag indicating if PageNavigation should have a shadow at the bottom */
|
|
26
|
-
hasShadowBottom?: boolean;
|
|
27
|
-
/** Flag indicating if the PageNavigation has a scrolling overflow */
|
|
28
|
-
hasOverflowScroll?: boolean;
|
|
29
|
-
/** Adds an accessible name to the page navigation when the hasOverflowScroll prop is set to true. */
|
|
30
|
-
'aria-label'?: string;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export const PageNavigation = ({
|
|
34
|
-
className = '',
|
|
35
|
-
children,
|
|
36
|
-
isWidthLimited,
|
|
37
|
-
stickyOnBreakpoint,
|
|
38
|
-
hasShadowTop = false,
|
|
39
|
-
hasShadowBottom = false,
|
|
40
|
-
hasOverflowScroll = false,
|
|
41
|
-
'aria-label': ariaLabel,
|
|
42
|
-
...props
|
|
43
|
-
}: PageNavigationProps) => {
|
|
44
|
-
const { height, getVerticalBreakpoint } = React.useContext(PageContext);
|
|
45
|
-
|
|
46
|
-
React.useEffect(() => {
|
|
47
|
-
if (hasOverflowScroll && !ariaLabel) {
|
|
48
|
-
/* eslint-disable no-console */
|
|
49
|
-
console.warn('PageNavigation: An accessible aria-label is required when hasOverflowScroll is set to true.');
|
|
50
|
-
}
|
|
51
|
-
}, [hasOverflowScroll, ariaLabel]);
|
|
52
|
-
|
|
53
|
-
return (
|
|
54
|
-
<div
|
|
55
|
-
className={css(
|
|
56
|
-
styles.pageMainNav,
|
|
57
|
-
formatBreakpointMods(stickyOnBreakpoint, styles, 'sticky-', getVerticalBreakpoint(height), true),
|
|
58
|
-
isWidthLimited && styles.modifiers.limitWidth,
|
|
59
|
-
hasShadowTop && styles.modifiers.shadowTop,
|
|
60
|
-
hasShadowBottom && styles.modifiers.shadowBottom,
|
|
61
|
-
hasOverflowScroll && styles.modifiers.overflowScroll,
|
|
62
|
-
className
|
|
63
|
-
)}
|
|
64
|
-
{...(hasOverflowScroll && { tabIndex: 0, role: 'region', 'aria-label': ariaLabel })}
|
|
65
|
-
{...props}
|
|
66
|
-
>
|
|
67
|
-
{isWidthLimited && <div className={css(styles.pageMainBody)}>{children}</div>}
|
|
68
|
-
{!isWidthLimited && children}
|
|
69
|
-
</div>
|
|
70
|
-
);
|
|
71
|
-
};
|
|
72
|
-
PageNavigation.displayName = 'PageNavigation';
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { render, screen } from '@testing-library/react';
|
|
3
|
-
import { PageNavigation } from '../PageNavigation';
|
|
4
|
-
|
|
5
|
-
describe('page navigation', () => {
|
|
6
|
-
test('Verify basic render', () => {
|
|
7
|
-
const { asFragment } = render(<PageNavigation>test</PageNavigation>);
|
|
8
|
-
expect(asFragment()).toMatchSnapshot();
|
|
9
|
-
});
|
|
10
|
-
test('Verify limited width', () => {
|
|
11
|
-
const { asFragment } = render(<PageNavigation isWidthLimited>test</PageNavigation>);
|
|
12
|
-
expect(asFragment()).toMatchSnapshot();
|
|
13
|
-
});
|
|
14
|
-
test('Verify top sticky', () => {
|
|
15
|
-
const { asFragment } = render(<PageNavigation stickyOnBreakpoint={{ default: 'top' }}>test</PageNavigation>);
|
|
16
|
-
expect(asFragment()).toMatchSnapshot();
|
|
17
|
-
});
|
|
18
|
-
test('Verify bottom sticky', () => {
|
|
19
|
-
const { asFragment } = render(<PageNavigation stickyOnBreakpoint={{ default: 'bottom' }}>test</PageNavigation>);
|
|
20
|
-
expect(asFragment()).toMatchSnapshot();
|
|
21
|
-
});
|
|
22
|
-
test('Verify top shadow', () => {
|
|
23
|
-
const { asFragment } = render(<PageNavigation hasShadowTop>test</PageNavigation>);
|
|
24
|
-
expect(asFragment()).toMatchSnapshot();
|
|
25
|
-
});
|
|
26
|
-
test('Verify bottom shadow', () => {
|
|
27
|
-
const { asFragment } = render(<PageNavigation hasShadowBottom>test</PageNavigation>);
|
|
28
|
-
expect(asFragment()).toMatchSnapshot();
|
|
29
|
-
});
|
|
30
|
-
test('Verify overflow scroll', () => {
|
|
31
|
-
const { asFragment } = render(<PageNavigation hasOverflowScroll>test</PageNavigation>);
|
|
32
|
-
expect(asFragment()).toMatchSnapshot();
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
test('Renders without an aria-label by default', () => {
|
|
36
|
-
render(<PageNavigation>test</PageNavigation>);
|
|
37
|
-
|
|
38
|
-
expect(screen.getByText('test')).not.toHaveAccessibleName('Test label');
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
test('Renders with the passed aria-label applied', () => {
|
|
42
|
-
render(
|
|
43
|
-
<PageNavigation aria-label="Test label" hasOverflowScroll>
|
|
44
|
-
test
|
|
45
|
-
</PageNavigation>
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
expect(screen.getByText('test')).toHaveAccessibleName('Test label');
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
test('Does not log a warning in the console by default', () => {
|
|
52
|
-
const consoleWarning = jest.spyOn(console, 'warn').mockImplementation();
|
|
53
|
-
|
|
54
|
-
render(<PageNavigation>test</PageNavigation>);
|
|
55
|
-
|
|
56
|
-
expect(consoleWarning).not.toHaveBeenCalled();
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
test('Does not log a warning in the console when an aria-label is included with hasOverflowScroll', () => {
|
|
60
|
-
const consoleWarning = jest.spyOn(console, 'warn').mockImplementation();
|
|
61
|
-
|
|
62
|
-
render(
|
|
63
|
-
<PageNavigation hasOverflowScroll aria-label="Test label">
|
|
64
|
-
test
|
|
65
|
-
</PageNavigation>
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
expect(consoleWarning).not.toHaveBeenCalled();
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
test('Logs a warning in the console when an aria-label is not included with hasOverflowScroll', () => {
|
|
72
|
-
const consoleWarning = jest.spyOn(console, 'warn').mockImplementation();
|
|
73
|
-
|
|
74
|
-
render(<PageNavigation hasOverflowScroll>test</PageNavigation>);
|
|
75
|
-
|
|
76
|
-
expect(consoleWarning).toHaveBeenCalled();
|
|
77
|
-
});
|
|
78
|
-
});
|