You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.4 KiB
51 lines
1.4 KiB
import classNames from 'classnames';
|
|
import * as React from 'react';
|
|
import { useBootstrapPrefix } from './ThemeProvider';
|
|
import Dropdown from './Dropdown';
|
|
import NavLink from './NavLink';
|
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
const NavDropdown = /*#__PURE__*/React.forwardRef(({
|
|
id,
|
|
title,
|
|
children,
|
|
bsPrefix,
|
|
className,
|
|
rootCloseEvent,
|
|
menuRole,
|
|
disabled,
|
|
active,
|
|
renderMenuOnMount,
|
|
menuVariant,
|
|
...props
|
|
}, ref) => {
|
|
/* NavItem has no additional logic, it's purely presentational. Can set nav item class here to support "as" */
|
|
const navItemPrefix = useBootstrapPrefix(undefined, 'nav-item');
|
|
return /*#__PURE__*/_jsxs(Dropdown, {
|
|
ref: ref,
|
|
...props,
|
|
className: classNames(className, navItemPrefix),
|
|
children: [/*#__PURE__*/_jsx(Dropdown.Toggle, {
|
|
id: id,
|
|
eventKey: null,
|
|
active: active,
|
|
disabled: disabled,
|
|
childBsPrefix: bsPrefix,
|
|
as: NavLink,
|
|
children: title
|
|
}), /*#__PURE__*/_jsx(Dropdown.Menu, {
|
|
role: menuRole,
|
|
renderOnMount: renderMenuOnMount,
|
|
rootCloseEvent: rootCloseEvent,
|
|
variant: menuVariant,
|
|
children: children
|
|
})]
|
|
});
|
|
});
|
|
NavDropdown.displayName = 'NavDropdown';
|
|
export default Object.assign(NavDropdown, {
|
|
Item: Dropdown.Item,
|
|
ItemText: Dropdown.ItemText,
|
|
Divider: Dropdown.Divider,
|
|
Header: Dropdown.Header
|
|
}); |