UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

44 lines 3.26 kB
define(["require", "exports", "tslib", "react", "office-ui-fabric-react/lib/Button", "office-ui-fabric-react/lib/Callout", "office-ui-fabric-react/lib/Link", "./CalloutExample.scss"], function (require, exports, tslib_1, React, Button_1, Callout_1, Link_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var CalloutBasicExample = (function (_super) { tslib_1.__extends(CalloutBasicExample, _super); function CalloutBasicExample() { var _this = _super.call(this) || this; _this._onShowMenuClicked = _this._onShowMenuClicked.bind(_this); _this._onCalloutDismiss = _this._onCalloutDismiss.bind(_this); _this.state = { isCalloutVisible: false }; return _this; } CalloutBasicExample.prototype.render = function () { var _this = this; var isCalloutVisible = this.state.isCalloutVisible; return (React.createElement("div", { className: 'ms-CalloutExample' }, React.createElement("div", { className: 'ms-CalloutBasicExample-buttonArea', ref: function (menuButton) { return _this._menuButtonElement = menuButton; } }, React.createElement(Button_1.DefaultButton, { onClick: this._onShowMenuClicked, text: isCalloutVisible ? 'Hide callout' : 'Show callout' })), isCalloutVisible && (React.createElement(Callout_1.Callout, { className: 'ms-CalloutExample-callout', ariaLabelledBy: 'callout-label-1', ariaDescribedBy: 'callout-description-1', role: 'alertdialog', gapSpace: 0, targetElement: this._menuButtonElement, onDismiss: this._onCalloutDismiss, setInitialFocus: true }, React.createElement("div", { className: 'ms-CalloutExample-header' }, React.createElement("p", { className: 'ms-CalloutExample-title', id: 'callout-label-1' }, "All of your favorite people")), React.createElement("div", { className: 'ms-CalloutExample-inner' }, React.createElement("div", { className: 'ms-CalloutExample-content' }, React.createElement("p", { className: 'ms-CalloutExample-subText', id: 'callout-description-1' }, "Message body is optional. If help documentation is available, consider adding a link to learn more at the bottom.")), React.createElement("div", { className: 'ms-CalloutExample-actions' }, React.createElement(Link_1.Link, { className: 'ms-CalloutExample-link', href: 'http://microsoft.com' }, "Go to microsoft"))))))); }; CalloutBasicExample.prototype._onShowMenuClicked = function () { this.setState({ isCalloutVisible: !this.state.isCalloutVisible }); }; CalloutBasicExample.prototype._onCalloutDismiss = function () { this.setState({ isCalloutVisible: false }); }; return CalloutBasicExample; }(React.Component)); exports.CalloutBasicExample = CalloutBasicExample; }); //# sourceMappingURL=../../../../src/components/Callout/examples/Callout.Basic.Example.js.map