office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
62 lines (60 loc) • 3.24 kB
JavaScript
define(["require", "exports", "tslib", "react", "office-ui-fabric-react/lib/Button", "office-ui-fabric-react/lib/Label"], function (require, exports, tslib_1, React, Button_1, Label_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ButtonSplitExample = (function (_super) {
tslib_1.__extends(ButtonSplitExample, _super);
function ButtonSplitExample() {
return _super.call(this) || this;
}
ButtonSplitExample.prototype.render = function () {
var _a = this.props, disabled = _a.disabled, checked = _a.checked;
return (React.createElement("div", null,
React.createElement(Label_1.Label, null, "Split button"),
React.createElement(Button_1.DefaultButton, { "data-automation-id": 'test', disabled: disabled, checked: checked, text: 'Create account', onClick: function () { return alert('Clicked'); }, split: true, menuProps: {
items: [
{
key: 'emailMessage',
name: 'Email message',
icon: 'Mail'
},
{
key: 'calendarEvent',
name: 'Calendar event',
icon: 'Calendar'
}
]
} })));
};
return ButtonSplitExample;
}(React.Component));
exports.ButtonSplitExample = ButtonSplitExample;
var ButtonSplitCustomExample = (function (_super) {
tslib_1.__extends(ButtonSplitCustomExample, _super);
function ButtonSplitCustomExample() {
return _super.call(this) || this;
}
ButtonSplitCustomExample.prototype.render = function () {
var _a = this.props, disabled = _a.disabled, checked = _a.checked;
var style = { splitButtonMenuButton: { backgroundColor: 'white', width: '10px' }, splitButtonMenuIcon: { fontSize: '7px' } };
return (React.createElement("div", null,
React.createElement(Label_1.Label, null, "Custom Split button"),
React.createElement(Button_1.IconButton, { "data-automation-id": 'test', disabled: disabled, checked: checked, iconProps: { iconName: 'Emoji2' }, text: 'Create account', onClick: function () { return alert('Clicked'); }, split: true, styles: style, menuProps: {
items: [
{
key: 'emailMessage',
name: 'Email message',
icon: 'Mail'
},
{
key: 'calendarEvent',
name: 'Calendar event',
icon: 'Calendar'
}
]
} })));
};
return ButtonSplitCustomExample;
}(React.Component));
exports.ButtonSplitCustomExample = ButtonSplitCustomExample;
});
//# sourceMappingURL=Button.Split.Example.js.map