Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Rename positionStrategy to positionMethod #704

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/data/api/menu-positioner.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"container": { "type": { "name": "union", "description": "HTML element<br>&#124;&nbsp;func" } },
"hideWhenDetached": { "type": { "name": "bool" }, "default": "false" },
"keepMounted": { "type": { "name": "bool" }, "default": "false" },
"positionStrategy": {
"positionMethod": {
"type": { "name": "enum", "description": "'absolute'<br>&#124;&nbsp;'fixed'" },
"default": "'absolute'"
},
Expand Down
2 changes: 1 addition & 1 deletion docs/data/api/popover-positioner.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"container": { "type": { "name": "union", "description": "HTML element<br>&#124;&nbsp;func" } },
"hideWhenDetached": { "type": { "name": "bool" }, "default": "false" },
"keepMounted": { "type": { "name": "bool" }, "default": "false" },
"positionStrategy": {
"positionMethod": {
"type": { "name": "enum", "description": "'absolute'<br>&#124;&nbsp;'fixed'" },
"default": "'absolute'"
},
Expand Down
2 changes: 1 addition & 1 deletion docs/data/api/preview-card-positioner.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"container": { "type": { "name": "union", "description": "HTML element<br>&#124;&nbsp;func" } },
"hideWhenDetached": { "type": { "name": "bool" }, "default": "false" },
"keepMounted": { "type": { "name": "bool" }, "default": "false" },
"positionStrategy": {
"positionMethod": {
"type": { "name": "enum", "description": "'absolute'<br>&#124;&nbsp;'fixed'" },
"default": "'absolute'"
},
Expand Down
2 changes: 1 addition & 1 deletion docs/data/api/tooltip-positioner.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"container": { "type": { "name": "union", "description": "HTML element<br>&#124;&nbsp;func" } },
"hideWhenDetached": { "type": { "name": "bool" }, "default": "false" },
"keepMounted": { "type": { "name": "bool" }, "default": "false" },
"positionStrategy": {
"positionMethod": {
"type": { "name": "enum", "description": "'absolute'<br>&#124;&nbsp;'fixed'" },
"default": "'absolute'"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"keepMounted": {
"description": "Whether the menu popup remains mounted in the DOM while closed."
},
"positionStrategy": {
"positionMethod": {
"description": "The CSS position strategy for positioning the Menu popup element."
},
"render": { "description": "A function to customize rendering of the component." },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"keepMounted": {
"description": "Whether the popover remains mounted in the DOM while closed."
},
"positionStrategy": {
"positionMethod": {
"description": "The CSS position strategy for positioning the popover element."
},
"render": { "description": "A function to customize rendering of the component." },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"keepMounted": {
"description": "If <code>true</code>, preview card stays mounted in the DOM when closed."
},
"positionStrategy": {
"positionMethod": {
"description": "The CSS position strategy for positioning the preview card popup element."
},
"render": { "description": "A function to customize rendering of the component." },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"keepMounted": {
"description": "Whether the tooltip remains mounted in the DOM while closed."
},
"positionStrategy": {
"positionMethod": {
"description": "The CSS position strategy for positioning the tooltip element."
},
"render": { "description": "A function to customize rendering of the component." },
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/DocsVersionSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function DocsVersionSelector(props: DocsVersionSelectorProps) {
side="bottom"
alignment="start"
sideOffset={5}
positionStrategy="fixed"
positionMethod="fixed"
>
<Menu.Popup className={classes.popup}>
{versions.map((version) => (
Expand Down
6 changes: 3 additions & 3 deletions packages/mui-base/src/Menu/Positioner/MenuPositioner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const MenuPositioner = React.forwardRef(function MenuPositioner(
) {
const {
anchor,
positionStrategy = 'absolute',
positionMethod = 'absolute',
className,
render,
keepMounted = false,
Expand Down Expand Up @@ -69,7 +69,7 @@ const MenuPositioner = React.forwardRef(function MenuPositioner(
const positioner = useMenuPositioner({
anchor: anchor || triggerElement,
floatingRootContext,
positionStrategy,
positionMethod,
container,
open,
mounted,
Expand Down Expand Up @@ -253,7 +253,7 @@ MenuPositioner.propTypes /* remove-proptypes */ = {
* The CSS position strategy for positioning the Menu popup element.
* @default 'absolute'
*/
positionStrategy: PropTypes.oneOf(['absolute', 'fixed']),
positionMethod: PropTypes.oneOf(['absolute', 'fixed']),
/**
* A function to customize rendering of the component.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export namespace useMenuPositioner {
* The CSS position strategy for positioning the Menu popup element.
* @default 'absolute'
*/
positionStrategy?: 'absolute' | 'fixed';
positionMethod?: 'absolute' | 'fixed';
/**
* The container element to which the Menu popup will be appended to.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const PopoverPositioner = React.forwardRef(function PopoverPositioner(
anchor,
container,
keepMounted = false,
positionStrategy = 'absolute',
positionMethod = 'absolute',
side = 'bottom',
alignment = 'center',
sideOffset = 0,
Expand All @@ -51,7 +51,7 @@ const PopoverPositioner = React.forwardRef(function PopoverPositioner(
const positioner = usePopoverPositioner({
anchor: anchor || triggerElement,
floatingRootContext,
positionStrategy,
positionMethod,
open,
keepMounted,
side,
Expand Down Expand Up @@ -220,7 +220,7 @@ PopoverPositioner.propTypes /* remove-proptypes */ = {
* The CSS position strategy for positioning the popover element.
* @default 'absolute'
*/
positionStrategy: PropTypes.oneOf(['absolute', 'fixed']),
positionMethod: PropTypes.oneOf(['absolute', 'fixed']),
/**
* A function to customize rendering of the component.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export namespace usePopoverPositioner {
* The CSS position strategy for positioning the popover element.
* @default 'absolute'
*/
positionStrategy?: 'absolute' | 'fixed';
positionMethod?: 'absolute' | 'fixed';
/**
* The side of the anchor element that the popover element should be placed at.
* @default 'bottom'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const PreviewCardPositioner = React.forwardRef(function PreviewCardPositioner(
render,
className,
anchor,
positionStrategy = 'absolute',
positionMethod = 'absolute',
side = 'bottom',
alignment = 'center',
sideOffset = 0,
Expand All @@ -50,7 +50,7 @@ const PreviewCardPositioner = React.forwardRef(function PreviewCardPositioner(
const positioner = usePreviewCardPositioner({
anchor: anchor || triggerElement,
floatingRootContext,
positionStrategy,
positionMethod,
container,
open,
mounted,
Expand Down Expand Up @@ -214,7 +214,7 @@ PreviewCardPositioner.propTypes /* remove-proptypes */ = {
* The CSS position strategy for positioning the preview card popup element.
* @default 'absolute'
*/
positionStrategy: PropTypes.oneOf(['absolute', 'fixed']),
positionMethod: PropTypes.oneOf(['absolute', 'fixed']),
/**
* A function to customize rendering of the component.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export namespace usePreviewCardPositioner {
* The CSS position strategy for positioning the preview card popup element.
* @default 'absolute'
*/
positionStrategy?: 'absolute' | 'fixed';
positionMethod?: 'absolute' | 'fixed';
/**
* The container element to which the preview card popup will be appended to.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const TooltipPositioner = React.forwardRef(function TooltipPositioner(
anchor,
container,
keepMounted = false,
positionStrategy = 'absolute',
positionMethod = 'absolute',
side = 'top',
alignment = 'center',
sideOffset = 0,
Expand All @@ -57,7 +57,7 @@ const TooltipPositioner = React.forwardRef(function TooltipPositioner(
const positioner = useTooltipPositioner({
anchor: anchor || triggerElement,
floatingRootContext,
positionStrategy,
positionMethod,
open,
keepMounted,
side,
Expand Down Expand Up @@ -219,7 +219,7 @@ TooltipPositioner.propTypes /* remove-proptypes */ = {
* The CSS position strategy for positioning the tooltip element.
* @default 'absolute'
*/
positionStrategy: PropTypes.oneOf(['absolute', 'fixed']),
positionMethod: PropTypes.oneOf(['absolute', 'fixed']),
/**
* A function to customize rendering of the component.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export namespace useTooltipPositioner {
* The CSS position strategy for positioning the tooltip element.
* @default 'absolute'
*/
positionStrategy?: 'absolute' | 'fixed';
positionMethod?: 'absolute' | 'fixed';
/**
* The side of the anchor element that the tooltip element should be placed at.
* @default 'top'
Expand Down
6 changes: 3 additions & 3 deletions packages/mui-base/src/utils/useAnchorPositioning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ interface UseAnchorPositioningParameters {
| (() => Element | VirtualElement | null)
| React.MutableRefObject<Element | null>
| null;
positionStrategy?: 'absolute' | 'fixed';
positionMethod?: 'absolute' | 'fixed';
side?: Side;
sideOffset?: number;
alignment?: 'start' | 'center' | 'end';
Expand Down Expand Up @@ -72,7 +72,7 @@ export function useAnchorPositioning(
const {
anchor,
floatingRootContext,
positionStrategy = 'absolute',
positionMethod = 'absolute',
side = 'top',
sideOffset = 0,
alignment = 'center',
Expand Down Expand Up @@ -198,7 +198,7 @@ export function useAnchorPositioning(
rootContext: floatingRootContext,
placement,
middleware,
strategy: positionStrategy,
strategy: positionMethod,
whileElementsMounted: keepMounted || !trackAnchor ? undefined : autoUpdate,
nodeId,
});
Expand Down
Loading