@uifabric/experiments
Version:
Experimental React components for building experiences for Microsoft 365.
30 lines • 2.24 kB
JavaScript
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 });
/* eslint-disable deprecation/deprecation */
/** @deprecated */
exports.MenuButtonSlots = function (props) { return ({
root: 'div',
button: Button_1.Button,
icon: factoryComponents_1.FontIcon,
content: office_ui_fabric_react_1.Text,
menuArea: 'div',
menu: office_ui_fabric_react_1.ContextualMenu,
menuIcon: factoryComponents_1.FontIcon,
}); };
/** @deprecated */
exports.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 = tslib_1.__rest(props, ["children", "disabled", "onClick", "allowDisabledFocus", "keytipProps", "menu", "expanded", "onMenuDismiss", "menuButtonRef", "styles"]);
var keytipProps = props.keytipProps;
if (keytipProps && menu) {
keytipProps = tslib_1.__assign(tslib_1.__assign({}, keytipProps), { hasMenu: true });
}
return (Foundation_1.withSlots(slots.root, { ref: menuButtonRef },
Foundation_1.withSlots(slots.button, tslib_1.__assign({ "aria-expanded": expanded, onClick: onClick, disabled: disabled, allowDisabledFocus: allowDisabledFocus, keytipProps: keytipProps }, rest),
children,
Foundation_1.withSlots(slots.menuArea, null,
Foundation_1.withSlots(slots.menuIcon, { iconName: "ChevronDown" }))),
expanded && (Foundation_1.withSlots(slots.menu, { target: menuButtonRef && menuButtonRef.current, onDismiss: onMenuDismiss, items: [], directionalHint: office_ui_fabric_react_1.DirectionalHint.bottomRightEdge }))));
};
});
//# sourceMappingURL=MenuButton.view.js.map