UNPKG

@uifabric/experiments

Version:

Experimental React components for building experiences for Office 365.

26 lines 1.46 kB
import * as tslib_1 from "tslib"; /** @jsx withSlots */ import { ContextualMenu, DirectionalHint, Stack, Text } from 'office-ui-fabric-react'; import { withSlots, getSlots } from '../../../Foundation'; import { Icon } from '../../../utilities/factoryComponents'; import { Button } from '../Button'; export var MenuButtonView = function (props) { var children = props.children, disabled = props.disabled, onClick = props.onClick, expanded = props.expanded, onMenuDismiss = props.onMenuDismiss, menuTarget = props.menuTarget, rest = tslib_1.__rest(props, ["children", "disabled", "onClick", "expanded", "onMenuDismiss", "menuTarget"]); var Slots = getSlots(props, { root: 'div', button: Button, stack: Stack, icon: Icon, content: Text, menu: ContextualMenu, menuIcon: Icon }); return (withSlots(Slots.root, { type: "button" // stack doesn't take in native button props , role: "button", "aria-disabled": disabled }, withSlots(Slots.button, tslib_1.__assign({ onClick: onClick, disabled: disabled }, rest), children, withSlots(Stack.Item, null, withSlots(Slots.menuIcon, { iconName: "ChevronDown" }))), expanded && (withSlots(Slots.menu, { target: menuTarget, onDismiss: onMenuDismiss, items: [], directionalHint: DirectionalHint.bottomRightEdge })))); }; //# sourceMappingURL=MenuButton.view.js.map