UNPKG

@uifabric/experiments

Version:

Experimental React components for building experiences for Microsoft 365.

32 lines 1.88 kB
import { __assign, __rest } from "tslib"; /** @jsx withSlots */ import { ContextualMenu, DirectionalHint, Text } from 'office-ui-fabric-react'; import { withSlots } from '../../../Foundation'; import { FontIcon } from '../../../utilities/factoryComponents'; import { Button } from '../Button'; /* eslint-disable deprecation/deprecation */ /** @deprecated */ export var MenuButtonSlots = function (props) { return ({ root: 'div', button: Button, icon: FontIcon, content: Text, menuArea: 'div', menu: ContextualMenu, menuIcon: FontIcon, }); }; /** @deprecated */ export var MenuButtonView = function (props, slots) { var children = props.children, disabled = props.disabled, onClick = props.onClick, allowDisabledFocus = props.allowDisabledFocus, keytips = props.keytipProps, menu = props.menu, expanded = props.expanded, onMenuDismiss = props.onMenuDismiss, menuButtonRef = props.menuButtonRef, styles = props.styles, rest = __rest(props, ["children", "disabled", "onClick", "allowDisabledFocus", "keytipProps", "menu", "expanded", "onMenuDismiss", "menuButtonRef", "styles"]); var keytipProps = props.keytipProps; if (keytipProps && menu) { keytipProps = __assign(__assign({}, keytipProps), { hasMenu: true }); } return (withSlots(slots.root, { ref: menuButtonRef }, withSlots(slots.button, __assign({ "aria-expanded": expanded, onClick: onClick, disabled: disabled, allowDisabledFocus: allowDisabledFocus, keytipProps: keytipProps }, rest), children, withSlots(slots.menuArea, null, withSlots(slots.menuIcon, { iconName: "ChevronDown" }))), expanded && (withSlots(slots.menu, { target: menuButtonRef && menuButtonRef.current, onDismiss: onMenuDismiss, items: [], directionalHint: DirectionalHint.bottomRightEdge })))); }; //# sourceMappingURL=MenuButton.view.js.map