@uifabric/experiments
Version:
Experimental React components for building experiences for Microsoft 365.
34 lines • 2.16 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
/** @jsx withSlots */
var office_ui_fabric_react_1 = require("office-ui-fabric-react");
var Foundation_1 = require("../../../Foundation");
var factoryComponents_1 = require("../../../utilities/factoryComponents");
var Button_1 = require("../Button");
/* 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