UNPKG

@uifabric/experiments

Version:

Experimental React components for building experiences for Office 365.

24 lines 1.82 kB
define(["require", "exports", "tslib", "office-ui-fabric-react", "../../../Foundation", "../../../utilities/factoryComponents", "../Button"], function (require, exports, tslib_1, office_ui_fabric_react_1, Foundation_1, factoryComponents_1, Button_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.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 = Foundation_1.getSlots(props, { root: 'div', button: Button_1.Button, stack: office_ui_fabric_react_1.Stack, icon: factoryComponents_1.Icon, content: office_ui_fabric_react_1.Text, menu: office_ui_fabric_react_1.ContextualMenu, menuIcon: factoryComponents_1.Icon }); return (Foundation_1.withSlots(Slots.root, { type: "button" // stack doesn't take in native button props , role: "button", "aria-disabled": disabled }, Foundation_1.withSlots(Slots.button, tslib_1.__assign({ onClick: onClick, disabled: disabled }, rest), children, Foundation_1.withSlots(office_ui_fabric_react_1.Stack.Item, null, Foundation_1.withSlots(Slots.menuIcon, { iconName: "ChevronDown" }))), expanded && (Foundation_1.withSlots(Slots.menu, { target: menuTarget, onDismiss: onMenuDismiss, items: [], directionalHint: office_ui_fabric_react_1.DirectionalHint.bottomRightEdge })))); }; }); //# sourceMappingURL=MenuButton.view.js.map