UNPKG

@uifabric/experiments

Version:

Experimental React components for building experiences for Microsoft 365.

39 lines 5.82 kB
"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"); var MenuButton_1 = require("../MenuButton/MenuButton"); /* eslint-disable deprecation/deprecation */ /** @deprecated */ exports.SplitButtonSlots = function (props) { return ({ root: 'span', button: Button_1.Button, menuButton: MenuButton_1.MenuButton, icon: factoryComponents_1.FontIcon, content: office_ui_fabric_react_1.Text, menuArea: 'span', menu: office_ui_fabric_react_1.ContextualMenu, menuIcon: factoryComponents_1.FontIcon, splitDividerContainer: 'span', splitDivider: 'span', }); }; /** @deprecated */ exports.SplitButtonView = function (props, slots) { var styles = props.styles, tokens = props.tokens, children = props.children, content = props.content, primary = props.primary, disabled = props.disabled, onClick = props.onClick, onKeyDown = props.onKeyDown, allowDisabledFocus = props.allowDisabledFocus, ariaLabel = props.ariaLabel, keytipProps = props.keytipProps, defaultExpanded = props.defaultExpanded, expanded = props.expanded, onMenuDismiss = props.onMenuDismiss, primaryActionDisabled = props.primaryActionDisabled, secondaryAriaLabel = props.secondaryAriaLabel, onSecondaryActionClick = props.onSecondaryActionClick, root = props.root, button = props.button, menu = props.menu, buttonRef = props.buttonRef, menuButtonRef = props.menuButtonRef, rest = tslib_1.__rest(props, ["styles", "tokens", "children", "content", "primary", "disabled", "onClick", "onKeyDown", "allowDisabledFocus", "ariaLabel", "keytipProps", "defaultExpanded", "expanded", "onMenuDismiss", "primaryActionDisabled", "secondaryAriaLabel", "onSecondaryActionClick", "root", "button", "menu", "buttonRef", "menuButtonRef"]); var menuButtonAriaLabel = secondaryAriaLabel ? secondaryAriaLabel : ariaLabel ? ariaLabel : content; var _a = tokens, contentPadding = _a.contentPadding, contentPaddingFocused = _a.contentPaddingFocused, secondaryPadding = _a.secondaryPadding, splitButtonTokens = tslib_1.__rest(_a, ["contentPadding", "contentPaddingFocused", "secondaryPadding"]); var backgroundColor = splitButtonTokens.backgroundColor, backgroundColorHovered = splitButtonTokens.backgroundColorHovered, backgroundColorPressed = splitButtonTokens.backgroundColorPressed, borderColor = splitButtonTokens.borderColor, borderColorHovered = splitButtonTokens.borderColorHovered, borderColorPressed = splitButtonTokens.borderColorPressed, color = splitButtonTokens.color, colorHovered = splitButtonTokens.colorHovered, colorPressed = splitButtonTokens.colorPressed, highContrastBackgroundColor = splitButtonTokens.highContrastBackgroundColor, highContrastBackgroundColorHovered = splitButtonTokens.highContrastBackgroundColorHovered, highContrastBackgroundColorPressed = splitButtonTokens.highContrastBackgroundColorPressed, highContrastBorderColor = splitButtonTokens.highContrastBorderColor, highContrastBorderColorHovered = splitButtonTokens.highContrastBorderColorHovered, highContrastBorderColorPressed = splitButtonTokens.highContrastBorderColorPressed, highContrastColor = splitButtonTokens.highContrastColor, highContrastColorHovered = splitButtonTokens.highContrastColorHovered, highContrastColorPressed = splitButtonTokens.highContrastColorPressed, highContrastIconColor = splitButtonTokens.highContrastIconColor, highContrastIconColorHovered = splitButtonTokens.highContrastIconColorHovered, highContrastIconColorPressed = splitButtonTokens.highContrastIconColorPressed, iconColor = splitButtonTokens.iconColor, iconColorHovered = splitButtonTokens.iconColorHovered, iconColorPressed = splitButtonTokens.iconColorPressed, nonColoredButtonTokens = tslib_1.__rest(splitButtonTokens, ["backgroundColor", "backgroundColorHovered", "backgroundColorPressed", "borderColor", "borderColorHovered", "borderColorPressed", "color", "colorHovered", "colorPressed", "highContrastBackgroundColor", "highContrastBackgroundColorHovered", "highContrastBackgroundColorPressed", "highContrastBorderColor", "highContrastBorderColorHovered", "highContrastBorderColorPressed", "highContrastColor", "highContrastColorHovered", "highContrastColorPressed", "highContrastIconColor", "highContrastIconColorHovered", "highContrastIconColorPressed", "iconColor", "iconColorHovered", "iconColorPressed"]); var buttonTokens = primaryActionDisabled ? tslib_1.__assign({ contentPadding: contentPadding, contentPaddingFocused: contentPaddingFocused }, nonColoredButtonTokens) : tokens; var menuButtonTokens = tslib_1.__assign({ contentPadding: secondaryPadding }, splitButtonTokens); return (Foundation_1.withSlots(slots.root, null, Foundation_1.withSlots(slots.button, tslib_1.__assign({ primary: primary, disabled: primaryActionDisabled || disabled, allowDisabledFocus: allowDisabledFocus, ariaLabel: ariaLabel, onClick: onClick, componentRef: buttonRef, content: content, onKeyDown: onKeyDown, tokens: buttonTokens }, rest), children), Foundation_1.withSlots(slots.splitDividerContainer, null, Foundation_1.withSlots(slots.splitDivider, null)), Foundation_1.withSlots(slots.menuButton, { primary: primary, disabled: disabled, defaultExpanded: defaultExpanded, expanded: expanded, allowDisabledFocus: allowDisabledFocus, ariaLabel: menuButtonAriaLabel, onClick: onSecondaryActionClick, componentRef: menuButtonRef, keytipProps: keytipProps, menu: menu, onKeyDown: onKeyDown, onMenuDismiss: onMenuDismiss, tokens: menuButtonTokens }))); }; //# sourceMappingURL=SplitButton.view.js.map