Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99922579
MenuItemUnstyled.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Jan 27, 07:24
Size
3 KB
Mime Type
text/x-java
Expires
Wed, Jan 29, 07:24 (2 d)
Engine
blob
Format
Raw Data
Handle
23808916
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
MenuItemUnstyled.js
View Options
import
_extends
from
"@babel/runtime/helpers/esm/extends"
;
import
_objectWithoutPropertiesLoose
from
"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"
;
const
_excluded
=
[
"children"
,
"disabled"
,
"component"
,
"label"
,
"slotProps"
,
"slots"
];
import
*
as
React
from
'react'
;
import
PropTypes
from
'prop-types'
;
import
{
getMenuItemUnstyledUtilityClass
}
from
'./menuItemUnstyledClasses'
;
import
useMenuItem
from
'./useMenuItem'
;
import
composeClasses
from
'../composeClasses'
;
import
useSlotProps
from
'../utils/useSlotProps'
;
import
{
jsx
as
_jsx
}
from
"react/jsx-runtime"
;
function
getUtilityClasses
(
ownerState
)
{
const
{
disabled
,
focusVisible
}
=
ownerState
;
const
slots
=
{
root
:
[
'root'
,
disabled
&&
'disabled'
,
focusVisible
&&
'focusVisible'
]
};
return
composeClasses
(
slots
,
getMenuItemUnstyledUtilityClass
,
{});
}
/**
*
* Demos:
*
* - [Unstyled Menu](https://mui.com/base/react-menu/)
*
* API:
*
* - [MenuItemUnstyled API](https://mui.com/base/api/menu-item-unstyled/)
*/
const
MenuItemUnstyled
=
/*#__PURE__*/
React
.
forwardRef
(
function
MenuItemUnstyled
(
props
,
ref
)
{
var
_ref
;
const
{
children
,
disabled
:
disabledProp
=
false
,
component
,
label
,
slotProps
=
{},
slots
=
{}
}
=
props
,
other
=
_objectWithoutPropertiesLoose
(
props
,
_excluded
);
const
{
getRootProps
,
disabled
,
focusVisible
}
=
useMenuItem
({
disabled
:
disabledProp
,
ref
,
label
});
const
ownerState
=
_extends
({},
props
,
{
disabled
,
focusVisible
});
const
classes
=
getUtilityClasses
(
ownerState
);
const
Root
=
(
_ref
=
component
!=
null
?
component
:
slots
.
root
)
!=
null
?
_ref
:
'li'
;
const
rootProps
=
useSlotProps
({
elementType
:
Root
,
getSlotProps
:
getRootProps
,
externalSlotProps
:
slotProps
.
root
,
externalForwardedProps
:
other
,
className
:
classes
.
root
,
ownerState
});
return
/*#__PURE__*/
_jsx
(
Root
,
_extends
({},
rootProps
,
{
children
:
children
}));
});
process
.
env
.
NODE_ENV
!==
"production"
?
MenuItemUnstyled
.
propTypes
/* remove-proptypes */
=
{
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit TypeScript types and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* @ignore
*/
children
:
PropTypes
.
node
,
/**
* The component used for the root node.
* Either a string to use a HTML element or a component.
*/
component
:
PropTypes
.
elementType
,
/**
* If `true`, the menu item will be disabled.
* @default false
*/
disabled
:
PropTypes
.
bool
,
/**
* A text representation of the menu item's content.
* Used for keyboard text navigation matching.
*/
label
:
PropTypes
.
string
,
/**
* The props used for each slot inside the MenuItem.
* @default {}
*/
slotProps
:
PropTypes
.
shape
({
root
:
PropTypes
.
oneOfType
([
PropTypes
.
func
,
PropTypes
.
object
])
}),
/**
* The components used for each slot inside the MenuItem.
* Either a string to use a HTML element or a component.
* @default {}
*/
slots
:
PropTypes
.
shape
({
root
:
PropTypes
.
elementType
})
}
:
void
0
;
export
default
MenuItemUnstyled
;
Event Timeline
Log In to Comment