| 1 |
import { Component } from 'react'; |
| 2 |
import { PageBreadcrumbProps } from './PageBreadcrumb'; |
| 3 |
import { PageGroupProps } from './PageGroup'; |
| 4 |
export declare enum PageLayouts { |
| 5 |
vertical = "vertical", |
| 6 |
horizontal = "horizontal" |
| 7 |
} |
| 8 |
export interface PageProps extends React.HTMLProps<HTMLDivElement> { |
| 9 |
/** Content rendered inside the main section of the page layout (e.g. <PageSection />) */ |
| 10 |
children?: React.ReactNode; |
| 11 |
/** Additional classes added to the page layout */ |
| 12 |
className?: string; |
| 13 |
/** @beta Indicates the layout variant */ |
| 14 |
variant?: 'default' | 'docked'; |
| 15 |
/** @beta Flag indicating the docked nav is expanded on mobile. Only applies when variant is docked. */ |
| 16 |
isDockExpanded?: boolean; |
| 17 |
/** @beta Flag indicating the docked nav should display text on desktop. Only applies when variant is docked, and |
| 18 |
* will handle toggling the visibility of the text in individual isDocked components. |
| 19 |
*/ |
| 20 |
isDockTextExpanded?: boolean; |
| 21 |
/** The horizontal masthead content (e.g. <Masthead />). When using the docked variant, this content will only render at mobile viewports. */ |
| 22 |
masthead?: React.ReactNode; |
| 23 |
/** @beta Content to render in the vertical dock when variant of docked is used. At mobile viewports, this content will be replaced with the content passed to masthead. */ |
| 24 |
dockContent?: React.ReactNode; |
| 25 |
/** Sidebar component for a side nav, recommended to be a PageSidebar. If set to null, the page grid layout |
| 26 |
* will render without a sidebar. |
| 27 |
*/ |
| 28 |
sidebar?: React.ReactNode; |
| 29 |
/** Notification drawer component for an optional notification drawer (e.g. <NotificationDrawer />) */ |
| 30 |
notificationDrawer?: React.ReactNode; |
| 31 |
/** Flag indicating Notification drawer in expanded */ |
| 32 |
isNotificationDrawerExpanded?: boolean; |
| 33 |
/** Sets default drawer size */ |
| 34 |
drawerDefaultSize?: string; |
| 35 |
/** Sets the minimum drawer size*/ |
| 36 |
drawerMinSize?: string; |
| 37 |
/** Sets the maximum drawer size */ |
| 38 |
drawerMaxSize?: string; |
| 39 |
/** Flag indicating if breadcrumb width should be limited */ |
| 40 |
isBreadcrumbWidthLimited?: boolean; |
| 41 |
/** Callback when notification drawer panel is finished expanding. */ |
| 42 |
onNotificationDrawerExpand?: (event: KeyboardEvent | React.MouseEvent | React.TransitionEvent) => void; |
| 43 |
/** Skip to content component for the page */ |
| 44 |
skipToContent?: React.ReactElement<any>; |
| 45 |
/** Sets the value for role on the <main> element */ |
| 46 |
role?: string; |
| 47 |
/** an id to use for the [role="main"] element */ |
| 48 |
mainContainerId?: string; |
| 49 |
/** tabIndex to use for the [role="main"] element, null to unset it */ |
| 50 |
mainTabIndex?: number | null; |
| 51 |
/** |
| 52 |
* If true, manages the sidebar open/close state and there is no need to pass the isSidebarOpen boolean into |
| 53 |
* the sidebar component or add a callback onSidebarToggle function into the Masthead component |
| 54 |
*/ |
| 55 |
isManagedSidebar?: boolean; |
| 56 |
/** Flag indicating if horizontal sub navigation width should be limited */ |
| 57 |
isHorizontalSubnavWidthLimited?: boolean; |
| 58 |
/** |
| 59 |
* If true, the managed sidebar is initially open for desktop view |
| 60 |
*/ |
| 61 |
defaultManagedSidebarIsOpen?: boolean; |
| 62 |
/** |
| 63 |
* Can add callback to be notified when resize occurs, for example to set the sidebar isSidebarOpen prop to false for a width < 768px |
| 64 |
* Returns object { mobileView: boolean, windowSize: number } |
| 65 |
*/ |
| 66 |
onPageResize?: ((event: MouseEvent | TouchEvent | React.KeyboardEvent, object: any) => void) | null; |
| 67 |
/** |
| 68 |
* The page resize observer uses the breakpoints returned from this function when adding the pf-m-breakpoint-[default|sm|md|lg|xl|2xl] class |
| 69 |
* You can override the default getBreakpoint function to return breakpoints at different sizes than the default |
| 70 |
* You can view the default getBreakpoint function here: |
| 71 |
* https://github.com/patternfly/patternfly-react/blob/main/packages/react-core/src/helpers/util.ts |
| 72 |
*/ |
| 73 |
getBreakpoint?: (width: number | null) => 'default' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'; |
| 74 |
/** |
| 75 |
* The page resize observer uses the breakpoints returned from this function when adding the pf-m-breakpoint-[default|sm|md|lg|xl|2xl] class |
| 76 |
* You can override the default getVerticalBreakpoint function to return breakpoints at different sizes than the default |
| 77 |
* You can view the default getVerticalBreakpoint function here: |
| 78 |
* https://github.com/patternfly/patternfly-react/blob/main/packages/react-core/src/helpers/util.ts |
| 79 |
*/ |
| 80 |
getVerticalBreakpoint?: (height: number | null) => 'default' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'; |
| 81 |
/** Banner component for the page. This will be rendered above a breadcrumb if one is also passed. |
| 82 |
*/ |
| 83 |
banner?: React.ReactNode; |
| 84 |
/** Breadcrumb component for the page */ |
| 85 |
breadcrumb?: React.ReactNode; |
| 86 |
/** Horizontal sub navigation component for the page */ |
| 87 |
horizontalSubnav?: React.ReactNode; |
| 88 |
/** Accessible label, can be used to name main section */ |
| 89 |
mainAriaLabel?: string; |
| 90 |
/** Flag indicating if the horizontal sub navigation should be in a group */ |
| 91 |
isHorizontalSubnavGrouped?: boolean; |
| 92 |
/** Flag indicating if the breadcrumb should be in a group */ |
| 93 |
isBreadcrumbGrouped?: boolean; |
| 94 |
/** Additional content of the group */ |
| 95 |
additionalGroupedContent?: React.ReactNode; |
| 96 |
/** HTML component used as main component of the page. Defaults to 'main', only pass in 'div' if another 'main' element already exists. */ |
| 97 |
mainComponent?: 'main' | 'div'; |
| 98 |
/** Additional props of the group */ |
| 99 |
groupProps?: PageGroupProps; |
| 100 |
/** Additional props of the breadcrumb */ |
| 101 |
breadcrumbProps?: PageBreadcrumbProps; |
| 102 |
/** Enables children to fill the available vertical space. Child page sections or groups that should fill should be passed the isFilled property. */ |
| 103 |
isContentFilled?: boolean; |
| 104 |
} |
| 105 |
export interface PageState { |
| 106 |
desktopIsSidebarOpen: boolean; |
| 107 |
mobileIsSidebarOpen: boolean; |
| 108 |
mobileView: boolean; |
| 109 |
width: number; |
| 110 |
height: number; |
| 111 |
} |
| 112 |
declare class Page extends Component<PageProps, PageState> { |
| 113 |
static displayName: string; |
| 114 |
static defaultProps: PageProps; |
| 115 |
mainRef: import("react").RefObject<HTMLDivElement>; |
| 116 |
pageRef: import("react").RefObject<HTMLDivElement>; |
| 117 |
observer: any; |
| 118 |
constructor(props: PageProps); |
| 119 |
componentDidMount(): void; |
| 120 |
componentWillUnmount(): void; |
| 121 |
getWindowWidth: () => number; |
| 122 |
isMobile: () => boolean; |
| 123 |
resize: (_event?: MouseEvent | TouchEvent | React.KeyboardEvent<Element>) => void; |
| 124 |
handleResize: (...args: any[]) => void; |
| 125 |
handleMainClick: () => void; |
| 126 |
onSidebarToggleMobile: () => void; |
| 127 |
onSidebarToggleDesktop: () => void; |
| 128 |
render(): import("react/jsx-runtime").JSX.Element; |
| 129 |
} |
| 130 |
export { Page }; |
| 131 |
//# sourceMappingURL=Page.d.ts.map |