UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

51 lines 2.69 kB
import * as tslib_1 from "tslib"; import * as React from 'react'; import { autobind } from '../../../Utilities'; import { Dialog, DialogType, DialogFooter } from 'office-ui-fabric-react/lib/Dialog'; import { PrimaryButton, DefaultButton } from 'office-ui-fabric-react/lib/Button'; import './Dialog.Basic.Example.scss'; var DialogBasicExample = /** @class */ (function (_super) { tslib_1.__extends(DialogBasicExample, _super); function DialogBasicExample(props) { var _this = _super.call(this, props) || this; _this.state = { hideDialog: true }; return _this; } DialogBasicExample.prototype.render = function () { return (React.createElement("div", null, React.createElement(DefaultButton, { description: 'Opens the Sample Dialog', onClick: this._showDialog, text: 'Open Dialog' }), React.createElement("label", { id: 'myLabelId', className: 'screenReaderOnly' }, "My sample Label"), React.createElement("label", { id: 'mySubTextId', className: 'screenReaderOnly' }, "My Sample description"), React.createElement(Dialog, { hidden: this.state.hideDialog, onDismiss: this._closeDialog, dialogContentProps: { type: DialogType.normal, title: 'All emails together', subText: 'Your Inbox has changed. No longer does it include favorites, it is a singular destination for your emails.' }, modalProps: { titleAriaId: 'myLabelId', subtitleAriaId: 'mySubTextId', isBlocking: false, containerClassName: 'ms-dialogMainOverride' } }, null /** You can also include null values as the result of conditionals */, React.createElement(DialogFooter, null, React.createElement(PrimaryButton, { onClick: this._closeDialog, text: 'Save' }), React.createElement(DefaultButton, { onClick: this._closeDialog, text: 'Cancel' }))))); }; DialogBasicExample.prototype._showDialog = function () { this.setState({ hideDialog: false }); }; DialogBasicExample.prototype._closeDialog = function () { this.setState({ hideDialog: true }); }; tslib_1.__decorate([ autobind ], DialogBasicExample.prototype, "_showDialog", null); tslib_1.__decorate([ autobind ], DialogBasicExample.prototype, "_closeDialog", null); return DialogBasicExample; }(React.Component)); export { DialogBasicExample }; //# sourceMappingURL=Dialog.Basic.Example.js.map