UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

42 lines 1.69 kB
"use strict"; var _a; Object.defineProperty(exports, "__esModule", { value: true }); var React = require("react"); var office_ui_fabric_react_1 = require("office-ui-fabric-react"); var customSplitButtonStyles = { splitButtonMenuButton: { backgroundColor: 'white', width: 28, border: 'none' }, splitButtonMenuIcon: { fontSize: '7px' }, splitButtonDivider: { borderLeft: '1px solid #c8c8c8', right: 26 }, splitButtonContainer: { selectors: (_a = {}, _a[office_ui_fabric_react_1.HighContrastSelector] = { border: 'none' }, _a) } }; var menuProps = { items: [ { key: 'emailMessage', text: 'Email message', iconProps: { iconName: 'Mail' } }, { key: 'calendarEvent', text: 'Calendar event', iconProps: { iconName: 'Calendar' } } ] }; var addIcon = { iconName: 'Add' }; exports.ButtonSplitCustomExample = function (props) { var disabled = props.disabled, checked = props.checked; return (React.createElement("div", null, React.createElement(office_ui_fabric_react_1.Label, null, "Split button with icon and custom styles"), React.createElement(office_ui_fabric_react_1.IconButton, { split: true, iconProps: addIcon, splitButtonAriaLabel: "See 2 options", "aria-roledescription": "split button", styles: customSplitButtonStyles, menuProps: menuProps, // This text is hidden by the styles text: "New item", onClick: _alertClicked, disabled: disabled, checked: checked }))); }; function _alertClicked() { alert('Clicked'); } //# sourceMappingURL=Button.CustomSplit.Example.js.map