Skip to content

Commit

Permalink
removed ToggleMenuBaseProps (patternfly#8235)
Browse files Browse the repository at this point in the history
  • Loading branch information
jenny-s51 authored and Titani committed Nov 2, 2022
1 parent ea0b061 commit 5466a1a
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@ import { ApplicationLauncherGroup } from './ApplicationLauncherGroup';
import { ApplicationLauncherSeparator } from './ApplicationLauncherSeparator';
import { ApplicationLauncherItem } from './ApplicationLauncherItem';
import { ApplicationLauncherContext } from './ApplicationLauncherContext';
import { ToggleMenuBaseProps } from '../../helpers/Popper/Popper';
import { createRenderableFavorites, extendItemsWithFavorite } from '../../helpers/favorites';

export interface ApplicationLauncherProps
extends Omit<ToggleMenuBaseProps, 'menuAppendTo'>,
React.HTMLProps<HTMLDivElement> {
export interface ApplicationLauncherProps extends React.HTMLProps<HTMLDivElement> {
/** Additional element css classes */
className?: string;
/** Display menu above or below dropdown toggle */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ import { TextInput } from '../TextInput';
import { InputGroup } from '../InputGroup';
import { KeyTypes } from '../../helpers/constants';
import { FocusTrap, getUniqueId } from '../../helpers';
import { ToggleMenuBaseProps } from '../../helpers/Popper/Popper';
import { Popper } from '../../helpers/Popper/Popper';
import { getOUIAProps, OUIAProps, getDefaultOUIAId } from '../../helpers';

export interface ContextSelectorProps extends Omit<ToggleMenuBaseProps, 'menuAppendTo'>, OUIAProps {
export interface ContextSelectorProps extends OUIAProps {
/** content rendered inside the Context Selector */
children?: React.ReactNode;
/** Classes applied to root element of Context Selector */
Expand Down
6 changes: 1 addition & 5 deletions packages/react-core/src/components/Dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ import * as React from 'react';
import styles from '@patternfly/react-styles/css/components/Dropdown/dropdown';
import { DropdownPosition, DropdownDirection, DropdownContext } from './dropdownConstants';
import { DropdownWithContext } from './DropdownWithContext';
import { ToggleMenuBaseProps } from '../../helpers/Popper/Popper';
import { OUIAProps, useOUIAId } from '../../helpers';

export interface DropdownProps
extends Omit<ToggleMenuBaseProps, 'menuAppendTo'>,
React.HTMLProps<HTMLDivElement>,
OUIAProps {
export interface DropdownProps extends React.HTMLProps<HTMLDivElement>, OUIAProps {
/** Anything which can be rendered in a dropdown */
children?: React.ReactNode;
/** Classes applied to root element of dropdown */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import styles from '@patternfly/react-styles/css/components/OptionsMenu/options-
import { DropdownContext } from '../Dropdown';
import { DropdownWithContext } from '../Dropdown/DropdownWithContext';
import { OUIAProps, useOUIAId } from '../../helpers';
import { ToggleMenuBaseProps } from '../../helpers/Popper/Popper';

export enum OptionsMenuPosition {
right = 'right',
Expand All @@ -15,10 +14,7 @@ export enum OptionsMenuDirection {
down = 'down'
}

export interface OptionsMenuProps
extends Omit<ToggleMenuBaseProps, 'menuAppendTo'>,
React.HTMLProps<HTMLDivElement>,
OUIAProps {
export interface OptionsMenuProps extends React.HTMLProps<HTMLDivElement>, OUIAProps {
/** Classes applied to root element of the options menu */
className?: string;
/** Id of the root element of the options menu */
Expand Down
5 changes: 2 additions & 3 deletions packages/react-core/src/components/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
} from '../../helpers';
import { KeyTypes } from '../../helpers/constants';
import { Divider } from '../Divider';
import { ToggleMenuBaseProps, Popper } from '../../helpers/Popper/Popper';
import { Popper } from '../../helpers/Popper/Popper';
import { createRenderableFavorites, extendItemsWithFavorite } from '../../helpers/favorites';
import { ValidatedOptions } from '../../helpers/constants';
import { findTabbableElements } from '../../helpers/util';
Expand All @@ -48,8 +48,7 @@ export interface SelectViewMoreObject {
onClick: (event: React.MouseEvent | React.ChangeEvent) => void;
}
export interface SelectProps
extends Omit<ToggleMenuBaseProps, 'menuAppendTo'>,
Omit<React.HTMLProps<HTMLDivElement>, 'onSelect' | 'ref' | 'checked' | 'selected'>,
extends Omit<React.HTMLProps<HTMLDivElement>, 'onSelect' | 'ref' | 'checked' | 'selected'>,
OUIAProps {
/** Content rendered inside the Select. Must be React.ReactElement<SelectGroupProps>[] */
children?: React.ReactElement[];
Expand Down
12 changes: 0 additions & 12 deletions packages/react-core/src/helpers/Popper/Popper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,6 @@ const getOppositePlacement = (placement: Placement): any =>
] as Placement
);

/** @deprecated Please use the menuAppendTo prop directly from within the PF component which uses it. */
export interface ToggleMenuBaseProps {
/** The container to append the menu to. Defaults to 'inline'
* If your menu is being cut off you can append it to an element higher up the DOM tree.
* Some examples:
* menuAppendTo="parent"
* menuAppendTo={() => document.body}
* menuAppendTo={document.getElementById('target')}
*/
menuAppendTo?: HTMLElement | (() => HTMLElement) | 'parent' | 'inline';
}

export const getOpacityTransition = (animationDuration: number) =>
`opacity ${animationDuration}ms cubic-bezier(.54, 1.5, .38, 1.11)`;

Expand Down

0 comments on commit 5466a1a

Please sign in to comment.